mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-30 02:26:58 +00:00
Code cleanup
This commit is contained in:
@@ -236,7 +236,7 @@ class MigrateToGroups extends Command
|
|||||||
* @param TransactionJournal $journal
|
* @param TransactionJournal $journal
|
||||||
*
|
*
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
*
|
||||||
*/
|
*/
|
||||||
private function makeMultiGroup(TransactionJournal $journal): void
|
private function makeMultiGroup(TransactionJournal $journal): void
|
||||||
{
|
{
|
||||||
|
@@ -248,8 +248,8 @@ class OtherCurrenciesCorrections extends Command
|
|||||||
* Gets the transaction that determines the transaction that "leads" and will determine
|
* Gets the transaction that determines the transaction that "leads" and will determine
|
||||||
* the currency to be used by all transactions, and the journal itself.
|
* the currency to be used by all transactions, and the journal itself.
|
||||||
*
|
*
|
||||||
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
|
|
||||||
* @param TransactionJournal $journal
|
* @param TransactionJournal $journal
|
||||||
|
*
|
||||||
* @return Transaction|null
|
* @return Transaction|null
|
||||||
*/
|
*/
|
||||||
private function getLeadTransaction(TransactionJournal $journal): ?Transaction
|
private function getLeadTransaction(TransactionJournal $journal): ?Transaction
|
||||||
|
@@ -291,8 +291,6 @@ class TransferCurrenciesCorrections extends Command
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
|
||||||
*
|
|
||||||
* @param TransactionJournal $transfer
|
* @param TransactionJournal $transfer
|
||||||
*/
|
*/
|
||||||
private function updateTransferCurrency(TransactionJournal $transfer): void
|
private function updateTransferCurrency(TransactionJournal $transfer): void
|
||||||
|
@@ -36,11 +36,10 @@ class StoredTransactionGroup extends Event
|
|||||||
{
|
{
|
||||||
use SerializesModels;
|
use SerializesModels;
|
||||||
|
|
||||||
|
public $applyRules;
|
||||||
/** @var TransactionGroup The group that was stored. */
|
/** @var TransactionGroup The group that was stored. */
|
||||||
public $transactionGroup;
|
public $transactionGroup;
|
||||||
|
|
||||||
public $applyRules;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new event instance.
|
* Create a new event instance.
|
||||||
*
|
*
|
||||||
|
@@ -29,6 +29,7 @@ use Illuminate\Queue\SerializesModels;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Class UpdatedTransactionGroup.
|
* Class UpdatedTransactionGroup.
|
||||||
|
*
|
||||||
* @codeCoverageIgnore
|
* @codeCoverageIgnore
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
@@ -43,9 +43,7 @@ class GracefulNotFoundHandler extends ExceptionHandler
|
|||||||
*
|
*
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
* @param Exception $exception
|
* @param Exception $exception
|
||||||
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
|
*
|
||||||
* @SuppressWarnings(PHPMD.NPathComplexity)
|
|
||||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
|
||||||
*
|
*
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
|
@@ -48,9 +48,7 @@ class Handler extends ExceptionHandler
|
|||||||
*
|
*
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
* @param Exception $exception
|
* @param Exception $exception
|
||||||
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
|
*
|
||||||
* @SuppressWarnings(PHPMD.NPathComplexity)
|
|
||||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
|
||||||
*
|
*
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
@@ -112,7 +110,7 @@ class Handler extends ExceptionHandler
|
|||||||
*
|
*
|
||||||
* This is a great spot to send exceptions to Sentry etc.
|
* This is a great spot to send exceptions to Sentry etc.
|
||||||
*
|
*
|
||||||
* @SuppressWarnings(PHPMD.CyclomaticComplexity) // it's five its fine.
|
* // it's five its fine.
|
||||||
*
|
*
|
||||||
* @param Exception $exception
|
* @param Exception $exception
|
||||||
*
|
*
|
||||||
|
@@ -189,7 +189,7 @@ class AccountFactory
|
|||||||
* @param null|string $accountType
|
* @param null|string $accountType
|
||||||
*
|
*
|
||||||
* @return AccountType|null
|
* @return AccountType|null
|
||||||
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
|
*
|
||||||
*/
|
*/
|
||||||
protected function getAccountType(?int $accountTypeId, ?string $accountType): ?AccountType
|
protected function getAccountType(?int $accountTypeId, ?string $accountType): ?AccountType
|
||||||
{
|
{
|
||||||
|
@@ -26,7 +26,6 @@ namespace FireflyIII\Factory;
|
|||||||
|
|
||||||
use FireflyIII\Models\Budget;
|
use FireflyIII\Models\Budget;
|
||||||
use FireflyIII\User;
|
use FireflyIII\User;
|
||||||
use Illuminate\Support\Collection;
|
|
||||||
use Log;
|
use Log;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -53,7 +52,7 @@ class BudgetFactory
|
|||||||
* @param null|string $budgetName
|
* @param null|string $budgetName
|
||||||
*
|
*
|
||||||
* @return Budget|null
|
* @return Budget|null
|
||||||
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
|
*
|
||||||
*/
|
*/
|
||||||
public function find(?int $budgetId, ?string $budgetName): ?Budget
|
public function find(?int $budgetId, ?string $budgetName): ?Budget
|
||||||
{
|
{
|
||||||
|
@@ -26,7 +26,6 @@ namespace FireflyIII\Factory;
|
|||||||
|
|
||||||
use FireflyIII\Models\Category;
|
use FireflyIII\Models\Category;
|
||||||
use FireflyIII\User;
|
use FireflyIII\User;
|
||||||
use Illuminate\Support\Collection;
|
|
||||||
use Log;
|
use Log;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -63,7 +62,7 @@ class CategoryFactory
|
|||||||
* @param null|string $categoryName
|
* @param null|string $categoryName
|
||||||
*
|
*
|
||||||
* @return Category|null
|
* @return Category|null
|
||||||
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
|
*
|
||||||
*/
|
*/
|
||||||
public function findOrCreate(?int $categoryId, ?string $categoryName): ?Category
|
public function findOrCreate(?int $categoryId, ?string $categoryName): ?Category
|
||||||
{
|
{
|
||||||
|
@@ -53,7 +53,7 @@ class PiggyBankEventFactory
|
|||||||
* @param PiggyBank|null $piggyBank
|
* @param PiggyBank|null $piggyBank
|
||||||
*
|
*
|
||||||
* @return PiggyBankEvent|null
|
* @return PiggyBankEvent|null
|
||||||
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
|
*
|
||||||
*/
|
*/
|
||||||
public function create(TransactionJournal $journal, ?PiggyBank $piggyBank): ?PiggyBankEvent
|
public function create(TransactionJournal $journal, ?PiggyBank $piggyBank): ?PiggyBankEvent
|
||||||
{
|
{
|
||||||
|
@@ -52,7 +52,7 @@ class PiggyBankFactory
|
|||||||
* @param null|string $piggyBankName
|
* @param null|string $piggyBankName
|
||||||
*
|
*
|
||||||
* @return PiggyBank|null
|
* @return PiggyBank|null
|
||||||
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
|
*
|
||||||
*/
|
*/
|
||||||
public function find(?int $piggyBankId, ?string $piggyBankName): ?PiggyBank
|
public function find(?int $piggyBankId, ?string $piggyBankName): ?PiggyBank
|
||||||
{
|
{
|
||||||
|
@@ -79,7 +79,7 @@ class TransactionCurrencyFactory
|
|||||||
* @param null|string $currencyCode
|
* @param null|string $currencyCode
|
||||||
*
|
*
|
||||||
* @return TransactionCurrency|null
|
* @return TransactionCurrency|null
|
||||||
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
|
*
|
||||||
*/
|
*/
|
||||||
public function find(?int $currencyId, ?string $currencyCode): ?TransactionCurrency
|
public function find(?int $currencyId, ?string $currencyCode): ?TransactionCurrency
|
||||||
{
|
{
|
||||||
|
@@ -49,8 +49,6 @@ class TransactionJournalMetaFactory
|
|||||||
* @param array $data
|
* @param array $data
|
||||||
*
|
*
|
||||||
* @return TransactionJournalMeta|null
|
* @return TransactionJournalMeta|null
|
||||||
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
|
|
||||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
|
||||||
*/
|
*/
|
||||||
public function updateOrCreate(array $data): ?TransactionJournalMeta
|
public function updateOrCreate(array $data): ?TransactionJournalMeta
|
||||||
{
|
{
|
||||||
|
@@ -109,7 +109,7 @@ class ChartJsGenerator implements GeneratorInterface
|
|||||||
* ]
|
* ]
|
||||||
* ]
|
* ]
|
||||||
*
|
*
|
||||||
* @SuppressWarnings(PHPMD.CyclomaticComplexity) // it's five.
|
* // it's five.
|
||||||
*
|
*
|
||||||
* @param array $data
|
* @param array $data
|
||||||
*
|
*
|
||||||
|
@@ -60,7 +60,7 @@ interface GeneratorInterface
|
|||||||
* ]
|
* ]
|
||||||
* ]
|
* ]
|
||||||
*
|
*
|
||||||
* @SuppressWarnings(PHPMD.CyclomaticComplexity) // it's five.
|
* // it's five.
|
||||||
*
|
*
|
||||||
* @param array $data
|
* @param array $data
|
||||||
*
|
*
|
||||||
|
@@ -112,7 +112,7 @@ class Support
|
|||||||
/**
|
/**
|
||||||
* Summarize collection by earned and spent data.
|
* Summarize collection by earned and spent data.
|
||||||
*
|
*
|
||||||
* @SuppressWarnings(PHPMD.CyclomaticComplexity) // it's exactly five.
|
* // it's exactly five.
|
||||||
*
|
*
|
||||||
* @param array $spent
|
* @param array $spent
|
||||||
* @param array $earned
|
* @param array $earned
|
||||||
|
@@ -43,9 +43,7 @@ class VersionCheckEventHandler
|
|||||||
/**
|
/**
|
||||||
* Checks with GitHub to see if there is a new version.
|
* Checks with GitHub to see if there is a new version.
|
||||||
*
|
*
|
||||||
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
|
*
|
||||||
* @SuppressWarnings(PHPMD.NPathComplexity)
|
|
||||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
|
||||||
* @param RequestedVersionCheckStatus $event
|
* @param RequestedVersionCheckStatus $event
|
||||||
*/
|
*/
|
||||||
public function checkForUpdates(RequestedVersionCheckStatus $event): void
|
public function checkForUpdates(RequestedVersionCheckStatus $event): void
|
||||||
|
@@ -98,7 +98,7 @@ class MetaPieChart implements MetaPieChartInterface
|
|||||||
* @param string $group
|
* @param string $group
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
|
*
|
||||||
*/
|
*/
|
||||||
public function generate(string $direction, string $group): array
|
public function generate(string $direction, string $group): array
|
||||||
{
|
{
|
||||||
@@ -181,8 +181,6 @@ class MetaPieChart implements MetaPieChartInterface
|
|||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*
|
*
|
||||||
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
protected function groupByFields(array $array, array $fields): array
|
protected function groupByFields(array $array, array $fields): array
|
||||||
{
|
{
|
||||||
|
@@ -43,8 +43,6 @@ class BalanceReportHelper implements BalanceReportHelperInterface
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* ReportHelper constructor.
|
* ReportHelper constructor.
|
||||||
*
|
|
||||||
*
|
|
||||||
* @param BudgetRepositoryInterface $budgetRepository
|
* @param BudgetRepositoryInterface $budgetRepository
|
||||||
*/
|
*/
|
||||||
public function __construct(BudgetRepositoryInterface $budgetRepository)
|
public function __construct(BudgetRepositoryInterface $budgetRepository)
|
||||||
|
@@ -43,8 +43,6 @@ class ReportHelper implements ReportHelperInterface
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* ReportHelper constructor.
|
* ReportHelper constructor.
|
||||||
*
|
|
||||||
*
|
|
||||||
* @param BudgetRepositoryInterface $budgetRepository
|
* @param BudgetRepositoryInterface $budgetRepository
|
||||||
*/
|
*/
|
||||||
public function __construct(BudgetRepositoryInterface $budgetRepository)
|
public function __construct(BudgetRepositoryInterface $budgetRepository)
|
||||||
|
Reference in New Issue
Block a user