Code cleanup

This commit is contained in:
James Cole
2019-08-17 10:46:55 +02:00
parent acfdf7dc90
commit 44823c6fec
21 changed files with 19 additions and 37 deletions

View File

@@ -236,7 +236,7 @@ class MigrateToGroups extends Command
* @param TransactionJournal $journal
*
* @throws Exception
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*
*/
private function makeMultiGroup(TransactionJournal $journal): void
{

View File

@@ -248,8 +248,8 @@ class OtherCurrenciesCorrections extends Command
* Gets the transaction that determines the transaction that "leads" and will determine
* the currency to be used by all transactions, and the journal itself.
*
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
* @param TransactionJournal $journal
*
* @return Transaction|null
*/
private function getLeadTransaction(TransactionJournal $journal): ?Transaction

View File

@@ -291,8 +291,6 @@ class TransferCurrenciesCorrections extends Command
}
/**
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*
* @param TransactionJournal $transfer
*/
private function updateTransferCurrency(TransactionJournal $transfer): void

View File

@@ -36,16 +36,15 @@ class StoredTransactionGroup extends Event
{
use SerializesModels;
public $applyRules;
/** @var TransactionGroup The group that was stored. */
public $transactionGroup;
public $applyRules;
/**
* Create a new event instance.
*
* @param TransactionGroup $transactionGroup
* @param bool $applyRules
* @param bool $applyRules
*/
public function __construct(TransactionGroup $transactionGroup, bool $applyRules = true)
{

View File

@@ -29,6 +29,7 @@ use Illuminate\Queue\SerializesModels;
/**
* Class UpdatedTransactionGroup.
*
* @codeCoverageIgnore
*
*/

View File

@@ -43,9 +43,7 @@ class GracefulNotFoundHandler extends ExceptionHandler
*
* @param Request $request
* @param Exception $exception
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
* @SuppressWarnings(PHPMD.NPathComplexity)
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*
*
* @return mixed
*/

View File

@@ -48,9 +48,7 @@ class Handler extends ExceptionHandler
*
* @param Request $request
* @param Exception $exception
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
* @SuppressWarnings(PHPMD.NPathComplexity)
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*
*
* @return mixed
*/
@@ -112,7 +110,7 @@ class Handler extends ExceptionHandler
*
* 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
*

View File

@@ -189,7 +189,7 @@ class AccountFactory
* @param null|string $accountType
*
* @return AccountType|null
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
*
*/
protected function getAccountType(?int $accountTypeId, ?string $accountType): ?AccountType
{

View File

@@ -26,7 +26,6 @@ namespace FireflyIII\Factory;
use FireflyIII\Models\Budget;
use FireflyIII\User;
use Illuminate\Support\Collection;
use Log;
/**
@@ -53,7 +52,7 @@ class BudgetFactory
* @param null|string $budgetName
*
* @return Budget|null
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
*
*/
public function find(?int $budgetId, ?string $budgetName): ?Budget
{

View File

@@ -26,7 +26,6 @@ namespace FireflyIII\Factory;
use FireflyIII\Models\Category;
use FireflyIII\User;
use Illuminate\Support\Collection;
use Log;
/**
@@ -63,7 +62,7 @@ class CategoryFactory
* @param null|string $categoryName
*
* @return Category|null
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
*
*/
public function findOrCreate(?int $categoryId, ?string $categoryName): ?Category
{

View File

@@ -53,7 +53,7 @@ class PiggyBankEventFactory
* @param PiggyBank|null $piggyBank
*
* @return PiggyBankEvent|null
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
*
*/
public function create(TransactionJournal $journal, ?PiggyBank $piggyBank): ?PiggyBankEvent
{

View File

@@ -52,7 +52,7 @@ class PiggyBankFactory
* @param null|string $piggyBankName
*
* @return PiggyBank|null
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
*
*/
public function find(?int $piggyBankId, ?string $piggyBankName): ?PiggyBank
{

View File

@@ -79,7 +79,7 @@ class TransactionCurrencyFactory
* @param null|string $currencyCode
*
* @return TransactionCurrency|null
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
*
*/
public function find(?int $currencyId, ?string $currencyCode): ?TransactionCurrency
{

View File

@@ -49,8 +49,6 @@ class TransactionJournalMetaFactory
* @param array $data
*
* @return TransactionJournalMeta|null
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*/
public function updateOrCreate(array $data): ?TransactionJournalMeta
{

View File

@@ -109,7 +109,7 @@ class ChartJsGenerator implements GeneratorInterface
* ]
* ]
*
* @SuppressWarnings(PHPMD.CyclomaticComplexity) // it's five.
* // it's five.
*
* @param array $data
*

View File

@@ -60,7 +60,7 @@ interface GeneratorInterface
* ]
* ]
*
* @SuppressWarnings(PHPMD.CyclomaticComplexity) // it's five.
* // it's five.
*
* @param array $data
*

View File

@@ -112,7 +112,7 @@ class Support
/**
* Summarize collection by earned and spent data.
*
* @SuppressWarnings(PHPMD.CyclomaticComplexity) // it's exactly five.
* // it's exactly five.
*
* @param array $spent
* @param array $earned

View File

@@ -43,9 +43,7 @@ class VersionCheckEventHandler
/**
* Checks with GitHub to see if there is a new version.
*
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
* @SuppressWarnings(PHPMD.NPathComplexity)
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*
* @param RequestedVersionCheckStatus $event
*/
public function checkForUpdates(RequestedVersionCheckStatus $event): void

View File

@@ -98,7 +98,7 @@ class MetaPieChart implements MetaPieChartInterface
* @param string $group
*
* @return array
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
*
*/
public function generate(string $direction, string $group): array
{
@@ -181,8 +181,6 @@ class MetaPieChart implements MetaPieChartInterface
*
* @return array
*
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
*
*/
protected function groupByFields(array $array, array $fields): array
{

View File

@@ -43,8 +43,6 @@ class BalanceReportHelper implements BalanceReportHelperInterface
/**
* ReportHelper constructor.
*
*
* @param BudgetRepositoryInterface $budgetRepository
*/
public function __construct(BudgetRepositoryInterface $budgetRepository)

View File

@@ -43,8 +43,6 @@ class ReportHelper implements ReportHelperInterface
/**
* ReportHelper constructor.
*
*
* @param BudgetRepositoryInterface $budgetRepository
*/
public function __construct(BudgetRepositoryInterface $budgetRepository)