mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Code cleanup.
This commit is contained in:
parent
0c072c7d51
commit
73f0cc705b
1
.gitignore
vendored
1
.gitignore
vendored
@ -11,3 +11,4 @@ result.html
|
||||
test-import.sh
|
||||
test-import-report.txt
|
||||
public/google*.html
|
||||
_ide_helper_models.php
|
||||
|
@ -118,6 +118,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
|
||||
*/
|
||||
public function setCategories(Collection $categories): ReportGeneratorInterface
|
||||
{
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -211,6 +211,9 @@ class MonthReportGenerator extends Support implements ReportGeneratorInterface
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
private function getAverageIncome(): array
|
||||
{
|
||||
$expenses = $this->getIncome();
|
||||
|
@ -95,5 +95,6 @@ class MonthReportGenerator implements ReportGeneratorInterface
|
||||
*/
|
||||
public function setCategories(Collection $categories): ReportGeneratorInterface
|
||||
{
|
||||
return $this;
|
||||
}
|
||||
}
|
@ -67,6 +67,7 @@ class MultiYearReportGenerator implements ReportGeneratorInterface
|
||||
*/
|
||||
public function setCategories(Collection $categories): ReportGeneratorInterface
|
||||
{
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -67,6 +67,7 @@ class YearReportGenerator implements ReportGeneratorInterface
|
||||
*/
|
||||
public function setCategories(Collection $categories): ReportGeneratorInterface
|
||||
{
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -353,25 +353,6 @@ class CategoryReportController extends Controller
|
||||
return $set;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Collection $set
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
private function groupByAccount(Collection $set): array
|
||||
{
|
||||
// group by category ID:
|
||||
$grouped = [];
|
||||
/** @var Transaction $transaction */
|
||||
foreach ($set as $transaction) {
|
||||
$accountId = $transaction->account_id;
|
||||
$grouped[$accountId] = $grouped[$accountId] ?? '0';
|
||||
$grouped[$accountId] = bcadd($transaction->transaction_amount, $grouped[$accountId]);
|
||||
}
|
||||
|
||||
return $grouped;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Collection $set
|
||||
*
|
||||
|
@ -100,8 +100,9 @@ class ReportController extends Controller
|
||||
* @param Carbon $end
|
||||
* @param Collection $accounts
|
||||
*
|
||||
* @param Collection $categories
|
||||
*
|
||||
* @return string
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function categoryReport(Carbon $start, Carbon $end, Collection $accounts, Collection $categories)
|
||||
{
|
||||
|
@ -35,6 +35,7 @@ class SearchController extends Controller
|
||||
/**
|
||||
* Results always come in the form of an array [results, count, fullCount]
|
||||
*
|
||||
* @param Request $request
|
||||
* @param SearchInterface $searcher
|
||||
*
|
||||
* @return $this
|
||||
|
@ -79,6 +79,10 @@ class ReportFormRequest extends Request
|
||||
return $collection;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Carbon
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function getEndDate(): Carbon
|
||||
{
|
||||
$date = new Carbon;
|
||||
|
@ -27,6 +27,11 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
use Watson\Validating\ValidatingTrait;
|
||||
|
||||
|
||||
/**
|
||||
* Class Account
|
||||
*
|
||||
* @package FireflyIII\Models
|
||||
*/
|
||||
class Account extends Model
|
||||
{
|
||||
use SoftDeletes, ValidatingTrait;
|
||||
|
@ -16,6 +16,11 @@ namespace FireflyIII\Models;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* Class AccountMeta
|
||||
*
|
||||
* @package FireflyIII\Models
|
||||
*/
|
||||
class AccountMeta extends Model
|
||||
{
|
||||
|
||||
|
@ -16,6 +16,11 @@ namespace FireflyIII\Models;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
/**
|
||||
* Class AccountType
|
||||
*
|
||||
* @package FireflyIII\Models
|
||||
*/
|
||||
class AccountType extends Model
|
||||
{
|
||||
const DEFAULT = 'Default account';
|
||||
|
@ -20,6 +20,11 @@ use Illuminate\Database\Eloquent\Relations\MorphTo;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
|
||||
/**
|
||||
* Class Attachment
|
||||
*
|
||||
* @package FireflyIII\Models
|
||||
*/
|
||||
class Attachment extends Model
|
||||
{
|
||||
use SoftDeletes;
|
||||
|
@ -20,6 +20,11 @@ use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
use Watson\Validating\ValidatingTrait;
|
||||
|
||||
/**
|
||||
* Class Bill
|
||||
*
|
||||
* @package FireflyIII\Models
|
||||
*/
|
||||
class Bill extends Model
|
||||
{
|
||||
|
||||
|
@ -20,6 +20,11 @@ use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
use Watson\Validating\ValidatingTrait;
|
||||
|
||||
/**
|
||||
* Class Budget
|
||||
*
|
||||
* @package FireflyIII\Models
|
||||
*/
|
||||
class Budget extends Model
|
||||
{
|
||||
|
||||
|
@ -15,6 +15,11 @@ namespace FireflyIII\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class BudgetLimit
|
||||
*
|
||||
* @package FireflyIII\Models
|
||||
*/
|
||||
class BudgetLimit extends Model
|
||||
{
|
||||
|
||||
|
@ -20,6 +20,11 @@ use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
use Watson\Validating\ValidatingTrait;
|
||||
|
||||
/**
|
||||
* Class Category
|
||||
*
|
||||
* @package FireflyIII\Models
|
||||
*/
|
||||
class Category extends Model
|
||||
{
|
||||
use SoftDeletes, ValidatingTrait;
|
||||
|
@ -16,6 +16,11 @@ namespace FireflyIII\Models;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
/**
|
||||
* Class Configuration
|
||||
*
|
||||
* @package FireflyIII\Models
|
||||
*/
|
||||
class Configuration extends Model
|
||||
{
|
||||
use SoftDeletes;
|
||||
|
@ -16,6 +16,11 @@ namespace FireflyIII\Models;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
|
||||
/**
|
||||
* Class ExportJob
|
||||
*
|
||||
* @package FireflyIII\Models
|
||||
*/
|
||||
class ExportJob extends Model
|
||||
{
|
||||
/**
|
||||
|
@ -18,6 +18,11 @@ use Illuminate\Database\Eloquent\Model;
|
||||
use Storage;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
|
||||
/**
|
||||
* Class ImportJob
|
||||
*
|
||||
* @package FireflyIII\Models
|
||||
*/
|
||||
class ImportJob extends Model
|
||||
{
|
||||
|
||||
|
@ -18,6 +18,11 @@ use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
|
||||
/**
|
||||
* Class LimitRepetition
|
||||
*
|
||||
* @package FireflyIII\Models
|
||||
*/
|
||||
class LimitRepetition extends Model
|
||||
{
|
||||
|
||||
|
@ -16,6 +16,11 @@ namespace FireflyIII\Models;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use League\CommonMark\CommonMarkConverter;
|
||||
|
||||
/**
|
||||
* Class Note
|
||||
*
|
||||
* @package FireflyIII\Models
|
||||
*/
|
||||
class Note extends Model
|
||||
{
|
||||
protected $dates = ['created_at', 'updated_at', 'deleted_at'];
|
||||
|
@ -20,6 +20,11 @@ use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Steam;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
|
||||
/**
|
||||
* Class PiggyBank
|
||||
*
|
||||
* @package FireflyIII\Models
|
||||
*/
|
||||
class PiggyBank extends Model
|
||||
{
|
||||
use SoftDeletes;
|
||||
|
@ -15,6 +15,11 @@ namespace FireflyIII\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class PiggyBankEvent
|
||||
*
|
||||
* @package FireflyIII\Models
|
||||
*/
|
||||
class PiggyBankEvent extends Model
|
||||
{
|
||||
|
||||
|
@ -17,6 +17,11 @@ use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Builder as EloquentBuilder;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class PiggyBankRepetition
|
||||
*
|
||||
* @package FireflyIII\Models
|
||||
*/
|
||||
class PiggyBankRepetition extends Model
|
||||
{
|
||||
|
||||
|
@ -19,6 +19,11 @@ use Illuminate\Contracts\Encryption\DecryptException;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Log;
|
||||
|
||||
/**
|
||||
* Class Preference
|
||||
*
|
||||
* @package FireflyIII\Models
|
||||
*/
|
||||
class Preference extends Model
|
||||
{
|
||||
|
||||
|
@ -16,6 +16,11 @@ namespace FireflyIII\Models;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
|
||||
/**
|
||||
* Class Role
|
||||
*
|
||||
* @package FireflyIII\Models
|
||||
*/
|
||||
class Role extends Model
|
||||
{
|
||||
|
||||
|
@ -17,6 +17,11 @@ use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
|
||||
/**
|
||||
* Class Rule
|
||||
*
|
||||
* @package FireflyIII\Models
|
||||
*/
|
||||
class Rule extends Model
|
||||
{
|
||||
use SoftDeletes;
|
||||
|
@ -22,6 +22,11 @@ namespace FireflyIII\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class RuleAction
|
||||
*
|
||||
* @package FireflyIII\Models
|
||||
*/
|
||||
class RuleAction extends Model
|
||||
{
|
||||
/**
|
||||
|
@ -17,6 +17,11 @@ use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
|
||||
/**
|
||||
* Class RuleGroup
|
||||
*
|
||||
* @package FireflyIII\Models
|
||||
*/
|
||||
class RuleGroup extends Model
|
||||
{
|
||||
use SoftDeletes;
|
||||
|
@ -15,6 +15,11 @@ namespace FireflyIII\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class RuleTrigger
|
||||
*
|
||||
* @package FireflyIII\Models
|
||||
*/
|
||||
class RuleTrigger extends Model
|
||||
{
|
||||
/**
|
||||
|
@ -18,6 +18,11 @@ use FireflyIII\Support\Models\TagSupport;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
use Watson\Validating\ValidatingTrait;
|
||||
|
||||
/**
|
||||
* Class Tag
|
||||
*
|
||||
* @package FireflyIII\Models
|
||||
*/
|
||||
class Tag extends TagSupport
|
||||
{
|
||||
protected $dates = ['created_at', 'updated_at', 'date'];
|
||||
|
@ -19,6 +19,11 @@ use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Watson\Validating\ValidatingTrait;
|
||||
|
||||
/**
|
||||
* Class Transaction
|
||||
*
|
||||
* @package FireflyIII\Models
|
||||
*/
|
||||
class Transaction extends Model
|
||||
{
|
||||
|
||||
|
@ -18,6 +18,11 @@ use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
use Watson\Validating\ValidatingTrait;
|
||||
|
||||
/**
|
||||
* Class TransactionCurrency
|
||||
*
|
||||
* @package FireflyIII\Models
|
||||
*/
|
||||
class TransactionCurrency extends Model
|
||||
{
|
||||
use SoftDeletes, ValidatingTrait;
|
||||
|
@ -16,6 +16,11 @@ namespace FireflyIII\Models;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
/**
|
||||
* Class TransactionGroup
|
||||
*
|
||||
* @package FireflyIII\Models
|
||||
*/
|
||||
class TransactionGroup extends Model
|
||||
{
|
||||
use SoftDeletes;
|
||||
|
@ -25,6 +25,11 @@ use Preferences;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
use Watson\Validating\ValidatingTrait;
|
||||
|
||||
/**
|
||||
* Class TransactionJournal
|
||||
*
|
||||
* @package FireflyIII\Models
|
||||
*/
|
||||
class TransactionJournal extends TransactionJournalSupport
|
||||
{
|
||||
use SoftDeletes, ValidatingTrait;
|
||||
|
@ -16,6 +16,11 @@ namespace FireflyIII\Models;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* Class TransactionJournalMeta
|
||||
*
|
||||
* @package FireflyIII\Models
|
||||
*/
|
||||
class TransactionJournalMeta extends Model
|
||||
{
|
||||
|
||||
|
@ -17,6 +17,11 @@ use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
|
||||
/**
|
||||
* Class TransactionType
|
||||
*
|
||||
* @package FireflyIII\Models
|
||||
*/
|
||||
class TransactionType extends Model
|
||||
{
|
||||
use SoftDeletes;
|
||||
|
@ -13,7 +13,6 @@ declare(strict_types = 1);
|
||||
|
||||
namespace FireflyIII\Repositories\Journal;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Crypt;
|
||||
use DB;
|
||||
use FireflyIII\Models\PiggyBankEvent;
|
||||
@ -22,7 +21,6 @@ use FireflyIII\Models\TransactionJournal;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Query\JoinClause;
|
||||
use Illuminate\Pagination\LengthAwarePaginator;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
/**
|
||||
|
@ -14,9 +14,7 @@ declare(strict_types = 1);
|
||||
namespace FireflyIII\Repositories\Journal;
|
||||
|
||||
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
use Illuminate\Pagination\LengthAwarePaginator;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user