diff --git a/.env.example b/.env.example
index ad1ca04795..55ba3f35a8 100644
--- a/.env.example
+++ b/.env.example
@@ -40,6 +40,7 @@ APP_LOG_LEVEL=notice
# Database credentials. Make sure the database exists. I recommend a dedicated user for Firefly III
# For other database types, please see the FAQ: http://firefly-iii.readthedocs.io/en/latest/support/faq.html
DB_CONNECTION=mysql
+# If you use DOCKER COMPOSE, change this variable to "firefly_iii_db"
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=homestead
diff --git a/.sandstorm/changelog.md b/.sandstorm/changelog.md
index a17f7b55ff..60e6e68d11 100644
--- a/.sandstorm/changelog.md
+++ b/.sandstorm/changelog.md
@@ -1,3 +1,27 @@
+# 4.8.0.2 (API 0.10.0)
+
+- [Issue 2203](https://github.com/firefly-iii/firefly-iii/issues/2203) Reconciliation inconsistencies.
+- [Issue 2392](https://github.com/firefly-iii/firefly-iii/issues/2392) Bad namespace leads to installation errors.
+- [Issue 2393](https://github.com/firefly-iii/firefly-iii/issues/2393) Missing budget selector.
+- [Issue 2402](https://github.com/firefly-iii/firefly-iii/issues/2402) bad amounts in default report
+- [Issue 2405](https://github.com/firefly-iii/firefly-iii/issues/2405) Due date can't be edited.
+- [Issue 2404](https://github.com/firefly-iii/firefly-iii/issues/2404) bad page indicator in the "no category" transaction overview.
+- [Issue 2407](https://github.com/firefly-iii/firefly-iii/issues/2407) Fix recurring transaction dates
+- [Issue 2410](https://github.com/firefly-iii/firefly-iii/issues/2410) Transaction links inconsistent
+- [Issue 2414](https://github.com/firefly-iii/firefly-iii/issues/2414) Can't edit recurring transactions
+- [Issue 2415](https://github.com/firefly-iii/firefly-iii/issues/2415) Return here + reset form results in empty transaction form
+- [Issue 2416](https://github.com/firefly-iii/firefly-iii/issues/2416) Some form inconsistencies.
+- [Issue 2418](https://github.com/firefly-iii/firefly-iii/issues/2418) Reports are inaccurate or broken.
+- [Issue 2422](https://github.com/firefly-iii/firefly-iii/issues/2422) PHP error when matching transactions.
+- [Issue 2423](https://github.com/firefly-iii/firefly-iii/issues/2423) Reports are inaccurate or broken.
+- [Issue 2426](https://github.com/firefly-iii/firefly-iii/issues/2426) Inconsistent documentation and instructions.
+- [Issue 2427](https://github.com/firefly-iii/firefly-iii/issues/2427) Deleted account and "initial balance" accounts may appear in dropdowns.
+- [Issue 2428](https://github.com/firefly-iii/firefly-iii/issues/2428) Reports are inaccurate or broken.
+- [Issue 2429](https://github.com/firefly-iii/firefly-iii/issues/2429) Typo leads to SQL errors in available budgets API
+- [Issue 2431](https://github.com/firefly-iii/firefly-iii/issues/2431) Issues creating new recurring transactions.
+- [Issue 2434](https://github.com/firefly-iii/firefly-iii/issues/2434) You can edit the initial balance transaction but it fails to save.
+- ARM build should work now.
+
# 4.8.0.1 (API 0.10.0)
- The balance box on the dashboard shows only negative numbers, skewing the results.
diff --git a/.sandstorm/sandstorm-pkgdef.capnp b/.sandstorm/sandstorm-pkgdef.capnp
index 63dea44199..47e6879289 100644
--- a/.sandstorm/sandstorm-pkgdef.capnp
+++ b/.sandstorm/sandstorm-pkgdef.capnp
@@ -15,8 +15,8 @@ const pkgdef :Spk.PackageDefinition = (
manifest = (
appTitle = (defaultText = "Firefly III"),
- appVersion = 33,
- appMarketingVersion = (defaultText = "4.8.0.1"),
+ appVersion = 34,
+ appMarketingVersion = (defaultText = "4.8.0.2"),
actions = [
# Define your "new document" handlers here.
diff --git a/.travis.yml b/.travis.yml
index dde48f83e8..6c0c37b239 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,7 +1,7 @@
sudo: required
language: bash
env:
- - VERSION=4.8.0.1
+ - VERSION=4.8.0.2
dist: xenial
@@ -26,4 +26,4 @@ script:
# build everything
- .deploy/docker/build-amd64.sh
- .deploy/docker/build-arm.sh
- - .deploy/docker/manifest.sh
\ No newline at end of file
+ - .deploy/docker/manifest.sh
diff --git a/app/Api/V1/Controllers/AccountController.php b/app/Api/V1/Controllers/AccountController.php
index 97090d71ba..f3e048ad30 100644
--- a/app/Api/V1/Controllers/AccountController.php
+++ b/app/Api/V1/Controllers/AccountController.php
@@ -47,7 +47,7 @@ use League\Fractal\Serializer\JsonApiSerializer;
/**
* Class AccountController.
*
- * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ *
*/
class AccountController extends Controller
{
@@ -234,8 +234,6 @@ class AccountController extends Controller
*
* @return JsonResponse
*
- * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
*/
public function transactions(Request $request, Account $account): JsonResponse
{
diff --git a/app/Api/V1/Controllers/AttachmentController.php b/app/Api/V1/Controllers/AttachmentController.php
index 7254ed45bf..214aa2780b 100644
--- a/app/Api/V1/Controllers/AttachmentController.php
+++ b/app/Api/V1/Controllers/AttachmentController.php
@@ -45,7 +45,7 @@ use function strlen;
/**
* Class AttachmentController.
*
- * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ *
*/
class AttachmentController extends Controller
{
diff --git a/app/Api/V1/Controllers/AvailableBudgetController.php b/app/Api/V1/Controllers/AvailableBudgetController.php
index 73cacafb97..ccb7f4e398 100644
--- a/app/Api/V1/Controllers/AvailableBudgetController.php
+++ b/app/Api/V1/Controllers/AvailableBudgetController.php
@@ -42,7 +42,7 @@ use League\Fractal\Serializer\JsonApiSerializer;
/**
* Class AvailableBudgetController.
*
- * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ *
*/
class AvailableBudgetController extends Controller
{
diff --git a/app/Api/V1/Controllers/BillController.php b/app/Api/V1/Controllers/BillController.php
index 7378704588..f31b7206c4 100644
--- a/app/Api/V1/Controllers/BillController.php
+++ b/app/Api/V1/Controllers/BillController.php
@@ -48,7 +48,7 @@ use League\Fractal\Serializer\JsonApiSerializer;
/**
* Class BillController.
*
- * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ *
*/
class BillController extends Controller
{
diff --git a/app/Api/V1/Controllers/BudgetController.php b/app/Api/V1/Controllers/BudgetController.php
index b057675f6f..7b488c3472 100644
--- a/app/Api/V1/Controllers/BudgetController.php
+++ b/app/Api/V1/Controllers/BudgetController.php
@@ -47,7 +47,7 @@ use League\Fractal\Serializer\JsonApiSerializer;
/**
* Class BudgetController.
*
- * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ *
*/
class BudgetController extends Controller
{
@@ -79,8 +79,6 @@ class BudgetController extends Controller
/**
* Display a listing of the resource.
- *
- *
* @param Request $request
* @param Budget $budget
*
diff --git a/app/Api/V1/Controllers/BudgetLimitController.php b/app/Api/V1/Controllers/BudgetLimitController.php
index 587d0d305a..49d1f5edfb 100644
--- a/app/Api/V1/Controllers/BudgetLimitController.php
+++ b/app/Api/V1/Controllers/BudgetLimitController.php
@@ -46,7 +46,7 @@ use League\Fractal\Serializer\JsonApiSerializer;
/**
* Class BudgetLimitController.
*
- * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ *
*/
class BudgetLimitController extends Controller
{
diff --git a/app/Api/V1/Controllers/CategoryController.php b/app/Api/V1/Controllers/CategoryController.php
index 93f8ab75e2..56d541b38a 100644
--- a/app/Api/V1/Controllers/CategoryController.php
+++ b/app/Api/V1/Controllers/CategoryController.php
@@ -44,7 +44,7 @@ use League\Fractal\Serializer\JsonApiSerializer;
/**
* Class CategoryController.
*
- * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ *
*/
class CategoryController extends Controller
{
diff --git a/app/Api/V1/Controllers/Controller.php b/app/Api/V1/Controllers/Controller.php
index 5f0717ec8f..d650b95ae4 100644
--- a/app/Api/V1/Controllers/Controller.php
+++ b/app/Api/V1/Controllers/Controller.php
@@ -37,7 +37,7 @@ use Symfony\Component\HttpFoundation\ParameterBag;
* Class Controller.
*
* @codeCoverageIgnore
- * @SuppressWarnings(PHPMD.NumberOfChildren)
+ *
*/
class Controller extends BaseController
{
diff --git a/app/Api/V1/Controllers/CurrencyController.php b/app/Api/V1/Controllers/CurrencyController.php
index 04e96231cb..67fbe22ac3 100644
--- a/app/Api/V1/Controllers/CurrencyController.php
+++ b/app/Api/V1/Controllers/CurrencyController.php
@@ -66,7 +66,7 @@ use League\Fractal\Serializer\JsonApiSerializer;
/**
* Class CurrencyController.
*
- * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ *
*/
class CurrencyController extends Controller
{
diff --git a/app/Api/V1/Controllers/LinkTypeController.php b/app/Api/V1/Controllers/LinkTypeController.php
index 1ce5a1bc74..47a73122b7 100644
--- a/app/Api/V1/Controllers/LinkTypeController.php
+++ b/app/Api/V1/Controllers/LinkTypeController.php
@@ -45,7 +45,7 @@ use League\Fractal\Serializer\JsonApiSerializer;
/**
* Class LinkTypeController.
*
- * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ *
*/
class LinkTypeController extends Controller
{
diff --git a/app/Api/V1/Controllers/PiggyBankController.php b/app/Api/V1/Controllers/PiggyBankController.php
index 2f223e821a..d69fd30ccf 100644
--- a/app/Api/V1/Controllers/PiggyBankController.php
+++ b/app/Api/V1/Controllers/PiggyBankController.php
@@ -42,7 +42,7 @@ use League\Fractal\Serializer\JsonApiSerializer;
/**
* Class PiggyBankController.
*
- * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ *
*/
class PiggyBankController extends Controller
{
diff --git a/app/Api/V1/Controllers/RuleController.php b/app/Api/V1/Controllers/RuleController.php
index 444794f36b..cfff4945a8 100644
--- a/app/Api/V1/Controllers/RuleController.php
+++ b/app/Api/V1/Controllers/RuleController.php
@@ -48,7 +48,7 @@ use Log;
/**
* Class RuleController
- * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ *
*/
class RuleController extends Controller
{
diff --git a/app/Api/V1/Controllers/RuleGroupController.php b/app/Api/V1/Controllers/RuleGroupController.php
index bfce0bcdc9..34db80ebb3 100644
--- a/app/Api/V1/Controllers/RuleGroupController.php
+++ b/app/Api/V1/Controllers/RuleGroupController.php
@@ -231,7 +231,7 @@ class RuleGroupController extends Controller
*
* @return JsonResponse
* @throws FireflyException
- * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ *
*/
public function testGroup(RuleGroupTestRequest $request, RuleGroup $group): JsonResponse
{
diff --git a/app/Api/V1/Controllers/UserController.php b/app/Api/V1/Controllers/UserController.php
index 7d1cf74239..50c1a4a152 100644
--- a/app/Api/V1/Controllers/UserController.php
+++ b/app/Api/V1/Controllers/UserController.php
@@ -42,7 +42,7 @@ use League\Fractal\Serializer\JsonApiSerializer;
/**
* Class UserController.
*
- * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ *
*/
class UserController extends Controller
{
diff --git a/app/Api/V1/Requests/DateRequest.php b/app/Api/V1/Requests/DateRequest.php
index 30ac436731..c2704d9dda 100644
--- a/app/Api/V1/Requests/DateRequest.php
+++ b/app/Api/V1/Requests/DateRequest.php
@@ -1,4 +1,5 @@
.
*/
+declare(strict_types=1);
+
namespace FireflyIII\Api\V1\Requests;
@@ -65,4 +68,4 @@ class DateRequest extends Request
'end' => 'required|date|after:start',
];
}
-}
\ No newline at end of file
+}
diff --git a/app/Api/V1/Requests/RuleGroupTestRequest.php b/app/Api/V1/Requests/RuleGroupTestRequest.php
index 1b3e9a4c75..aa12c2f8a2 100644
--- a/app/Api/V1/Requests/RuleGroupTestRequest.php
+++ b/app/Api/V1/Requests/RuleGroupTestRequest.php
@@ -1,4 +1,5 @@
.
*/
+declare(strict_types=1);
+
+
namespace FireflyIII\Api\V1\Requests;
@@ -141,4 +145,4 @@ class RuleGroupTestRequest extends Request
return null !== $account && AccountType::ASSET === $account->accountType->type;
}
-}
\ No newline at end of file
+}
diff --git a/app/Api/V1/Requests/RuleGroupTriggerRequest.php b/app/Api/V1/Requests/RuleGroupTriggerRequest.php
index a9912ae845..4b7f44740a 100644
--- a/app/Api/V1/Requests/RuleGroupTriggerRequest.php
+++ b/app/Api/V1/Requests/RuleGroupTriggerRequest.php
@@ -1,4 +1,5 @@
.
*/
+declare(strict_types=1);
+
+
namespace FireflyIII\Api\V1\Requests;
@@ -116,4 +120,4 @@ class RuleGroupTriggerRequest extends Request
return null !== $account && AccountType::ASSET === $account->accountType->type;
}
-}
\ No newline at end of file
+}
diff --git a/app/Api/V1/Requests/RuleTestRequest.php b/app/Api/V1/Requests/RuleTestRequest.php
index 44ab7c8114..3ebaff2e26 100644
--- a/app/Api/V1/Requests/RuleTestRequest.php
+++ b/app/Api/V1/Requests/RuleTestRequest.php
@@ -1,4 +1,5 @@
.
*/
+declare(strict_types=1);
+
+
namespace FireflyIII\Api\V1\Requests;
@@ -141,4 +145,4 @@ class RuleTestRequest extends Request
return null !== $account && AccountType::ASSET === $account->accountType->type;
}
-}
\ No newline at end of file
+}
diff --git a/app/Api/V1/Requests/RuleTriggerRequest.php b/app/Api/V1/Requests/RuleTriggerRequest.php
index 570232751d..e8ffdb3e7e 100644
--- a/app/Api/V1/Requests/RuleTriggerRequest.php
+++ b/app/Api/V1/Requests/RuleTriggerRequest.php
@@ -1,4 +1,5 @@
.
*/
+declare(strict_types=1);
+
namespace FireflyIII\Api\V1\Requests;
@@ -116,4 +119,4 @@ class RuleTriggerRequest extends Request
return null !== $account && AccountType::ASSET === $account->accountType->type;
}
-}
\ No newline at end of file
+}
diff --git a/app/Console/Commands/Correction/CorrectDatabase.php b/app/Console/Commands/Correction/CorrectDatabase.php
index c95b7b9db7..091dc5f54f 100644
--- a/app/Console/Commands/Correction/CorrectDatabase.php
+++ b/app/Console/Commands/Correction/CorrectDatabase.php
@@ -80,4 +80,4 @@ class CorrectDatabase extends Command
return 0;
}
-}
\ No newline at end of file
+}
diff --git a/app/Console/Commands/Correction/CreateAccessTokens.php b/app/Console/Commands/Correction/CreateAccessTokens.php
index d2f8602d21..0a77d219fd 100644
--- a/app/Console/Commands/Correction/CreateAccessTokens.php
+++ b/app/Console/Commands/Correction/CreateAccessTokens.php
@@ -1,4 +1,5 @@
set(self::CONFIG_NAME, true);
}
-}
\ No newline at end of file
+}
diff --git a/app/Console/Commands/Upgrade/CCLiabilities.php b/app/Console/Commands/Upgrade/CCLiabilities.php
index e53bfafaa9..ac0d43f63d 100644
--- a/app/Console/Commands/Upgrade/CCLiabilities.php
+++ b/app/Console/Commands/Upgrade/CCLiabilities.php
@@ -115,4 +115,4 @@ class CCLiabilities extends Command
{
app('fireflyconfig')->set(self::CONFIG_NAME, true);
}
-}
\ No newline at end of file
+}
diff --git a/app/Console/Commands/Upgrade/MigrateAttachments.php b/app/Console/Commands/Upgrade/MigrateAttachments.php
index 4e4df1caa8..b8c7f4887a 100644
--- a/app/Console/Commands/Upgrade/MigrateAttachments.php
+++ b/app/Console/Commands/Upgrade/MigrateAttachments.php
@@ -125,4 +125,4 @@ class MigrateAttachments extends Command
{
app('fireflyconfig')->set(self::CONFIG_NAME, true);
}
-}
\ No newline at end of file
+}
diff --git a/app/Console/Commands/Upgrade/MigrateJournalNotes.php b/app/Console/Commands/Upgrade/MigrateJournalNotes.php
index 5b29cf5593..a35d7ec3fe 100644
--- a/app/Console/Commands/Upgrade/MigrateJournalNotes.php
+++ b/app/Console/Commands/Upgrade/MigrateJournalNotes.php
@@ -124,4 +124,4 @@ class MigrateJournalNotes extends Command
{
app('fireflyconfig')->set(self::CONFIG_NAME, true);
}
-}
\ No newline at end of file
+}
diff --git a/app/Console/Commands/Upgrade/MigrateToGroups.php b/app/Console/Commands/Upgrade/MigrateToGroups.php
index 2b46196a5b..1e68495bfb 100644
--- a/app/Console/Commands/Upgrade/MigrateToGroups.php
+++ b/app/Console/Commands/Upgrade/MigrateToGroups.php
@@ -1,4 +1,5 @@
billRepository->update($bill, $newBillData);
$this->count++;
}
-}
\ No newline at end of file
+}
diff --git a/app/Console/Commands/Upgrade/OtherCurrenciesCorrections.php b/app/Console/Commands/Upgrade/OtherCurrenciesCorrections.php
index 3cbce9de70..fd0b68e95e 100644
--- a/app/Console/Commands/Upgrade/OtherCurrenciesCorrections.php
+++ b/app/Console/Commands/Upgrade/OtherCurrenciesCorrections.php
@@ -125,6 +125,7 @@ class OtherCurrenciesCorrections extends Command
if (isset($this->accountCurrencies[$accountId]) && $this->accountCurrencies[$accountId] instanceof TransactionCurrency) {
return $this->accountCurrencies[$accountId]; // @codeCoverageIgnore
}
+ // TODO we can use getAccountCurrency() instead
$currencyId = (int)$this->accountRepos->getMetaValue($account, 'currency_id');
$result = $this->currencyRepos->findNull($currencyId);
if (null === $result) {
@@ -247,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
@@ -282,4 +283,4 @@ class OtherCurrenciesCorrections extends Command
return $lead;
}
-}
\ No newline at end of file
+}
diff --git a/app/Console/Commands/Upgrade/RenameAccountMeta.php b/app/Console/Commands/Upgrade/RenameAccountMeta.php
index 8d99cd552c..f96282038a 100644
--- a/app/Console/Commands/Upgrade/RenameAccountMeta.php
+++ b/app/Console/Commands/Upgrade/RenameAccountMeta.php
@@ -1,4 +1,5 @@
accountCurrencies[$accountId]) && $this->accountCurrencies[$accountId] instanceof TransactionCurrency) {
return $this->accountCurrencies[$accountId]; // @codeCoverageIgnore
}
+ // TODO we can use getAccountCurrency() instead
$currencyId = (int)$this->accountRepos->getMetaValue($account, 'currency_id');
$result = $this->currencyRepos->findNull($currencyId);
if (null === $result) {
@@ -290,8 +292,6 @@ class TransferCurrenciesCorrections extends Command
}
/**
- * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
- *
* @param TransactionJournal $transfer
*/
private function updateTransferCurrency(TransactionJournal $transfer): void
@@ -575,4 +575,4 @@ class TransferCurrenciesCorrections extends Command
return false;
}
-}
\ No newline at end of file
+}
diff --git a/app/Console/Commands/Upgrade/UpgradeDatabase.php b/app/Console/Commands/Upgrade/UpgradeDatabase.php
index 9fc806eeee..6592cff035 100644
--- a/app/Console/Commands/Upgrade/UpgradeDatabase.php
+++ b/app/Console/Commands/Upgrade/UpgradeDatabase.php
@@ -1,4 +1,5 @@
journalFactory->create($data);
$title = $data['group_title'] ?? null;
$title = '' === $title ? null : $title;
- /** @var TransactionJournal $first */
- $first = $collection->first();
- $group = new TransactionGroup;
- $group->user()->associate($first->user);
+ $group = new TransactionGroup;
+ $group->user()->associate($this->user);
$group->title = $title;
$group->save();
@@ -81,4 +77,4 @@ class TransactionGroupFactory
{
$this->user = $user;
}
-}
\ No newline at end of file
+}
diff --git a/app/Factory/TransactionJournalFactory.php b/app/Factory/TransactionJournalFactory.php
index 03ee0fed19..83fbbb03ab 100644
--- a/app/Factory/TransactionJournalFactory.php
+++ b/app/Factory/TransactionJournalFactory.php
@@ -143,6 +143,9 @@ class TransactionJournalFactory
if (null !== $journal) {
$collection->push($journal);
}
+ if(null === $journal) {
+ Log::error('The createJournal() method returned NULL. This may indicate an error.');
+ }
}
return $collection;
@@ -247,6 +250,7 @@ class TransactionJournalFactory
$destinationAccount = $this->getAccount($type->type, 'destination', (int)$row['destination_id'], $row['destination_name']);
// @codeCoverageIgnoreStart
} catch (FireflyException $e) {
+ Log::error('Could not validate source or destination.');
Log::error($e->getMessage());
return null;
diff --git a/app/Factory/TransactionJournalMetaFactory.php b/app/Factory/TransactionJournalMetaFactory.php
index 470468349f..7e13afd8fd 100644
--- a/app/Factory/TransactionJournalMetaFactory.php
+++ b/app/Factory/TransactionJournalMetaFactory.php
@@ -49,8 +49,6 @@ class TransactionJournalMetaFactory
* @param array $data
*
* @return TransactionJournalMeta|null
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
- * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*/
public function updateOrCreate(array $data): ?TransactionJournalMeta
{
diff --git a/app/Generator/Chart/Basic/ChartJsGenerator.php b/app/Generator/Chart/Basic/ChartJsGenerator.php
index 04a0fcb9ca..c0a4e0a39c 100644
--- a/app/Generator/Chart/Basic/ChartJsGenerator.php
+++ b/app/Generator/Chart/Basic/ChartJsGenerator.php
@@ -109,7 +109,7 @@ class ChartJsGenerator implements GeneratorInterface
* ]
* ]
*
- * @SuppressWarnings(PHPMD.CyclomaticComplexity) // it's five.
+ * // it's five.
*
* @param array $data
*
diff --git a/app/Generator/Chart/Basic/GeneratorInterface.php b/app/Generator/Chart/Basic/GeneratorInterface.php
index cc7d55626c..75fa3e63ff 100644
--- a/app/Generator/Chart/Basic/GeneratorInterface.php
+++ b/app/Generator/Chart/Basic/GeneratorInterface.php
@@ -60,7 +60,7 @@ interface GeneratorInterface
* ]
* ]
*
- * @SuppressWarnings(PHPMD.CyclomaticComplexity) // it's five.
+ * // it's five.
*
* @param array $data
*
diff --git a/app/Generator/Report/Standard/MonthReportGenerator.php b/app/Generator/Report/Standard/MonthReportGenerator.php
index 05bf049cc4..17e4d7c745 100644
--- a/app/Generator/Report/Standard/MonthReportGenerator.php
+++ b/app/Generator/Report/Standard/MonthReportGenerator.php
@@ -24,7 +24,6 @@ namespace FireflyIII\Generator\Report\Standard;
use Carbon\Carbon;
use FireflyIII\Generator\Report\ReportGeneratorInterface;
-use FireflyIII\Helpers\Report\ReportHelperInterface;
use Illuminate\Support\Collection;
use Log;
use Throwable;
@@ -50,17 +49,11 @@ class MonthReportGenerator implements ReportGeneratorInterface
*/
public function generate(): string
{
- /** @var ReportHelperInterface $helper */
- $helper = app(ReportHelperInterface::class);
- $bills = $helper->getBillReport($this->start, $this->end, $this->accounts);
$accountIds = implode(',', $this->accounts->pluck('id')->toArray());
$reportType = 'default';
try {
- return view(
- 'reports.default.month',
- compact('bills', 'accountIds', 'reportType')
- )->with('start', $this->start)->with('end', $this->end)->render();
+ return view('reports.default.month', compact('accountIds', 'reportType'))->with('start', $this->start)->with('end', $this->end)->render();
} catch (Throwable $e) {
Log::error(sprintf('Cannot render reports.default.month: %s', $e->getMessage()));
$result = 'Could not render report view.';
diff --git a/app/Generator/Report/Support.php b/app/Generator/Report/Support.php
index 1f5e8d3b78..d004291fc9 100644
--- a/app/Generator/Report/Support.php
+++ b/app/Generator/Report/Support.php
@@ -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
diff --git a/app/Handlers/Events/VersionCheckEventHandler.php b/app/Handlers/Events/VersionCheckEventHandler.php
index 9a0029c74c..2316d040dc 100644
--- a/app/Handlers/Events/VersionCheckEventHandler.php
+++ b/app/Handlers/Events/VersionCheckEventHandler.php
@@ -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
diff --git a/app/Helpers/Chart/MetaPieChart.php b/app/Helpers/Chart/MetaPieChart.php
index 55c58704a7..4eb1efccd7 100644
--- a/app/Helpers/Chart/MetaPieChart.php
+++ b/app/Helpers/Chart/MetaPieChart.php
@@ -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
{
diff --git a/app/Helpers/Collection/Balance.php b/app/Helpers/Collection/Balance.php
deleted file mode 100644
index 71573853ea..0000000000
--- a/app/Helpers/Collection/Balance.php
+++ /dev/null
@@ -1,97 +0,0 @@
-.
- */
-declare(strict_types=1);
-
-namespace FireflyIII\Helpers\Collection;
-
-use Illuminate\Support\Collection;
-
-/**
- * Class Balance.
- *
- * @codeCoverageIgnore
- */
-class Balance
-{
- /** @var BalanceHeader Header row. */
- protected $balanceHeader;
-
- /** @var Collection Collection of lines. */
- protected $balanceLines;
-
- /**
- * Balance constructor.
- */
- public function __construct()
- {
- $this->balanceLines = new Collection;
- }
-
- /**
- * Add a line.
- *
- * @param BalanceLine $line
- */
- public function addBalanceLine(BalanceLine $line): void
- {
- $this->balanceLines->push($line);
- }
-
- /**
- * Get the header.
- *
- * @return BalanceHeader
- */
- public function getBalanceHeader(): BalanceHeader
- {
- return $this->balanceHeader ?? new BalanceHeader;
- }
-
- /**
- * Set the header.
- *
- * @param BalanceHeader $balanceHeader
- */
- public function setBalanceHeader(BalanceHeader $balanceHeader): void
- {
- $this->balanceHeader = $balanceHeader;
- }
-
- /**
- * Get all lines.
- *
- * @return Collection
- */
- public function getBalanceLines(): Collection
- {
- return $this->balanceLines;
- }
-
- /**
- * Set all lines.
- *
- * @param Collection $balanceLines
- */
- public function setBalanceLines(Collection $balanceLines): void
- {
- $this->balanceLines = $balanceLines;
- }
-}
diff --git a/app/Helpers/Collection/BalanceEntry.php b/app/Helpers/Collection/BalanceEntry.php
deleted file mode 100644
index 86eddf607b..0000000000
--- a/app/Helpers/Collection/BalanceEntry.php
+++ /dev/null
@@ -1,100 +0,0 @@
-.
- */
-declare(strict_types=1);
-
-namespace FireflyIII\Helpers\Collection;
-
-use FireflyIII\Models\Account as AccountModel;
-
-/**
- * Class BalanceEntry.
- *
- * @codeCoverageIgnore
- */
-class BalanceEntry
-{
- /** @var AccountModel The account. */
- protected $account;
- /** @var string The amount left. */
- protected $left = '0';
- /** @var string The amount spent. */
- protected $spent = '0';
-
- /**
- * Account getter.
- *
- * @return AccountModel
- */
- public function getAccount(): AccountModel
- {
- return $this->account;
- }
-
- /**
- * Account setter.
- *
- * @param AccountModel $account
- */
- public function setAccount(AccountModel $account): void
- {
- $this->account = $account;
- }
-
- /**
- * Get amount left.
- *
- * @return string
- */
- public function getLeft(): string
- {
- return $this->left;
- }
-
- /**
- * Set amount left.
- *
- * @param string $left
- */
- public function setLeft(string $left): void
- {
- $this->left = $left;
- }
-
- /**
- * Get amount spent.
- *
- * @return string
- */
- public function getSpent(): string
- {
- return $this->spent;
- }
-
- /**
- * Set amount spent.
- *
- * @param string $spent
- */
- public function setSpent(string $spent): void
- {
- $this->spent = $spent;
- }
-}
diff --git a/app/Helpers/Collection/BalanceHeader.php b/app/Helpers/Collection/BalanceHeader.php
deleted file mode 100644
index 3769b0f5c0..0000000000
--- a/app/Helpers/Collection/BalanceHeader.php
+++ /dev/null
@@ -1,65 +0,0 @@
-.
- */
-declare(strict_types=1);
-
-namespace FireflyIII\Helpers\Collection;
-
-use FireflyIII\Models\Account as AccountModel;
-use Illuminate\Support\Collection;
-
-/**
- * Class BalanceHeader.
- *
- * @codeCoverageIgnore
- */
-class BalanceHeader
-{
- /** @var Collection The accounts. */
- protected $accounts;
-
- /**
- * BalanceHeader constructor.
- */
- public function __construct()
- {
- $this->accounts = new Collection;
- }
-
- /**
- * Add an account.
- *
- * @param AccountModel $account
- */
- public function addAccount(AccountModel $account): void
- {
- $this->accounts->push($account);
- }
-
- /**
- * Get them all.
- *
- * @return Collection
- */
- public function getAccounts(): Collection
- {
- return $this->accounts;
- }
-}
diff --git a/app/Helpers/Collection/BalanceLine.php b/app/Helpers/Collection/BalanceLine.php
deleted file mode 100644
index 89668f0963..0000000000
--- a/app/Helpers/Collection/BalanceLine.php
+++ /dev/null
@@ -1,189 +0,0 @@
-.
- */
-declare(strict_types=1);
-
-namespace FireflyIII\Helpers\Collection;
-
-use Carbon\Carbon;
-use FireflyIII\Models\Budget as BudgetModel;
-use FireflyIII\Models\BudgetLimit;
-use Illuminate\Support\Collection;
-
-/**
- * Class BalanceLine.
- *
- * @codeCoverageIgnore
- */
-class BalanceLine
-{
- /**
- *
- */
- public const ROLE_DEFAULTROLE = 1;
- /**
- *
- */
- public const ROLE_TAGROLE = 2;
-
- /** @var Collection */
- protected $balanceEntries;
-
- /** @var BudgetModel */
- protected $budget;
- /** @var BudgetLimit */
- protected $budgetLimit;
- /** @var int */
- protected $role = self::ROLE_DEFAULTROLE;
-
- /**
- *
- */
- public function __construct()
- {
- $this->balanceEntries = new Collection;
- }
-
- /**
- * @param BalanceEntry $balanceEntry
- */
- public function addBalanceEntry(BalanceEntry $balanceEntry): void
- {
- $this->balanceEntries->push($balanceEntry);
- }
-
- /**
- * @return Collection
- */
- public function getBalanceEntries(): Collection
- {
- return $this->balanceEntries;
- }
-
- /**
- * @param Collection $balanceEntries
- */
- public function setBalanceEntries(Collection $balanceEntries): void
- {
- $this->balanceEntries = $balanceEntries;
- }
-
- /**
- * @return BudgetModel
- */
- public function getBudget(): BudgetModel
- {
- return $this->budget ?? new BudgetModel;
- }
-
- /**
- * @param BudgetModel $budget
- */
- public function setBudget(BudgetModel $budget): void
- {
- $this->budget = $budget;
- }
-
- /**
- * @return BudgetLimit
- */
- public function getBudgetLimit(): BudgetLimit
- {
- return $this->budgetLimit;
- }
-
- /**
- * @param BudgetLimit $budgetLimit
- */
- public function setBudgetLimit(BudgetLimit $budgetLimit): void
- {
- $this->budgetLimit = $budgetLimit;
- }
-
- /**
- * @return Carbon
- */
- public function getEndDate(): Carbon
- {
- return $this->budgetLimit->end_date ?? new Carbon;
- }
-
- /**
- * @return int
- */
- public function getRole(): int
- {
- return $this->role;
- }
-
- /**
- * @param int $role
- */
- public function setRole(int $role): void
- {
- $this->role = $role;
- }
-
- /**
- * @return Carbon
- */
- public function getStartDate(): Carbon
- {
- return $this->budgetLimit->start_date ?? new Carbon;
- }
-
- /**
- * @return string
- */
- public function getTitle(): string
- {
- $title = '';
- if ($this->getBudget() instanceof BudgetModel && null !== $this->getBudget()->id) {
- $title = $this->getBudget()->name;
- }
- if ('' === $title && self::ROLE_DEFAULTROLE === $this->getRole()) {
- $title = (string)trans('firefly.no_budget');
- }
- if ('' === $title && self::ROLE_TAGROLE === $this->getRole()) {
- $title = (string)trans('firefly.coveredWithTags');
- }
-
- return $title;
- }
-
- /**
- * If a BalanceLine has a budget/repetition, each BalanceEntry in this BalanceLine
- * should have a "spent" value, which is the amount of money that has been spent
- * on the given budget/repetition. If you subtract all those amounts from the budget/repetition's
- * total amount, this is returned:.
- *
- * @return string
- */
- public function leftOfRepetition(): string
- {
- $start = $this->budgetLimit->amount ?? '0';
- /** @var BalanceEntry $balanceEntry */
- foreach ($this->getBalanceEntries() as $balanceEntry) {
- $start = bcadd($balanceEntry->getSpent(), $start);
- }
-
- return $start;
- }
-}
diff --git a/app/Helpers/Collection/Bill.php b/app/Helpers/Collection/Bill.php
deleted file mode 100644
index 7b50e12c2d..0000000000
--- a/app/Helpers/Collection/Bill.php
+++ /dev/null
@@ -1,128 +0,0 @@
-.
- */
-declare(strict_types=1);
-
-namespace FireflyIII\Helpers\Collection;
-
-use Carbon\Carbon;
-use FireflyIII\Repositories\Bill\BillRepositoryInterface;
-use Illuminate\Support\Collection;
-use Log;
-
-/**
- * Class Bill.
- *
- * @codeCoverageIgnore
- */
-class Bill
-{
- /** @var Collection The bills. */
- private $bills;
- /** @var Carbon End date of the collection. */
- private $endDate;
- /** @var Carbon Start date of the collection. */
- private $startDate;
-
- /**
- * Bill constructor.
- */
- public function __construct()
- {
- $this->bills = new Collection;
- }
-
- /**
- * Add a bill line.
- *
- * @param BillLine $bill
- */
- public function addBill(BillLine $bill): void
- {
- $this->bills->push($bill);
- }
-
- /**
- * Filter the bills (yes how very descriptive).
- */
- public function filterBills(): void
- {
- Log::debug('Now in filterBills()');
- /** @var BillRepositoryInterface $repository */
- $repository = app(BillRepositoryInterface::class);
- $start = $this->startDate;
- $end = $this->endDate;
- $lines = $this->bills->filter(
- function (BillLine $line) use ($repository, $start, $end) {
- // next expected match?
- $date = $start;
- Log::debug(sprintf('Now at bill line for bill "%s"', $line->getBill()->name));
- Log::debug(sprintf('Default date to use is start date: %s', $date->format('Y-m-d')));
- if ($line->isHit()) {
- $date = $line->getLastHitDate();
- Log::debug(sprintf('Line was hit, see date: %s. Always include it.', $date->format('Y-m-d')));
-
- return $line;
- }
- $expected = $repository->nextExpectedMatch($line->getBill(), $date);
- Log::debug(sprintf('Next expected match is %s', $expected->format('Y-m-d')));
- if ($expected <= $end && $expected >= $start) {
- Log::debug('This date is inside report limits');
-
- return $line;
- }
- Log::debug('This date is OUTSIDE report limits');
-
- return false;
- }
- );
- $this->bills = $lines;
- }
-
- /**
- * Bills getter.
- *
- * @return Collection
- */
- public function getBills(): Collection
- {
- return $this->bills;
- }
-
- /**
- * End date setter.
- *
- * @param Carbon $endDate
- */
- public function setEndDate(Carbon $endDate): void
- {
- $this->endDate = $endDate;
- }
-
- /**
- * Start date setter.
- *
- * @param Carbon $startDate
- */
- public function setStartDate(Carbon $startDate): void
- {
- $this->startDate = $startDate;
- }
-}
diff --git a/app/Helpers/Collection/BillLine.php b/app/Helpers/Collection/BillLine.php
deleted file mode 100644
index 2a11629aeb..0000000000
--- a/app/Helpers/Collection/BillLine.php
+++ /dev/null
@@ -1,270 +0,0 @@
-.
- */
-declare(strict_types=1);
-
-namespace FireflyIII\Helpers\Collection;
-
-use Carbon\Carbon;
-use FireflyIII\Models\Bill as BillModel;
-use FireflyIII\Models\TransactionCurrency;
-
-/**
- * Class BillLine.
- *
- * @codeCoverageIgnore
- */
-class BillLine
-{
- /** @var string The amount */
- protected $amount;
- /** @var BillModel The bill. */
- protected $bill;
- /** @var bool Is it hit this period */
- protected $hit;
- /** @var string What was the max amount. */
- protected $max;
- /** @var string What was the min amount. */
- protected $min;
- /** @var TransactionCurrency The transaction currency */
- private $currency;
- /** @var Carbon Latest date that payment is expected. */
- private $endOfPayDate;
- /** @var Carbon Date of last hit */
- private $lastHitDate;
- /** @var Carbon Date of last payment */
- private $payDate;
- /** @var int Journal */
- private $transactionJournalId;
-
- /**
- * BillLine constructor.
- */
- public function __construct()
- {
- $this->lastHitDate = new Carbon;
- }
-
- /**
- * Amount getter.
- *
- * @return string
- */
- public function getAmount(): string
- {
- return $this->amount ?? '0';
- }
-
- /**
- * Amount setter.
- *
- * @param string $amount
- */
- public function setAmount(string $amount): void
- {
- $this->amount = $amount;
- }
-
- /**
- * Bill getter.
- *
- * @return BillModel
- */
- public function getBill(): BillModel
- {
- return $this->bill;
- }
-
- /**
- * Bill setter.
- *
- * @param BillModel $bill
- */
- public function setBill(BillModel $bill): void
- {
- $this->bill = $bill;
- }
-
- /**
- * @return TransactionCurrency
- */
- public function getCurrency(): TransactionCurrency
- {
- return $this->currency;
- }
-
- /**
- * @param TransactionCurrency $currency
- */
- public function setCurrency(TransactionCurrency $currency): void
- {
- $this->currency = $currency;
- }
-
- /**
- * End of pay date getter.
- *
- * @return Carbon
- */
- public function getEndOfPayDate(): Carbon
- {
- return $this->endOfPayDate;
- }
-
- /**
- * End of pay date setter.
- *
- * @param Carbon $endOfPayDate
- */
- public function setEndOfPayDate(Carbon $endOfPayDate): void
- {
- $this->endOfPayDate = $endOfPayDate;
- }
-
- /**
- * Last hit date getter.
- *
- * @return Carbon
- */
- public function getLastHitDate(): Carbon
- {
- return $this->lastHitDate;
- }
-
- /**
- * Last hit date setter.
- *
- * @param Carbon $lastHitDate
- */
- public function setLastHitDate(Carbon $lastHitDate): void
- {
- $this->lastHitDate = $lastHitDate;
- }
-
- /**
- * Max getter.
- *
- * @return string
- */
- public function getMax(): string
- {
- return $this->max;
- }
-
- /**
- * Max setter.
- *
- * @param string $max
- */
- public function setMax(string $max): void
- {
- $this->max = $max;
- }
-
- /**
- * Min getter.
- *
- * @return string
- */
- public function getMin(): string
- {
- return $this->min;
- }
-
- /**
- * Min setter.
- *
- * @param string $min
- */
- public function setMin(string $min): void
- {
- $this->min = $min;
- }
-
- /**
- * Pay date getter.
- *
- * @return Carbon
- */
- public function getPayDate(): Carbon
- {
- return $this->payDate;
- }
-
- /**
- * Pay date setter.
- *
- * @param Carbon $payDate
- */
- public function setPayDate(Carbon $payDate): void
- {
- $this->payDate = $payDate;
- }
-
- /**
- * Journal ID getter.
- *
- * @return int
- */
- public function getTransactionJournalId(): int
- {
- return $this->transactionJournalId ?? 0;
- }
-
- /**
- * Journal ID setter.
- *
- * @param int $transactionJournalId
- */
- public function setTransactionJournalId(int $transactionJournalId): void
- {
- $this->transactionJournalId = $transactionJournalId;
- }
-
- /**
- * Is active.
- *
- * @return bool
- */
- public function isActive(): bool
- {
- return 1 === (int)$this->bill->active;
- }
-
- /**
- * Is hit.
- *
- * @return bool
- */
- public function isHit(): bool
- {
- return $this->hit;
- }
-
- /**
- * Set is hit.
- *
- * @param bool $hit
- */
- public function setHit(bool $hit): void
- {
- $this->hit = $hit;
- }
-}
diff --git a/app/Helpers/Collection/Category.php b/app/Helpers/Collection/Category.php
deleted file mode 100644
index 35b5529dd1..0000000000
--- a/app/Helpers/Collection/Category.php
+++ /dev/null
@@ -1,97 +0,0 @@
-.
- */
-declare(strict_types=1);
-
-namespace FireflyIII\Helpers\Collection;
-
-use FireflyIII\Models\Category as CategoryModel;
-use Illuminate\Support\Collection;
-
-/**
- * Class Category.
- *
- * @codeCoverageIgnore
- */
-class Category
-{
- /** @var Collection The categories */
- protected $categories;
- /** @var string Total amount */
- protected $total = '0';
-
- /**
- * Category constructor.
- */
- public function __construct()
- {
- $this->categories = new Collection;
- }
-
- /**
- * Add a category.
- *
- * @param CategoryModel $category
- */
- public function addCategory(CategoryModel $category): void
- {
- // spent is minus zero for an expense report:
- if ($category->spent < 0) {
- $this->categories->push($category);
- $this->addTotal((string)$category->spent);
- }
- }
-
- /**
- * Add to the total amount.
- *
- * @param string $add
- */
- public function addTotal(string $add): void
- {
- $this->total = bcadd($this->total, $add);
- }
-
- /**
- * Get all categories.
- *
- * @return Collection
- */
- public function getCategories(): Collection
- {
- $set = $this->categories->sortBy(
- static function (CategoryModel $category) {
- return $category->spent;
- }
- );
-
- return $set;
- }
-
- /**
- * Get the total.
- *
- * @return string
- */
- public function getTotal(): string
- {
- return $this->total;
- }
-}
diff --git a/app/Helpers/Collector/GroupCollector.php b/app/Helpers/Collector/GroupCollector.php
index c364719f0e..0169f06b43 100644
--- a/app/Helpers/Collector/GroupCollector.php
+++ b/app/Helpers/Collector/GroupCollector.php
@@ -46,8 +46,6 @@ use Log;
*/
class GroupCollector implements GroupCollectorInterface
{
- /** @var array The accounts to filter on. Asset accounts or liabilities. */
- private $accountIds;
/** @var array The standard fields to select. */
private $fields;
/** @var bool Will be set to true if query result contains account information. (see function withAccountInformation). */
@@ -86,8 +84,6 @@ class GroupCollector implements GroupCollectorInterface
$this->hasJoinedTagTables = false;
$this->total = 0;
- $this->limit = 50;
- $this->page = 0;
$this->fields = [
# group
'transaction_groups.id as transaction_group_id',
@@ -157,10 +153,14 @@ class GroupCollector implements GroupCollectorInterface
$collection = $this->parseArray($result);
$this->total = $collection->count();
- // now filter the array according to the page and the
- $offset = $this->page * $this->limit;
+ // now filter the array according to the page and the limit (if necessary)
+ if (null !== $this->limit && null !== $this->page) {
+ $offset = ($this->page-1) * $this->limit;
return $collection->slice($offset, $this->limit);
+ }
+
+ return $collection;
}
@@ -182,7 +182,44 @@ class GroupCollector implements GroupCollectorInterface
}
);
app('log')->debug(sprintf('GroupCollector: setAccounts: %s', implode(', ', $accountIds)));
- $this->accountIds = $accountIds;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Define which accounts can be part of the source and destination transactions.
+ *
+ * @param Collection $accounts
+ *
+ * @return GroupCollectorInterface
+ */
+ public function setSourceAccounts(Collection $accounts): GroupCollectorInterface
+ {
+ if ($accounts->count() > 0) {
+ $accountIds = $accounts->pluck('id')->toArray();
+ $this->query->whereIn('source.account_id', $accountIds);
+
+ app('log')->debug(sprintf('GroupCollector: setSourceAccounts: %s', implode(', ', $accountIds)));
+ }
+
+ return $this;
+ }
+
+ /**
+ * Define which accounts can be part of the source and destination transactions.
+ *
+ * @param Collection $accounts
+ *
+ * @return GroupCollectorInterface
+ */
+ public function setDestinationAccounts(Collection $accounts): GroupCollectorInterface
+ {
+ if ($accounts->count() > 0) {
+ $accountIds = $accounts->pluck('id')->toArray();
+ $this->query->whereIn('destination.account_id', $accountIds);
+
+ app('log')->debug(sprintf('GroupCollector: setSourceAccounts: %s', implode(', ', $accountIds)));
}
return $this;
@@ -370,9 +407,9 @@ class GroupCollector implements GroupCollectorInterface
*/
public function setPage(int $page): GroupCollectorInterface
{
- $page = 0 === $page ? 0 : $page - 1;
+ $page = 0 === $page ? 1 : $page;
$this->page = $page;
- app('log')->debug(sprintf('GroupCollector: page is now %d (is minus 1)', $page));
+ app('log')->debug(sprintf('GroupCollector: page is now %d', $page));
return $this;
}
@@ -807,6 +844,7 @@ class GroupCollector implements GroupCollectorInterface
/** @var TransactionGroup $augmentedGroup */
foreach ($collection as $augmentedGroup) {
$groupId = $augmentedGroup->transaction_group_id;
+
if (!isset($groups[$groupId])) {
// make new array
$parsedGroup = $this->parseAugmentedGroup($augmentedGroup);
@@ -837,7 +875,9 @@ class GroupCollector implements GroupCollectorInterface
$groups[$groupId]['transactions'][$journalId] = $this->parseAugmentedGroup($augmentedGroup);
}
+
}
+
$groups = $this->parseSums($groups);
return new Collection($groups);
@@ -1010,4 +1050,42 @@ class GroupCollector implements GroupCollectorInterface
->orderBy('transaction_journals.description', 'DESC')
->orderBy('source.amount', 'DESC');
}
-}
\ No newline at end of file
+
+ /**
+ * These accounts must not be source accounts.
+ *
+ * @param Collection $accounts
+ *
+ * @return GroupCollectorInterface
+ */
+ public function excludeSourceAccounts(Collection $accounts): GroupCollectorInterface
+ {
+ if ($accounts->count() > 0) {
+ $accountIds = $accounts->pluck('id')->toArray();
+ $this->query->whereNotIn('source.account_id', $accountIds);
+
+ app('log')->debug(sprintf('GroupCollector: excludeSourceAccounts: %s', implode(', ', $accountIds)));
+ }
+
+ return $this;
+ }
+
+ /**
+ * These accounts must not be destination accounts.
+ *
+ * @param Collection $accounts
+ *
+ * @return GroupCollectorInterface
+ */
+ public function excludeDestinationAccounts(Collection $accounts): GroupCollectorInterface
+ {
+ if ($accounts->count() > 0) {
+ $accountIds = $accounts->pluck('id')->toArray();
+ $this->query->whereNotIn('destination.account_id', $accountIds);
+
+ app('log')->debug(sprintf('GroupCollector: excludeDestinationAccounts: %s', implode(', ', $accountIds)));
+ }
+
+ return $this;
+ }
+}
diff --git a/app/Helpers/Collector/GroupCollectorInterface.php b/app/Helpers/Collector/GroupCollectorInterface.php
index 2880576c3c..eb335f2631 100644
--- a/app/Helpers/Collector/GroupCollectorInterface.php
+++ b/app/Helpers/Collector/GroupCollectorInterface.php
@@ -46,6 +46,41 @@ interface GroupCollectorInterface
*/
public function getExtractedJournals(): array;
+ /**
+ * Set source accounts.
+ *
+ * @param Collection $accounts
+ *
+ * @return GroupCollectorInterface
+ */
+ public function setSourceAccounts(Collection $accounts): GroupCollectorInterface;
+
+ /**
+ * These accounts must not be source accounts.
+ *
+ * @param Collection $accounts
+ *
+ * @return GroupCollectorInterface
+ */
+ public function excludeSourceAccounts(Collection $accounts): GroupCollectorInterface;
+
+ /**
+ * Exclude destination accounts.
+ * @param Collection $accounts
+ *
+ * @return GroupCollectorInterface
+ */
+ public function excludeDestinationAccounts(Collection $accounts): GroupCollectorInterface;
+
+ /**
+ * Set destination accounts.
+ *
+ * @param Collection $accounts
+ *
+ * @return GroupCollectorInterface
+ */
+ public function setDestinationAccounts(Collection $accounts): GroupCollectorInterface;
+
/**
* Return the sum of all journals.
*
@@ -341,4 +376,4 @@ interface GroupCollectorInterface
*/
public function withCategoryInformation(): GroupCollectorInterface;
-}
\ No newline at end of file
+}
diff --git a/app/Helpers/Report/BalanceReportHelper.php b/app/Helpers/Report/BalanceReportHelper.php
index 82c87fb459..4dbbe70a9e 100644
--- a/app/Helpers/Report/BalanceReportHelper.php
+++ b/app/Helpers/Report/BalanceReportHelper.php
@@ -23,11 +23,10 @@ declare(strict_types=1);
namespace FireflyIII\Helpers\Report;
use Carbon\Carbon;
-use FireflyIII\Helpers\Collection\Balance;
-use FireflyIII\Helpers\Collection\BalanceEntry;
-use FireflyIII\Helpers\Collection\BalanceHeader;
-use FireflyIII\Helpers\Collection\BalanceLine;
-use FireflyIII\Models\BudgetLimit;
+use FireflyIII\Helpers\Collector\GroupCollectorInterface;
+use FireflyIII\Models\Account;
+use FireflyIII\Models\Budget;
+use FireflyIII\Models\TransactionType;
use FireflyIII\Repositories\Budget\BudgetRepositoryInterface;
use Illuminate\Support\Collection;
use Log;
@@ -44,8 +43,6 @@ class BalanceReportHelper implements BalanceReportHelperInterface
/**
* ReportHelper constructor.
- *
- *
* @param BudgetRepositoryInterface $budgetRepository
*/
public function __construct(BudgetRepositoryInterface $budgetRepository)
@@ -65,126 +62,78 @@ class BalanceReportHelper implements BalanceReportHelperInterface
* @param Carbon $start
* @param Carbon $end
*
- * @return Balance
+ * @return array
*/
- public function getBalanceReport(Collection $accounts, Carbon $start, Carbon $end): Balance
+ public function getBalanceReport(Collection $accounts, Carbon $start, Carbon $end): array
{
Log::debug('Start of balance report');
- $balance = new Balance;
- $header = new BalanceHeader;
- $budgetLimits = $this->budgetRepository->getAllBudgetLimits($start, $end);
+ $report = [
+ 'budgets' => [],
+ 'accounts' => [],
+ ];
+ /** @var Account $account */
foreach ($accounts as $account) {
- Log::debug(sprintf('Add account %s to headers.', $account->name));
- $header->addAccount($account);
+ $report['accounts'][$account->id] = [
+ 'id' => $account->id,
+ 'name' => $account->name,
+ 'iban' => $account->iban,
+ 'sum' => '0',
+ ];
}
- /** @var BudgetLimit $budgetLimit */
- foreach ($budgetLimits as $budgetLimit) {
- if (null !== $budgetLimit->budget) {
- $line = $this->createBalanceLine($budgetLimit, $accounts);
- $balance->addBalanceLine($line);
+ $budgets = $this->budgetRepository->getBudgets();
+
+ /** @var Budget $budget */
+ foreach ($budgets as $budget) {
+ $budgetId = $budget->id;
+ $report['budgets'][$budgetId] = [
+ 'budget_id' => $budgetId,
+ 'budget_name' => $budget->name,
+ 'spent' => [], // per account
+ 'sums' => [], // per currency
+ ];
+ $spent = [];
+ /** @var GroupCollectorInterface $collector */
+ $collector = app(GroupCollectorInterface::class);
+ $journals = $collector->setRange($start, $end)->setSourceAccounts($accounts)->setTypes([TransactionType::WITHDRAWAL])->setBudget($budget)
+ ->getExtractedJournals();
+ /** @var array $journal */
+ foreach ($journals as $journal) {
+ $sourceAccount = $journal['source_account_id'];
+ $currencyId = $journal['currency_id'];
+ $spent[$sourceAccount] = $spent[$sourceAccount] ?? [
+ 'source_account_id' => $sourceAccount,
+ 'currency_id' => $journal['currency_id'],
+ 'currency_code' => $journal['currency_code'],
+ 'currency_name' => $journal['currency_name'],
+ 'currency_symbol' => $journal['currency_symbol'],
+ 'currency_decimal_places' => $journal['currency_decimal_places'],
+ 'spent' => '0',
+ ];
+ $spent[$sourceAccount]['spent'] = bcadd($spent[$sourceAccount]['spent'], $journal['amount']);
+
+ // also fix sum:
+ $report['sums'][$budgetId][$currencyId] = $report['sums'][$budgetId][$currencyId] ?? [
+ 'sum' => '0',
+ 'currency_id' => $journal['currency_id'],
+ 'currency_code' => $journal['currency_code'],
+ 'currency_name' => $journal['currency_name'],
+ 'currency_symbol' => $journal['currency_symbol'],
+ 'currency_decimal_places' => $journal['currency_decimal_places'],
+ ];
+ $report['sums'][$budgetId][$currencyId]['sum'] = bcadd($report['sums'][$budgetId][$currencyId]['sum'], $journal['amount']);
+ $report['accounts'][$sourceAccount]['sum'] = bcadd($report['accounts'][$sourceAccount]['sum'], $journal['amount']);
+
+ // add currency info for account sum
+ $report['accounts'][$sourceAccount]['currency_id'] = $journal['currency_id'];
+ $report['accounts'][$sourceAccount]['currency_code'] = $journal['currency_code'];
+ $report['accounts'][$sourceAccount]['currency_name'] = $journal['currency_name'];
+ $report['accounts'][$sourceAccount]['currency_symbol'] = $journal['currency_symbol'];
+ $report['accounts'][$sourceAccount]['currency_decimal_places'] = $journal['currency_decimal_places'];
}
+ $report['budgets'][$budgetId]['spent'] = $spent;
+ // get transactions in budget
}
- $noBudgetLine = $this->createNoBudgetLine($accounts, $start, $end);
-
- $balance->addBalanceLine($noBudgetLine);
- $balance->setBalanceHeader($header);
-
- Log::debug('Clear unused budgets.');
- // remove budgets without expenses from balance lines:
- $balance = $this->removeUnusedBudgets($balance);
-
- Log::debug('Return report.');
-
- return $balance;
- }
-
- /**
- * Create one balance line.
- *
- * @param BudgetLimit $budgetLimit
- * @param Collection $accounts
- *
- * @return BalanceLine
- */
- private function createBalanceLine(BudgetLimit $budgetLimit, Collection $accounts): BalanceLine
- {
- $line = new BalanceLine;
- $line->setBudget($budgetLimit->budget);
- $line->setBudgetLimit($budgetLimit);
-
- // loop accounts:
- foreach ($accounts as $account) {
- $balanceEntry = new BalanceEntry;
- $balanceEntry->setAccount($account);
- $spent = $this->budgetRepository->spentInPeriod(
- new Collection([$budgetLimit->budget]),
- new Collection([$account]),
- $budgetLimit->start_date,
- $budgetLimit->end_date
- );
- $balanceEntry->setSpent($spent);
- $line->addBalanceEntry($balanceEntry);
- }
-
- return $line;
- }
-
- /**
- * Create a line for transactions without a budget.
- *
- * @param Collection $accounts
- * @param Carbon $start
- * @param Carbon $end
- *
- * @return BalanceLine
- */
- private function createNoBudgetLine(Collection $accounts, Carbon $start, Carbon $end): BalanceLine
- {
- $empty = new BalanceLine;
-
- foreach ($accounts as $account) {
- $spent = $this->budgetRepository->spentInPeriodWoBudget(new Collection([$account]), $start, $end);
- // budget
- $budgetEntry = new BalanceEntry;
- $budgetEntry->setAccount($account);
- $budgetEntry->setSpent($spent);
- $empty->addBalanceEntry($budgetEntry);
- }
-
- return $empty;
- }
-
- /**
- * Remove unused budgets from the report.
- *
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
- * @param Balance $balance
- *
- * @return Balance
- */
- private function removeUnusedBudgets(Balance $balance): Balance
- {
- $set = $balance->getBalanceLines();
- $newSet = new Collection;
- /** @var BalanceLine $entry */
- foreach ($set as $entry) {
- if (null !== $entry->getBudget()->id) {
- $sum = '0';
- /** @var BalanceEntry $balanceEntry */
- foreach ($entry->getBalanceEntries() as $balanceEntry) {
- $sum = bcadd($sum, $balanceEntry->getSpent());
- }
- if (bccomp($sum, '0') === -1) {
- $newSet->push($entry);
- }
- continue;
- }
- $newSet->push($entry);
- }
-
- $balance->setBalanceLines($newSet);
-
- return $balance;
+ return $report;
}
}
diff --git a/app/Helpers/Report/BalanceReportHelperInterface.php b/app/Helpers/Report/BalanceReportHelperInterface.php
index 2a18d6abe9..332d898cce 100644
--- a/app/Helpers/Report/BalanceReportHelperInterface.php
+++ b/app/Helpers/Report/BalanceReportHelperInterface.php
@@ -38,7 +38,7 @@ interface BalanceReportHelperInterface
* @param Carbon $start
* @param Carbon $end
*
- * @return Balance
+ * @return array
*/
- public function getBalanceReport(Collection $accounts, Carbon $start, Carbon $end): Balance;
+ public function getBalanceReport(Collection $accounts, Carbon $start, Carbon $end): array;
}
diff --git a/app/Helpers/Report/BudgetReportHelper.php b/app/Helpers/Report/BudgetReportHelper.php
index 238df2b504..d41de90649 100644
--- a/app/Helpers/Report/BudgetReportHelper.php
+++ b/app/Helpers/Report/BudgetReportHelper.php
@@ -57,8 +57,8 @@ class BudgetReportHelper implements BudgetReportHelperInterface
/**
* Get the full budget report.
*
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
- * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * TODO one big method is very complex.
+ *
* @param Carbon $start
* @param Carbon $end
* @param Collection $accounts
@@ -68,104 +68,142 @@ class BudgetReportHelper implements BudgetReportHelperInterface
public function getBudgetReport(Carbon $start, Carbon $end, Collection $accounts): array
{
$set = $this->repository->getBudgets();
- $array = [];
+ $array = [
+ 'budgets' => [],
+ 'sums' => [],
+ ];
/** @var Budget $budget */
foreach ($set as $budget) {
+ $entry = [
+ 'budget_id' => $budget->id,
+ 'budget_name' => $budget->name,
+ 'no_budget' => false,
+ 'rows' => [],
+ ];
+ // get multi currency expenses first:
$budgetLimits = $this->repository->getBudgetLimits($budget, $start, $end);
- if (0 === $budgetLimits->count()) { // no budget limit(s) for this budget
- $spent = $this->repository->spentInPeriod(new Collection([$budget]), $accounts, $start, $end); // spent for budget in time range
- if (bccomp($spent, '0') === -1) {
- $line = [
- 'type' => 'budget',
- 'id' => $budget->id,
- 'name' => $budget->name,
- 'budgeted' => '0',
- 'spent' => $spent,
- 'left' => '0',
- 'overspent' => '0',
+ $expenses = $this->repository->spentInPeriodMc(new Collection([$budget]), $accounts, $start, $end);
+ if (0 === count($expenses)) {
+ // list the budget limits, basic amounts.
+ /** @var BudgetLimit $limit */
+ foreach ($budgetLimits as $limit) {
+ $row = [
+ 'limit_id' => $limit->id,
+ 'start_date' => $limit->start_date,
+ 'end_date' => $limit->end_date,
+ 'budgeted' => $limit->amount,
+ 'spent' => '0',
+ 'left' => $limit->amount,
+ 'overspent' => null,
+ 'currency_id' => $limit->transactionCurrency->id,
+ 'currency_code' => $limit->transactionCurrency->code,
+ 'currency_name' => $limit->transactionCurrency->name,
+ 'currency_symbol' => $limit->transactionCurrency->symbol,
+ 'currency_decimal_places' => $limit->transactionCurrency->decimal_places,
];
- $array[] = $line;
+
+ $entry['rows'][] = $row;
}
- continue;
}
- /** @var BudgetLimit $budgetLimit */
- foreach ($budgetLimits as $budgetLimit) { // one or more repetitions for budget
- $data = $this->calculateExpenses($budget, $budgetLimit, $accounts);
- $line = [
- 'type' => 'budget-line',
- 'start' => $budgetLimit->start_date,
- 'end' => $budgetLimit->end_date,
- 'limit' => $budgetLimit->id,
- 'id' => $budget->id,
- 'name' => $budget->name,
-
- 'budgeted' => (string)$budgetLimit->amount,
- 'spent' => $data['expenses'],
- 'left' => $data['left'],
- 'overspent' => $data['overspent'],
+ foreach ($expenses as $expense) {
+ $limit = $this->budgetLimitInCurrency($expense['currency_id'], $budgetLimits);
+ $row = [
+ 'limit_id' => null,
+ 'start_date' => null,
+ 'end_date' => null,
+ 'budgeted' => null,
+ 'spent' => $expense['amount'],
+ 'left' => null,
+ 'overspent' => null,
+ 'currency_id' => $expense['currency_id'],
+ 'currency_code' => $expense['currency_name'],
+ 'currency_name' => $expense['currency_name'],
+ 'currency_symbol' => $expense['currency_symbol'],
+ 'currency_decimal_places' => $expense['currency_decimal_places'],
];
- $array[] = $line;
+ if (null !== $limit) {
+ // yes
+ $row['start_date'] = $limit->start_date;
+ $row['end_date'] = $limit->end_date;
+ $row['budgeted'] = $limit->amount;
+ $row['limit_id'] = $limit->id;
+
+ // less than zero? Set to 0.0
+ $row['left'] = -1 === bccomp(bcadd($limit->amount, $row['spent']), '0') ? '0' : bcadd($limit->amount, $row['spent']);
+
+ // spent > budgeted? then sum, otherwise other sum
+ $row['overspent'] = 1 === bccomp($row['spent'], $row['budgeted']) ? bcadd($row['spent'], $row['budgeted']) : '0';
+ }
+ $entry['rows'][] = $row;
}
+ $array['budgets'][] = $entry;
}
- $noBudget = $this->repository->spentInPeriodWoBudget($accounts, $start, $end); // stuff outside of budgets
- $line = [
- 'type' => 'no-budget',
- 'budgeted' => '0',
- 'spent' => $noBudget,
- 'left' => '0',
- 'overspent' => '0',
+ $noBudget = $this->repository->spentInPeriodWoBudgetMc($accounts, $start, $end);
+ $noBudgetEntry = [
+ 'budget_id' => null,
+ 'budget_name' => null,
+ 'no_budget' => true,
+ 'rows' => [],
];
- $array[] = $line;
+ foreach ($noBudget as $row) {
+ $noBudgetEntry['rows'][] = [
+ 'limit_id' => null,
+ 'start_date' => null,
+ 'end_date' => null,
+ 'budgeted' => null,
+ 'spent' => $row['amount'],
+ 'left' => null,
+ 'overspent' => null,
+ 'currency_id' => $row['currency_id'],
+ 'currency_code' => $row['currency_code'],
+ 'currency_name' => $row['currency_name'],
+ 'currency_symbol' => $row['currency_symbol'],
+ 'currency_decimal_places' => $row['currency_decimal_places'],
+ ];
+ }
+ $array['budgets'][] = $noBudgetEntry;
- return $array;
- }
-
- /**
- * Get all budgets and the expenses in these budgets.
- *
- * @param Carbon $start
- * @param Carbon $end
- * @param Collection $accounts
- *
- * @return Collection
- */
- public function getBudgetsWithExpenses(Carbon $start, Carbon $end, Collection $accounts): Collection
- {
- /** @var BudgetRepositoryInterface $repository */
- $repository = app(BudgetRepositoryInterface::class);
- $budgets = $repository->getActiveBudgets();
-
- $set = new Collection;
- /** @var Budget $budget */
- foreach ($budgets as $budget) {
- $total = $repository->spentInPeriod(new Collection([$budget]), $accounts, $start, $end);
- if (bccomp($total, '0') === -1) {
- $set->push($budget);
+ // fill sums:
+ /** @var array $budget */
+ foreach ($array['budgets'] as $budget) {
+ /** @var array $row */
+ foreach ($budget['rows'] as $row) {
+ $currencyId = $row['currency_id'];
+ $array['sums'][$currencyId] = $array['sums'][$currencyId] ?? [
+ 'currency_id' => $row['currency_id'],
+ 'currency_code' => $row['currency_code'],
+ 'currency_name' => $row['currency_name'],
+ 'currency_symbol' => $row['currency_symbol'],
+ 'currency_decimal_places' => $row['currency_decimal_places'],
+ 'budgeted' => '0',
+ 'spent' => '0',
+ 'left' => '0',
+ 'overspent' => '0',
+ ];
+ $array['sums'][$currencyId]['budgeted'] = bcadd($array['sums'][$currencyId]['budgeted'], $row['budgeted'] ?? '0');
+ $array['sums'][$currencyId]['spent'] = bcadd($array['sums'][$currencyId]['spent'], $row['spent'] ?? '0');
+ $array['sums'][$currencyId]['left'] = bcadd($array['sums'][$currencyId]['left'], $row['left'] ?? '0');
+ $array['sums'][$currencyId]['overspent'] = bcadd($array['sums'][$currencyId]['overspent'], $row['overspent'] ?? '0');
}
}
-
- return $set;
+ return $array;
}
/**
- * Calculate the expenses for a budget.
+ * Returns from the collection the budget limit with the indicated currency ID
*
- * @param Budget $budget
- * @param BudgetLimit $budgetLimit
- * @param Collection $accounts
+ * @param int $currencyId
+ * @param Collection $budgetLimits
*
- * @return array
+ * @return BudgetLimit|null
*/
- private function calculateExpenses(Budget $budget, BudgetLimit $budgetLimit, Collection $accounts): array
+ private function budgetLimitInCurrency(int $currencyId, Collection $budgetLimits): ?BudgetLimit
{
- $array = [];
- $expenses = $this->repository->spentInPeriod(new Collection([$budget]), $accounts, $budgetLimit->start_date, $budgetLimit->end_date);
- $array['left'] = 1 === bccomp(bcadd($budgetLimit->amount, $expenses), '0') ? bcadd($budgetLimit->amount, $expenses) : '0';
- $array['spent'] = 1 === bccomp(bcadd($budgetLimit->amount, $expenses), '0') ? $expenses : '0';
- $array['overspent'] = 1 === bccomp(bcadd($budgetLimit->amount, $expenses), '0') ? '0' : bcadd($expenses, $budgetLimit->amount);
- $array['expenses'] = $expenses;
-
- return $array;
+ return $budgetLimits->first(
+ static function (BudgetLimit $limit) use ($currencyId) {
+ return $limit->transaction_currency_id === $currencyId;
+ }
+ );
}
}
diff --git a/app/Helpers/Report/BudgetReportHelperInterface.php b/app/Helpers/Report/BudgetReportHelperInterface.php
index b470265709..a8adae656d 100644
--- a/app/Helpers/Report/BudgetReportHelperInterface.php
+++ b/app/Helpers/Report/BudgetReportHelperInterface.php
@@ -40,15 +40,4 @@ interface BudgetReportHelperInterface
* @return array
*/
public function getBudgetReport(Carbon $start, Carbon $end, Collection $accounts): array;
-
- /**
- * Get budgets and the expenses in each budget.
- *
- * @param Carbon $start
- * @param Carbon $end
- * @param Collection $accounts
- *
- * @return Collection
- */
- public function getBudgetsWithExpenses(Carbon $start, Carbon $end, Collection $accounts): Collection;
}
diff --git a/app/Helpers/Report/PopupReport.php b/app/Helpers/Report/PopupReport.php
index e9903565a3..1b8ab5a0f3 100644
--- a/app/Helpers/Report/PopupReport.php
+++ b/app/Helpers/Report/PopupReport.php
@@ -26,8 +26,8 @@ use FireflyIII\Helpers\Collector\GroupCollectorInterface;
use FireflyIII\Models\Account;
use FireflyIII\Models\Budget;
use FireflyIII\Models\Category;
-use FireflyIII\Models\Transaction;
use FireflyIII\Models\TransactionType;
+use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface;
use FireflyIII\Repositories\Journal\JournalRepositoryInterface;
use Illuminate\Support\Collection;
use Log;
@@ -98,11 +98,24 @@ class PopupReport implements PopupReportInterface
*/
public function byBudget(Budget $budget, array $attributes): array
{
+ // filter by currency, if set.
+ $currencyId = $attributes['currencyId'] ?? null;
+ $currency = null;
+ if (null !== $currencyId) {
+ /** @var CurrencyRepositoryInterface $repos */
+ $repos = app(CurrencyRepositoryInterface::class);
+ $currency = $repos->find((int)$currencyId);
+ }
+
+
/** @var GroupCollectorInterface $collector */
$collector = app(GroupCollectorInterface::class);
-
$collector->setAccounts($attributes['accounts'])->setRange($attributes['startDate'], $attributes['endDate']);
+ if (null !== $currency) {
+ $collector->setCurrency($currency);
+ }
+
if (null === $budget->id) {
$collector->setTypes([TransactionType::WITHDRAWAL])->withoutBudget();
}
@@ -123,12 +136,25 @@ class PopupReport implements PopupReportInterface
*/
public function byCategory(Category $category, array $attributes): array
{
+ // filter by currency, if set.
+ $currencyId = $attributes['currencyId'] ?? null;
+ $currency = null;
+ if (null !== $currencyId) {
+ /** @var CurrencyRepositoryInterface $repos */
+ $repos = app(CurrencyRepositoryInterface::class);
+ $currency = $repos->find((int)$currencyId);
+ }
+
/** @var GroupCollectorInterface $collector */
$collector = app(GroupCollectorInterface::class);
- $collector->setAccounts($attributes['accounts'])->setTypes([TransactionType::WITHDRAWAL, TransactionType::TRANSFER])
+ $collector->setAccounts($attributes['accounts'])
+ ->setTypes([TransactionType::WITHDRAWAL, TransactionType::TRANSFER, TransactionType::DEPOSIT])
->setRange($attributes['startDate'], $attributes['endDate'])->withAccountInformation()
->setCategory($category);
+ if (null !== $currency) {
+ $collector->setCurrency($currency);
+ }
return $collector->getExtractedJournals();
}
@@ -143,6 +169,15 @@ class PopupReport implements PopupReportInterface
*/
public function byExpenses(Account $account, array $attributes): array
{
+ // filter by currency, if set.
+ $currencyId = $attributes['currencyId'] ?? null;
+ $currency = null;
+ if (null !== $currencyId) {
+ /** @var CurrencyRepositoryInterface $repos */
+ $repos = app(CurrencyRepositoryInterface::class);
+ $currency = $repos->find((int)$currencyId);
+ }
+
/** @var JournalRepositoryInterface $repository */
$repository = app(JournalRepositoryInterface::class);
$repository->setUser($account->user);
@@ -150,20 +185,15 @@ class PopupReport implements PopupReportInterface
/** @var GroupCollectorInterface $collector */
$collector = app(GroupCollectorInterface::class);
- $collector->setAccounts(new Collection([$account]))->setRange($attributes['startDate'], $attributes['endDate'])
+ $collector->setAccounts(new Collection([$account]))
+ ->setRange($attributes['startDate'], $attributes['endDate'])
->setTypes([TransactionType::WITHDRAWAL, TransactionType::TRANSFER]);
- $journals = $collector->getExtractedJournals();
- $report = $attributes['accounts']->pluck('id')->toArray(); // accounts used in this report
- $filtered = [];
- // TODO not sure if filter is necessary.
- /** @var array $journal */
- foreach ($journals as $journal) {
- if (in_array($journal['source_account_id'], $report, true)) {
- $filtered[] = $journal;
- }
+ if (null !== $currency) {
+ $collector->setCurrency($currency);
}
- return $filtered;
+
+ return $collector->getExtractedJournals();
}
/**
@@ -179,24 +209,14 @@ class PopupReport implements PopupReportInterface
/** @var JournalRepositoryInterface $repository */
$repository = app(JournalRepositoryInterface::class);
$repository->setUser($account->user);
-
/** @var GroupCollectorInterface $collector */
$collector = app(GroupCollectorInterface::class);
- $collector->setAccounts(new Collection([$account]))->setRange($attributes['startDate'], $attributes['endDate'])
- ->setTypes([TransactionType::DEPOSIT, TransactionType::TRANSFER])
+ $collector
+ ->setSourceAccounts(new Collection([$account]))
+ ->setDestinationAccounts($attributes['accounts'])
+ ->setRange($attributes['startDate'], $attributes['endDate'])
+ ->setTypes([TransactionType::DEPOSIT, TransactionType::TRANSFER])
->withAccountInformation();
- $journals = $collector->getExtractedJournals();
- $report = $attributes['accounts']->pluck('id')->toArray(); // accounts used in this report
-
- // filter the set so the destinations outside of $attributes['accounts'] are not included.
- // TODO not sure if filter is necessary.
- $filtered = [];
- /** @var array $journal */
- foreach ($journals as $journal) {
- if (in_array($journal['destination_account_id'], $report, true)) {
- $filtered[] = $journal;
- }
- }
- return $filtered;
+ return $collector->getExtractedJournals();
}
}
diff --git a/app/Helpers/Report/ReportHelper.php b/app/Helpers/Report/ReportHelper.php
index 85dcde11ca..a3b502c873 100644
--- a/app/Helpers/Report/ReportHelper.php
+++ b/app/Helpers/Report/ReportHelper.php
@@ -23,8 +23,6 @@ declare(strict_types=1);
namespace FireflyIII\Helpers\Report;
use Carbon\Carbon;
-use FireflyIII\Helpers\Collection\Bill as BillCollection;
-use FireflyIII\Helpers\Collection\BillLine;
use FireflyIII\Helpers\Collector\GroupCollectorInterface;
use FireflyIII\Helpers\Fiscal\FiscalHelperInterface;
use FireflyIII\Models\Bill;
@@ -45,8 +43,6 @@ class ReportHelper implements ReportHelperInterface
/**
* ReportHelper constructor.
- *
- *
* @param BudgetRepositoryInterface $budgetRepository
*/
public function __construct(BudgetRepositoryInterface $budgetRepository)
@@ -66,64 +62,57 @@ class ReportHelper implements ReportHelperInterface
*
* Excludes bills which have not had a payment on the mentioned accounts.
*
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
- * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
- *
* @param Carbon $start
* @param Carbon $end
* @param Collection $accounts
*
- * @return BillCollection
+ * @return array
*/
- public function getBillReport(Carbon $start, Carbon $end, Collection $accounts): BillCollection
+ public function getBillReport(Collection $accounts, Carbon $start, Carbon $end): array
{
/** @var BillRepositoryInterface $repository */
$repository = app(BillRepositoryInterface::class);
$bills = $repository->getBillsForAccounts($accounts);
-
- $collection = new BillCollection;
- $collection->setStartDate($start);
- $collection->setEndDate($end);
+ $report = [
+ 'bills' => [],
+ ];
/** @var Bill $bill */
foreach ($bills as $bill) {
$expectedDates = $repository->getPayDatesInRange($bill, $start, $end);
- foreach ($expectedDates as $payDate) {
- $endOfPayPeriod = app('navigation')->endOfX($payDate, $bill->repeat_freq, null);
+ $billId = $bill->id;
+ $currency = $bill->transactionCurrency;
+ $current = [
+ 'id' => $bill->id,
+ 'name' => $bill->name,
+ 'active' => $bill->active,
+ 'amount_min' => $bill->amount_min,
+ 'amount_max' => $bill->amount_max,
+ 'currency_id' => $bill->transaction_currency_id,
+ 'currency_code' => $currency->code,
+ 'currency_name' => $currency->name,
+ 'currency_symbol' => $currency->symbol,
+ 'currency_decimal_places' => $currency->decimal_places,
+ 'expected_dates' => $expectedDates->toArray(),
+ 'paid_moments' => [],
+ ];
+ /** @var Carbon $start */
+ foreach ($expectedDates as $expectedStart) {
+ $expectedEnd = app('navigation')->endOfX($expectedStart, $bill->repeat_freq, null);
+ // is paid in this period maybe?
/** @var GroupCollectorInterface $collector */
$collector = app(GroupCollectorInterface::class);
- $collector->setAccounts($accounts)->setRange($payDate, $endOfPayPeriod)->setBill($bill);
- $journals = $collector->getExtractedJournals();
-
- $billLine = new BillLine;
- $billLine->setBill($bill);
- $billLine->setCurrency($bill->transactionCurrency);
- $billLine->setPayDate($payDate);
- $billLine->setEndOfPayDate($endOfPayPeriod);
- $billLine->setMin((string)$bill->amount_min);
- $billLine->setMax((string)$bill->amount_max);
- $billLine->setHit(false);
- /** @var array $first */
- $first = null;
- if (count($journals) > 0) {
- $first = reset($journals);
- }
- if (null !== $first) {
- $billLine->setTransactionJournalId($first['transaction_journal_id']);
- $billLine->setAmount($first['amount']);
- $billLine->setLastHitDate($first['date']);
- $billLine->setHit(true);
- }
- if ($billLine->isActive() || $billLine->isHit()) {
- $collection->addBill($billLine);
- }
+ $collector->setAccounts($accounts)->setRange($expectedStart, $expectedEnd)->setBill($bill);
+ $current['paid_moments'][] = $collector->getExtractedJournals();
}
- }
- $collection->filterBills();
- return $collection;
+ // append to report:
+ $report['bills'][$billId] = $current;
+ }
+
+ return $report;
}
/**
diff --git a/app/Helpers/Report/ReportHelperInterface.php b/app/Helpers/Report/ReportHelperInterface.php
index 703aa149a9..5830764cad 100644
--- a/app/Helpers/Report/ReportHelperInterface.php
+++ b/app/Helpers/Report/ReportHelperInterface.php
@@ -41,9 +41,9 @@ interface ReportHelperInterface
* @param Carbon $end
* @param Collection $accounts
*
- * @return BillCollection
+ * @return array
*/
- public function getBillReport(Carbon $start, Carbon $end, Collection $accounts): BillCollection;
+ public function getBillReport(Collection $accounts, Carbon $start, Carbon $end): array;
/**
* Generate a list of months.
diff --git a/app/Http/Controllers/Account/DeleteController.php b/app/Http/Controllers/Account/DeleteController.php
index c997c4814e..16f870f7bf 100644
--- a/app/Http/Controllers/Account/DeleteController.php
+++ b/app/Http/Controllers/Account/DeleteController.php
@@ -27,6 +27,7 @@ namespace FireflyIII\Http\Controllers\Account;
use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Models\Account;
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
+use FireflyIII\Support\Http\Controllers\UserNavigation;
use Illuminate\Http\Request;
/**
@@ -34,6 +35,8 @@ use Illuminate\Http\Request;
*/
class DeleteController extends Controller
{
+ use UserNavigation;
+
/** @var AccountRepositoryInterface The account repository */
private $repository;
@@ -67,6 +70,10 @@ class DeleteController extends Controller
*/
public function delete(Account $account)
{
+ if (!$this->isEditableAccount($account)) {
+ return $this->redirectAccountToAccount($account); // @codeCoverageIgnore
+ }
+
$typeName = config(sprintf('firefly.shortNamesByFullName.%s', $account->accountType->type));
$subTitle = (string)trans(sprintf('firefly.delete_%s_account', $typeName), ['name' => $account->name]);
$accountList = app('expandedform')->makeSelectListWithEmpty($this->repository->getAccountsByType([$account->accountType->type]));
@@ -89,6 +96,10 @@ class DeleteController extends Controller
*/
public function destroy(Request $request, Account $account)
{
+ if (!$this->isEditableAccount($account)) {
+ return $this->redirectAccountToAccount($account); // @codeCoverageIgnore
+ }
+
$type = $account->accountType->type;
$typeName = config(sprintf('firefly.shortNamesByFullName.%s', $type));
$name = $account->name;
diff --git a/app/Http/Controllers/Account/EditController.php b/app/Http/Controllers/Account/EditController.php
index 117f515dca..62ca47453c 100644
--- a/app/Http/Controllers/Account/EditController.php
+++ b/app/Http/Controllers/Account/EditController.php
@@ -30,6 +30,7 @@ use FireflyIII\Models\Account;
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface;
use FireflyIII\Support\Http\Controllers\ModelInformation;
+use FireflyIII\Support\Http\Controllers\UserNavigation;
use Illuminate\Http\Request;
/**
@@ -38,7 +39,7 @@ use Illuminate\Http\Request;
*/
class EditController extends Controller
{
- use ModelInformation;
+ use ModelInformation, UserNavigation;
/** @var CurrencyRepositoryInterface The currency repository */
private $currencyRepos;
/** @var AccountRepositoryInterface The account repository */
@@ -74,11 +75,13 @@ class EditController extends Controller
*
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
*
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
- * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*/
public function edit(Request $request, Account $account, AccountRepositoryInterface $repository)
{
+ if (!$this->isEditableAccount($account)) {
+ return $this->redirectAccountToAccount($account); // @codeCoverageIgnore
+ }
+
$objectType = config('firefly.shortNamesByFullName')[$account->accountType->type];
$subTitle = (string)trans(sprintf('firefly.edit_%s_account', $objectType), ['name' => $account->name]);
$subTitleIcon = config(sprintf('firefly.subIconsByIdentifier.%s', $objectType));
@@ -144,6 +147,10 @@ class EditController extends Controller
*/
public function update(AccountFormRequest $request, Account $account)
{
+ if (!$this->isEditableAccount($account)) {
+ return $this->redirectAccountToAccount($account); // @codeCoverageIgnore
+ }
+
$data = $request->getAccountData();
$this->repository->update($account, $data);
diff --git a/app/Http/Controllers/Account/ReconcileController.php b/app/Http/Controllers/Account/ReconcileController.php
index 0b4fd5d40d..0c7398762a 100644
--- a/app/Http/Controllers/Account/ReconcileController.php
+++ b/app/Http/Controllers/Account/ReconcileController.php
@@ -86,6 +86,10 @@ class ReconcileController extends Controller
*/
public function reconcile(Account $account, Carbon $start = null, Carbon $end = null)
{
+ if (!$this->isEditableAccount($account)) {
+ return $this->redirectAccountToAccount($account); // @codeCoverageIgnore
+ }
+
if (AccountType::ASSET !== $account->accountType->type) {
// @codeCoverageIgnoreStart
session()->flash('error', (string)trans('firefly.must_be_asset_account'));
@@ -146,6 +150,10 @@ class ReconcileController extends Controller
*/
public function submit(ReconciliationStoreRequest $request, Account $account, Carbon $start, Carbon $end)
{
+ if (!$this->isEditableAccount($account)) {
+ return $this->redirectAccountToAccount($account); // @codeCoverageIgnore
+ }
+
Log::debug('In ReconcileController::submit()');
$data = $request->getAll();
@@ -178,6 +186,10 @@ class ReconcileController extends Controller
*/
private function createReconciliation(Account $account, Carbon $start, Carbon $end, string $difference): string
{
+ if (!$this->isEditableAccount($account)) {
+ return $this->redirectAccountToAccount($account); // @codeCoverageIgnore
+ }
+
$reconciliation = $this->accountRepos->getReconciliation($account);
$currency = $this->accountRepos->getAccountCurrency($account) ?? app('amount')->getDefaultCurrency();
$source = $reconciliation;
diff --git a/app/Http/Controllers/Account/ShowController.php b/app/Http/Controllers/Account/ShowController.php
index cd5bee7207..1413258a59 100644
--- a/app/Http/Controllers/Account/ShowController.php
+++ b/app/Http/Controllers/Account/ShowController.php
@@ -28,7 +28,6 @@ use Exception;
use FireflyIII\Helpers\Collector\GroupCollectorInterface;
use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Models\Account;
-use FireflyIII\Models\AccountType;
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface;
use FireflyIII\Support\Http\Controllers\PeriodOverview;
@@ -40,7 +39,7 @@ use View;
/**
* Class ShowController
*
- * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ *
*/
class ShowController extends Controller
{
@@ -73,7 +72,7 @@ class ShowController extends Controller
);
}
- /** @noinspection MoreThanThreeArgumentsInspection */
+
/**
* Show an account.
*
@@ -87,8 +86,8 @@ class ShowController extends Controller
*/
public function show(Request $request, Account $account, Carbon $start = null, Carbon $end = null)
{
- if (in_array($account->accountType->type, [AccountType::INITIAL_BALANCE, AccountType::RECONCILIATION], true)) {
- return $this->redirectToOriginalAccount($account); // @codeCoverageIgnore
+ if (!$this->isEditableAccount($account)) {
+ return $this->redirectAccountToAccount($account); // @codeCoverageIgnore
}
/** @var Carbon $start */
@@ -139,15 +138,14 @@ class ShowController extends Controller
* @param Request $request
* @param Account $account
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector|View
- *
- *
* @throws Exception
*/
public function showAll(Request $request, Account $account)
{
- if (AccountType::INITIAL_BALANCE === $account->accountType->type) {
- return $this->redirectToOriginalAccount($account); // @codeCoverageIgnore
+ if (!$this->isEditableAccount($account)) {
+ return $this->redirectAccountToAccount($account); // @codeCoverageIgnore
}
+
$isLiability = $this->repository->isLiability($account);
$objectType = config(sprintf('firefly.shortNamesByFullName.%s', $account->accountType->type));
$end = new Carbon;
diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php
index ddb872bb16..f9e43bca2f 100644
--- a/app/Http/Controllers/Auth/LoginController.php
+++ b/app/Http/Controllers/Auth/LoginController.php
@@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see .
*/
-/** @noinspection PhpDynamicAsStaticMethodCallInspection */
declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Auth;
@@ -26,8 +25,6 @@ namespace FireflyIII\Http\Controllers\Auth;
use Adldap;
use DB;
use FireflyIII\Http\Controllers\Controller;
-use FireflyIII\User;
-use Illuminate\Cookie\CookieJar;
use Illuminate\Foundation\Auth\AuthenticatesUsers;
use Illuminate\Http\Request;
use Log;
@@ -85,61 +82,35 @@ class LoginController extends Controller
}
$this->validateLogin($request);
+ /** Copied directly from AuthenticatesUsers, but with logging added: */
// If the class is using the ThrottlesLogins trait, we can automatically throttle
// the login attempts for this application. We'll key this by the username and
// the IP address of the client making these requests into this application.
- if ($this->hasTooManyLoginAttempts($request)) {
+ if (method_exists($this, 'hasTooManyLoginAttempts') && $this->hasTooManyLoginAttempts($request)) {
Log::channel('audit')->info(sprintf('Login for user "%s" was locked out.', $request->get('email')));
$this->fireLockoutEvent($request);
- /** @noinspection PhpInconsistentReturnPointsInspection */
- /** @noinspection PhpVoidFunctionResultUsedInspection */
return $this->sendLockoutResponse($request);
}
+ /** Copied directly from AuthenticatesUsers, but with logging added: */
if ($this->attemptLogin($request)) {
Log::channel('audit')->info(sprintf('User "%s" has been logged in.', $request->get('email')));
- // user is logged in. Save in session if the user requested session to be remembered:
- $request->session()->put('remember_login', $request->filled('remember'));
-
Log::debug(sprintf('Redirect after login is %s.', $this->redirectPath()));
- /** @noinspection PhpInconsistentReturnPointsInspection */
- /** @noinspection PhpVoidFunctionResultUsedInspection */
- $response = $this->sendLoginResponse($request);
- Log::debug(sprintf('Response Location header: %s', $response->headers->get('location')));
-
- return $response;
+ return $this->sendLoginResponse($request);
}
+ /** Copied directly from AuthenticatesUsers, but with logging added: */
// If the login attempt was unsuccessful we will increment the number of attempts
// to login and redirect the user back to the login form. Of course, when this
// user surpasses their maximum number of attempts they will get locked out.
$this->incrementLoginAttempts($request);
Log::channel('audit')->info(sprintf('Login attempt for user "%s" failed.', $request->get('email')));
- /** @noinspection PhpInconsistentReturnPointsInspection */
- /** @noinspection PhpVoidFunctionResultUsedInspection */
+
return $this->sendFailedLoginResponse($request);
}
- /**
- * Log the user out of the application.
- *
- * @param Request $request
- * @param CookieJar $cookieJar
- *
- * @return $this|\Illuminate\Http\RedirectResponse
- */
- public function logout(Request $request, CookieJar $cookieJar)
- {
- $this->guard()->logout();
-
- $request->session()->invalidate();
- $cookie = $cookieJar->forget('twoFactorAuthenticated');
-
- return redirect('/')->withCookie($cookie);
- }
-
/**
* Show the application's login form.
*
@@ -151,20 +122,16 @@ class LoginController extends Controller
{
$count = DB::table('users')->count();
$loginProvider = config('firefly.login_provider');
- $pageTitle = (string)trans('firefly.login_page_title');
+ $title = (string)trans('firefly.login_page_title');
if (0 === $count && 'eloquent' === $loginProvider) {
return redirect(route('register')); // @codeCoverageIgnore
}
- // forget 2fa session thing.
- $request->session()->forget('twoFactorAuthenticated');
-
// is allowed to?
$singleUserMode = app('fireflyconfig')->get('single_user_mode', config('firefly.configuration.single_user_mode'))->data;
- $userCount = User::count();
$allowRegistration = true;
$allowReset = true;
- if (true === $singleUserMode && $userCount > 0) {
+ if (true === $singleUserMode && $count > 0) {
$allowRegistration = false;
}
@@ -177,6 +144,6 @@ class LoginController extends Controller
$email = $request->old('email');
$remember = $request->old('remember');
- return view('auth.login', compact('allowRegistration', 'email', 'remember', 'allowReset', 'pageTitle'));
+ return view('auth.login', compact('allowRegistration', 'email', 'remember', 'allowReset', 'title'));
}
}
diff --git a/app/Http/Controllers/BillController.php b/app/Http/Controllers/BillController.php
index 7c002a23a3..5f739eae42 100644
--- a/app/Http/Controllers/BillController.php
+++ b/app/Http/Controllers/BillController.php
@@ -43,7 +43,7 @@ use Symfony\Component\HttpFoundation\ParameterBag;
/**
* Class BillController.
*
- * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ *
*/
class BillController extends Controller
{
@@ -339,8 +339,6 @@ class BillController extends Controller
*
* @return RedirectResponse
*
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
- * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*/
public function store(BillFormRequest $request): RedirectResponse
{
diff --git a/app/Http/Controllers/Budget/AmountController.php b/app/Http/Controllers/Budget/AmountController.php
index 5fc6194a91..2f17a2baae 100644
--- a/app/Http/Controllers/Budget/AmountController.php
+++ b/app/Http/Controllers/Budget/AmountController.php
@@ -25,18 +25,15 @@ namespace FireflyIII\Http\Controllers\Budget;
use Carbon\Carbon;
-use FireflyIII\Helpers\Collector\GroupCollectorInterface;
use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Http\Requests\BudgetIncomeRequest;
use FireflyIII\Models\Budget;
-use FireflyIII\Models\TransactionType;
use FireflyIII\Repositories\Budget\BudgetRepositoryInterface;
use FireflyIII\Support\Http\Controllers\DateCalculation;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Collection;
-use Log;
/**
* Class AmountController
@@ -75,8 +72,6 @@ class AmountController extends Controller
* @param Budget $budget
*
* @return JsonResponse
- *
- * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*/
public function amount(Request $request, Budget $budget): JsonResponse
{
diff --git a/app/Http/Controllers/Budget/IndexController.php b/app/Http/Controllers/Budget/IndexController.php
index 6c52b522bd..77dcb37d1d 100644
--- a/app/Http/Controllers/Budget/IndexController.php
+++ b/app/Http/Controllers/Budget/IndexController.php
@@ -74,8 +74,6 @@ class IndexController extends Controller
* @param Carbon|null $end
*
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
- *
- * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*/
public function index(Request $request, Carbon $start = null, Carbon $end = null)
{
diff --git a/app/Http/Controllers/Category/CreateController.php b/app/Http/Controllers/Category/CreateController.php
index f0cfb0a21a..d734fb23b7 100644
--- a/app/Http/Controllers/Category/CreateController.php
+++ b/app/Http/Controllers/Category/CreateController.php
@@ -1,4 +1,5 @@
getPreviousUri('categories.delete.uri'));
}
-}
\ No newline at end of file
+}
diff --git a/app/Http/Controllers/Category/EditController.php b/app/Http/Controllers/Category/EditController.php
index 76991b0369..a9dd6cf37d 100644
--- a/app/Http/Controllers/Category/EditController.php
+++ b/app/Http/Controllers/Category/EditController.php
@@ -1,4 +1,5 @@
json($data);
}
- /** @noinspection MoreThanThreeArgumentsInspection */
+
/**
* Shows a budget overview chart (spent and budgeted).
*
diff --git a/app/Http/Controllers/Chart/BudgetReportController.php b/app/Http/Controllers/Chart/BudgetReportController.php
index 439c8414dd..18186d2a25 100644
--- a/app/Http/Controllers/Chart/BudgetReportController.php
+++ b/app/Http/Controllers/Chart/BudgetReportController.php
@@ -39,7 +39,7 @@ use Illuminate\Support\Collection;
*
* Class BudgetReportController
*
- * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ *
*/
class BudgetReportController extends Controller
{
@@ -66,7 +66,7 @@ class BudgetReportController extends Controller
);
}
- /** @noinspection MoreThanThreeArgumentsInspection */
+
/**
* Chart that groups expenses by the account.
*
@@ -79,8 +79,6 @@ class BudgetReportController extends Controller
* @param string $others
*
* @return JsonResponse
- *
- * @SuppressWarnings(PHPMD.ExcessiveParameterList)
*/
public function accountExpense(Collection $accounts, Collection $budgets, Carbon $start, Carbon $end, string $others): JsonResponse
{
@@ -97,7 +95,7 @@ class BudgetReportController extends Controller
return response()->json($data);
}
- /** @noinspection MoreThanThreeArgumentsInspection */
+
/**
* Chart that groups the expenses by budget.
*
@@ -110,8 +108,6 @@ class BudgetReportController extends Controller
* @param string $others
*
* @return JsonResponse
- *
- * @SuppressWarnings(PHPMD.ExcessiveParameterList)
*/
public function budgetExpense(Collection $accounts, Collection $budgets, Carbon $start, Carbon $end, string $others): JsonResponse
{
@@ -128,7 +124,7 @@ class BudgetReportController extends Controller
return response()->json($data);
}
- /** @noinspection MoreThanThreeArgumentsInspection */
+
/**
* Main overview of a budget in the budget report.
*
@@ -141,8 +137,6 @@ class BudgetReportController extends Controller
*
* @return JsonResponse
*
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
- * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*/
public function mainChart(Collection $accounts, Collection $budgets, Carbon $start, Carbon $end): JsonResponse
{
diff --git a/app/Http/Controllers/Chart/CategoryController.php b/app/Http/Controllers/Chart/CategoryController.php
index 50c6694dbd..7c90d8ae22 100644
--- a/app/Http/Controllers/Chart/CategoryController.php
+++ b/app/Http/Controllers/Chart/CategoryController.php
@@ -23,6 +23,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Chart;
use Carbon\Carbon;
+use Exception;
use FireflyIII\Generator\Chart\Basic\GeneratorInterface;
use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Models\AccountType;
@@ -32,6 +33,7 @@ use FireflyIII\Repositories\Account\AccountRepositoryInterface;
use FireflyIII\Repositories\Category\CategoryRepositoryInterface;
use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface;
use FireflyIII\Support\CacheProperties;
+use FireflyIII\Support\Chart\Category\WholePeriodChartGenerator;
use FireflyIII\Support\Http\Controllers\AugumentData;
use FireflyIII\Support\Http\Controllers\ChartGeneration;
use FireflyIII\Support\Http\Controllers\DateCalculation;
@@ -66,89 +68,30 @@ class CategoryController extends Controller
* TODO this chart is not multi-currency aware.
*
* @param CategoryRepositoryInterface $repository
- * @param AccountRepositoryInterface $accountRepository
* @param Category $category
*
* @return JsonResponse
- *
- * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*/
- public function all(CategoryRepositoryInterface $repository, AccountRepositoryInterface $accountRepository, Category $category): JsonResponse
+ public function all(CategoryRepositoryInterface $repository, Category $category): JsonResponse
{
+ // cache results:
$cache = new CacheProperties;
$cache->addProperty('chart.category.all');
$cache->addProperty($category->id);
if ($cache->has()) {
return response()->json($cache->get()); // @codeCoverageIgnore
}
- $start = $repository->firstUseDate($category);
- $start = $start ?? new Carbon;
+ $start = $repository->firstUseDate($category) ?? $this->getDate();
$range = app('preferences')->get('viewRange', '1M')->data;
$start = app('navigation')->startOfPeriod($start, $range);
- $end = new Carbon;
- $accounts = $accountRepository->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET]);
+ $end = $this->getDate();
Log::debug(sprintf('Full range is %s to %s', $start->format('Y-m-d'), $end->format('Y-m-d')));
- $chartData = [
- [
- 'label' => (string)trans('firefly.spent'),
- 'entries' => [], 'type' => 'bar',
- 'backgroundColor' => 'rgba(219, 68, 55, 0.5)', // red
- ],
- [
- 'label' => (string)trans('firefly.earned'),
- 'entries' => [], 'type' => 'bar',
- 'backgroundColor' => 'rgba(0, 141, 76, 0.5)', // green
- ],
- [
- 'label' => (string)trans('firefly.sum'),
- 'entries' => [], 'type' => 'line', 'fill' => false,
- ],
- ];
- $step = $this->calculateStep($start, $end);
- /** @var Carbon $current */
- $current = clone $start;
-
- Log::debug(sprintf('abc Step is %s', $step));
-
- switch ($step) {
- case '1D':
- while ($current <= $end) {
- //Log::debug(sprintf('Current day is %s', $current->format('Y-m-d')));
- $spent = $repository->spentInPeriod(new Collection([$category]), $accounts, $current, $current);
- $earned = $repository->earnedInPeriod(new Collection([$category]), $accounts, $current, $current);
- $sum = bcadd($spent, $earned);
- $label = app('navigation')->periodShow($current, $step);
- $chartData[0]['entries'][$label] = round(bcmul($spent, '-1'), 12);
- $chartData[1]['entries'][$label] = round($earned, 12);
- $chartData[2]['entries'][$label] = round($sum, 12);
- $current->addDay();
- }
- break;
- // @codeCoverageIgnoreStart
- // for some reason it doesn't pick up on these case entries.
- case '1W':
- case '1M':
- case '1Y':
- // @codeCoverageIgnoreEnd
- while ($current <= $end) {
- $currentEnd = app('navigation')->endOfPeriod($current, $step);
- //Log::debug(sprintf('abc Range is %s to %s', $current->format('Y-m-d'), $currentEnd->format('Y-m-d')));
-
- $spent = $repository->spentInPeriod(new Collection([$category]), $accounts, $current, $currentEnd);
- $earned = $repository->earnedInPeriod(new Collection([$category]), $accounts, $current, $currentEnd);
- $sum = bcadd($spent, $earned);
- $label = app('navigation')->periodShow($current, $step);
- $chartData[0]['entries'][$label] = round(bcmul($spent, '-1'), 12);
- $chartData[1]['entries'][$label] = round($earned, 12);
- $chartData[2]['entries'][$label] = round($sum, 12);
- $current = app('navigation')->addPeriod($current, $step, 0);
- }
- break;
- }
-
- $data = $this->generator->multiSet($chartData);
+ /** @var WholePeriodChartGenerator $generator */
+ $generator = app(WholePeriodChartGenerator::class);
+ $chartData = $generator->generate($category, $start, $end);
+ $data = $this->generator->multiSet($chartData);
$cache->store($data);
return response()->json($data);
@@ -259,8 +202,6 @@ class CategoryController extends Controller
* @param Carbon $end
*
* @return JsonResponse
- *
- * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*/
public function reportPeriod(Category $category, Collection $accounts, Carbon $start, Carbon $end): JsonResponse
{
@@ -271,7 +212,7 @@ class CategoryController extends Controller
$cache->addProperty($accounts->pluck('id')->toArray());
$cache->addProperty($category);
if ($cache->has()) {
- return response()->json($cache->get());// @codeCoverageIgnore
+ return response()->json($cache->get());// @codeCoverageIgnore
}
$repository = app(CategoryRepositoryInterface::class);
$expenses = $repository->periodExpenses(new Collection([$category]), $accounts, $start, $end);
@@ -303,7 +244,7 @@ class CategoryController extends Controller
$spent = $expenses[$category->id]['entries'][$period] ?? '0';
$earned = $income[$category->id]['entries'][$period] ?? '0';
$sum = bcadd($spent, $earned);
- $chartData[0]['entries'][$label] = round(bcmul($spent, '-1'), 12);
+ $chartData[0]['entries'][$label] = round($spent, 12);
$chartData[1]['entries'][$label] = round($earned, 12);
$chartData[2]['entries'][$label] = round($sum, 12);
}
@@ -315,7 +256,7 @@ class CategoryController extends Controller
}
- /** @noinspection MoreThanThreeArgumentsInspection */
+
/**
* Chart for period for transactions without a category.
@@ -327,8 +268,6 @@ class CategoryController extends Controller
* @param Carbon $end
*
* @return JsonResponse
- *
- * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*/
public function reportPeriodNoCategory(Collection $accounts, Carbon $start, Carbon $end): JsonResponse
{
@@ -383,8 +322,6 @@ class CategoryController extends Controller
/**
* Chart for a specific period.
*
- * TODO this chart is not multi-currency aware.
- *
* @param Category $category
* @param $date
*
@@ -399,8 +336,42 @@ class CategoryController extends Controller
[$end, $start] = [$start, $end]; // @codeCoverageIgnore
}
- $data = $this->makePeriodChart($category, $start, $end);
+ $cache = new CacheProperties;
+ $cache->addProperty($start);
+ $cache->addProperty($end);
+ $cache->addProperty($category->id);
+ $cache->addProperty('chart.category.period-chart');
+
+
+ if ($cache->has()) {
+ return response()->json($cache->get()); // @codeCoverageIgnore
+ }
+
+ /** @var GeneratorInterface $generator */
+ $generator = app(GeneratorInterface::class);
+
+ /** @var WholePeriodChartGenerator $chartGenerator */
+ $chartGenerator = app(WholePeriodChartGenerator::class);
+ $chartData = $chartGenerator->generate($category, $start, $end);
+ $data = $generator->multiSet($chartData);
+
+ $cache->store($data);
return response()->json($data);
}
+
+ /**
+ * @return Carbon
+ */
+ private function getDate(): Carbon
+ {
+ $carbon = null;
+ try {
+ $carbon = new Carbon;
+ } catch (Exception $e) {
+ $e->getMessage();
+ }
+
+ return $carbon;
+ }
}
diff --git a/app/Http/Controllers/Chart/CategoryReportController.php b/app/Http/Controllers/Chart/CategoryReportController.php
index 6ad3b2d009..6e55c7dd63 100644
--- a/app/Http/Controllers/Chart/CategoryReportController.php
+++ b/app/Http/Controllers/Chart/CategoryReportController.php
@@ -61,7 +61,7 @@ class CategoryReportController extends Controller
);
}
- /** @noinspection MoreThanThreeArgumentsInspection */
+
/**
* Chart for expenses grouped by expense account.
*
@@ -74,8 +74,6 @@ class CategoryReportController extends Controller
* @param string $others
*
* @return JsonResponse
- *
- * @SuppressWarnings(PHPMD.ExcessiveParameterList)
*/
public function accountExpense(Collection $accounts, Collection $categories, Carbon $start, Carbon $end, string $others): JsonResponse
{
@@ -89,7 +87,7 @@ class CategoryReportController extends Controller
return response()->json($data);
}
- /** @noinspection MoreThanThreeArgumentsInspection */
+
/**
* Chart for income grouped by revenue account.
*
@@ -102,8 +100,6 @@ class CategoryReportController extends Controller
* @param string $others
*
* @return JsonResponse
- *
- * @SuppressWarnings(PHPMD.ExcessiveParameterList)
*/
public function accountIncome(Collection $accounts, Collection $categories, Carbon $start, Carbon $end, string $others): JsonResponse
{
@@ -120,7 +116,7 @@ class CategoryReportController extends Controller
return response()->json($data);
}
- /** @noinspection MoreThanThreeArgumentsInspection */
+
/**
* Chart for expenses grouped by expense account.
*
@@ -133,8 +129,6 @@ class CategoryReportController extends Controller
* @param string $others
*
* @return JsonResponse
- *
- * @SuppressWarnings(PHPMD.ExcessiveParameterList)
*/
public function categoryExpense(Collection $accounts, Collection $categories, Carbon $start, Carbon $end, string $others): JsonResponse
{
@@ -151,7 +145,7 @@ class CategoryReportController extends Controller
return response()->json($data);
}
- /** @noinspection MoreThanThreeArgumentsInspection */
+
/**
* Piechart for income grouped by account.
*
@@ -164,7 +158,7 @@ class CategoryReportController extends Controller
* @param string $others
*
* @return JsonResponse
- * @SuppressWarnings(PHPMD.ExcessiveParameterList)
+ *
*/
public function categoryIncome(Collection $accounts, Collection $categories, Carbon $start, Carbon $end, string $others): JsonResponse
{
@@ -182,7 +176,7 @@ class CategoryReportController extends Controller
}
- /** @noinspection MoreThanThreeArgumentsInspection */
+
/**
* Main report category chart.
*
@@ -195,9 +189,7 @@ class CategoryReportController extends Controller
*
* @return JsonResponse
*
- * @SuppressWarnings(PHPMD.ExcessiveParameterList)
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
- * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ *
*/
public function mainChart(Collection $accounts, Collection $categories, Carbon $start, Carbon $end): JsonResponse
{
@@ -208,7 +200,7 @@ class CategoryReportController extends Controller
$cache->addProperty($start);
$cache->addProperty($end);
if ($cache->has()) {
- //return response()->json($cache->get()); // @codeCoverageIgnore
+ return response()->json($cache->get()); // @codeCoverageIgnore
}
$format = app('navigation')->preferredCarbonLocalizedFormat($start, $end);
@@ -262,7 +254,7 @@ class CategoryReportController extends Controller
$labelOut = $category->id . '-out';
$labelSumIn = $category->id . '-total-in';
$labelSumOut = $category->id . '-total-out';
- $currentIncome = bcmul($income[$category->id] ?? '0','-1');
+ $currentIncome = $income[$category->id] ?? '0';
$currentExpense = $expenses[$category->id] ?? '0';
// add to sum:
diff --git a/app/Http/Controllers/Chart/ExpenseReportController.php b/app/Http/Controllers/Chart/ExpenseReportController.php
index e03c592552..9872ebe8e3 100644
--- a/app/Http/Controllers/Chart/ExpenseReportController.php
+++ b/app/Http/Controllers/Chart/ExpenseReportController.php
@@ -18,7 +18,7 @@
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see .
*/
-/** @noinspection MoreThanThreeArgumentsInspection */
+
declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Chart;
@@ -64,7 +64,7 @@ class ExpenseReportController extends Controller
);
}
- /** @noinspection MoreThanThreeArgumentsInspection */
+
/**
* Main chart that shows income and expense for a combination of expense/revenue accounts.
*
@@ -77,9 +77,7 @@ class ExpenseReportController extends Controller
*
* @return JsonResponse
*
- * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
- * @SuppressWarnings(PHPMD.NPathComplexity)
+ *
*/
public function mainChart(Collection $accounts, Collection $expense, Carbon $start, Carbon $end): JsonResponse
{
diff --git a/app/Http/Controllers/Chart/PiggyBankController.php b/app/Http/Controllers/Chart/PiggyBankController.php
index fb94165760..a558e6fbb7 100644
--- a/app/Http/Controllers/Chart/PiggyBankController.php
+++ b/app/Http/Controllers/Chart/PiggyBankController.php
@@ -63,8 +63,6 @@ class PiggyBankController extends Controller
*
* @return JsonResponse
*
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
- * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*/
public function history(PiggyBankRepositoryInterface $repository, PiggyBank $piggyBank): JsonResponse
{
diff --git a/app/Http/Controllers/Chart/ReportController.php b/app/Http/Controllers/Chart/ReportController.php
index 280220fa50..efd50c17da 100644
--- a/app/Http/Controllers/Chart/ReportController.php
+++ b/app/Http/Controllers/Chart/ReportController.php
@@ -86,7 +86,7 @@ class ReportController extends Controller
/** @var AccountRepositoryInterface $accountRepository */
$accountRepository = app(AccountRepositoryInterface::class);
$filtered = $accounts->filter(
- function (Account $account) use ($accountRepository) {
+ static function (Account $account) use ($accountRepository) {
$includeNetWorth = $accountRepository->getMetaValue($account, 'include_net_worth');
$result = null === $includeNetWorth ? true : '1' === $includeNetWorth;
if (false === $result) {
@@ -97,6 +97,7 @@ class ReportController extends Controller
}
);
+ // TODO get liabilities and include those as well?
while ($current < $end) {
// get balances by date, grouped by currency.
@@ -137,8 +138,6 @@ class ReportController extends Controller
* @param Carbon $end
*
* @return \Illuminate\Http\JsonResponse
- *
- * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*/
public function operations(Collection $accounts, Carbon $start, Carbon $end): JsonResponse
{
@@ -199,8 +198,6 @@ class ReportController extends Controller
*
* @return \Illuminate\Http\JsonResponse
*
- * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
*/
public function sum(Collection $accounts, Carbon $start, Carbon $end): JsonResponse
{
@@ -224,7 +221,7 @@ class ReportController extends Controller
'count_spent' => 0,
];
foreach ($source['earned'] as $amount) {
- $amount = bcmul($amount,'-1');
+ $amount = bcmul($amount, '-1');
$numbers['sum_earned'] = bcadd($amount, $numbers['sum_earned']);
++$numbers['count_earned'];
}
diff --git a/app/Http/Controllers/Chart/TagReportController.php b/app/Http/Controllers/Chart/TagReportController.php
index aacf46a64e..3ef5b78928 100644
--- a/app/Http/Controllers/Chart/TagReportController.php
+++ b/app/Http/Controllers/Chart/TagReportController.php
@@ -53,7 +53,7 @@ class TagReportController extends Controller
$this->generator = app(GeneratorInterface::class);
}
- /** @noinspection MoreThanThreeArgumentsInspection */
+
/**
* Generate expenses for tags grouped on account.
*
@@ -66,8 +66,6 @@ class TagReportController extends Controller
* @param string $others
*
* @return JsonResponse
- *
- * @SuppressWarnings(PHPMD.ExcessiveParameterList)
*/
public function accountExpense(Collection $accounts, Collection $tags, Carbon $start, Carbon $end, string $others): JsonResponse
{
@@ -84,7 +82,7 @@ class TagReportController extends Controller
return response()->json($data);
}
- /** @noinspection MoreThanThreeArgumentsInspection */
+
/**
* Generate income for tag grouped by account.
*
@@ -97,8 +95,6 @@ class TagReportController extends Controller
* @param string $others
*
* @return JsonResponse
- *
- * @SuppressWarnings(PHPMD.ExcessiveParameterList)
*/
public function accountIncome(Collection $accounts, Collection $tags, Carbon $start, Carbon $end, string $others): JsonResponse
{
@@ -115,7 +111,7 @@ class TagReportController extends Controller
return response()->json($data);
}
- /** @noinspection MoreThanThreeArgumentsInspection */
+
/**
* Generate expense for tag grouped on budget.
*
@@ -127,8 +123,6 @@ class TagReportController extends Controller
* @param Carbon $end
*
* @return JsonResponse
- *
- * @SuppressWarnings(PHPMD.ExcessiveParameterList)
*/
public function budgetExpense(Collection $accounts, Collection $tags, Carbon $start, Carbon $end): JsonResponse
{
@@ -145,7 +139,7 @@ class TagReportController extends Controller
return response()->json($data);
}
- /** @noinspection MoreThanThreeArgumentsInspection */
+
/**
* Generate expense for tag grouped on category.
*
@@ -157,8 +151,6 @@ class TagReportController extends Controller
* @param Carbon $end
*
* @return JsonResponse
- *
- * @SuppressWarnings(PHPMD.ExcessiveParameterList)
*/
public function categoryExpense(Collection $accounts, Collection $tags, Carbon $start, Carbon $end): JsonResponse
{
@@ -175,7 +167,7 @@ class TagReportController extends Controller
return response()->json($data);
}
- /** @noinspection MoreThanThreeArgumentsInspection */
+
/**
* Generate main tag overview chart.
*
@@ -188,9 +180,7 @@ class TagReportController extends Controller
*
* @return JsonResponse
*
- * @SuppressWarnings(PHPMD.ExcessiveParameterList)
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
- * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ *
*/
public function mainChart(Collection $accounts, Collection $tags, Carbon $start, Carbon $end): JsonResponse
{
@@ -201,7 +191,7 @@ class TagReportController extends Controller
$cache->addProperty($start);
$cache->addProperty($end);
if ($cache->has()) {
- //return response()->json($cache->get()); // @codeCoverageIgnore
+ return response()->json($cache->get()); // @codeCoverageIgnore
}
$format = app('navigation')->preferredCarbonLocalizedFormat($start, $end);
@@ -292,7 +282,7 @@ class TagReportController extends Controller
return response()->json($data);
}
- /** @noinspection MoreThanThreeArgumentsInspection */
+
/**
* Show expense grouped by expense account.
*
@@ -305,8 +295,6 @@ class TagReportController extends Controller
* @param string $others
*
* @return JsonResponse
- *
- * @SuppressWarnings(PHPMD.ExcessiveParameterList)
*/
public function tagExpense(Collection $accounts, Collection $tags, Carbon $start, Carbon $end, string $others): JsonResponse
{
@@ -323,7 +311,7 @@ class TagReportController extends Controller
return response()->json($data);
}
- /** @noinspection MoreThanThreeArgumentsInspection */
+
/**
* Show income grouped by tag.
*
@@ -336,8 +324,6 @@ class TagReportController extends Controller
* @param string $others
*
* @return JsonResponse
- *
- * @SuppressWarnings(PHPMD.ExcessiveParameterList)
*/
public function tagIncome(Collection $accounts, Collection $tags, Carbon $start, Carbon $end, string $others): JsonResponse
{
diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php
index c5c041a3aa..f676ee4192 100644
--- a/app/Http/Controllers/Controller.php
+++ b/app/Http/Controllers/Controller.php
@@ -33,7 +33,7 @@ use Route;
/**
* Class Controller.
*
- * @SuppressWarnings(PHPMD.NumberOfChildren)
+ *
*/
class Controller extends BaseController
{
diff --git a/app/Http/Controllers/CurrencyController.php b/app/Http/Controllers/CurrencyController.php
index 6aa462e6be..ba9129c3b2 100644
--- a/app/Http/Controllers/CurrencyController.php
+++ b/app/Http/Controllers/CurrencyController.php
@@ -333,8 +333,6 @@ class CurrencyController extends Controller
* @param CurrencyFormRequest $request
*
* @return $this|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
- *
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
*/
public function store(CurrencyFormRequest $request)
{
diff --git a/app/Http/Controllers/DebugController.php b/app/Http/Controllers/DebugController.php
index 8de8555f3d..f95d22aec9 100644
--- a/app/Http/Controllers/DebugController.php
+++ b/app/Http/Controllers/DebugController.php
@@ -39,7 +39,7 @@ use Route as RouteFacade;
/**
* Class DebugController
*
- * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ *
*/
class DebugController extends Controller
{
@@ -113,8 +113,6 @@ class DebugController extends Controller
*
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
*
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
- * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*/
public function index(Request $request)
{
@@ -192,8 +190,6 @@ class DebugController extends Controller
* Return all possible routes.
*
* @return string
- *
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
*/
public function routes(): string
{
diff --git a/app/Http/Controllers/Import/IndexController.php b/app/Http/Controllers/Import/IndexController.php
index cf4a4eadee..755b854a47 100644
--- a/app/Http/Controllers/Import/IndexController.php
+++ b/app/Http/Controllers/Import/IndexController.php
@@ -71,8 +71,6 @@ class IndexController extends Controller
*
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
- * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*/
public function create(string $importProvider)
{
diff --git a/app/Http/Controllers/Import/JobConfigurationController.php b/app/Http/Controllers/Import/JobConfigurationController.php
index dac7b2136f..ed921f5092 100644
--- a/app/Http/Controllers/Import/JobConfigurationController.php
+++ b/app/Http/Controllers/Import/JobConfigurationController.php
@@ -68,8 +68,6 @@ class JobConfigurationController extends Controller
*
* @throws FireflyException
*
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
- *
*/
public function index(ImportJob $importJob)
{
@@ -119,8 +117,6 @@ class JobConfigurationController extends Controller
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*
* @throws FireflyException
- *
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
*/
public function post(Request $request, ImportJob $importJob)
{
diff --git a/app/Http/Controllers/Import/PrerequisitesController.php b/app/Http/Controllers/Import/PrerequisitesController.php
index 7a08d0519b..3ae9a1bbc2 100644
--- a/app/Http/Controllers/Import/PrerequisitesController.php
+++ b/app/Http/Controllers/Import/PrerequisitesController.php
@@ -67,8 +67,6 @@ class PrerequisitesController extends Controller
* @param ImportJob $importJob
*
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
- *
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
*/
public function index(string $importProvider, ImportJob $importJob = null)
{
@@ -111,15 +109,13 @@ class PrerequisitesController extends Controller
* Whatever storePrerequisites does, it should make sure that the system is ready to continue immediately. So
* no extra calls or stuff, except maybe to open a session
*
- * @see PrerequisitesInterface::storePrerequisites
- *
* @param Request $request
* @param string $importProvider
* @param ImportJob $importJob
*
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
- * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @see PrerequisitesInterface::storePrerequisites
+ *
*/
public function post(Request $request, string $importProvider, ImportJob $importJob = null)
{
diff --git a/app/Http/Controllers/JavascriptController.php b/app/Http/Controllers/JavascriptController.php
index 30f4a847cf..639695c320 100644
--- a/app/Http/Controllers/JavascriptController.php
+++ b/app/Http/Controllers/JavascriptController.php
@@ -109,6 +109,7 @@ class JavascriptController extends Controller
$account = $repository->findNull((int)$request->get('account'));
$currencyId = 0;
if (null !== $account) {
+ // TODO we can use getAccountCurrency() instead
$currencyId = (int)$repository->getMetaValue($account, 'currency_id');
}
/** @var TransactionCurrency $currency */
diff --git a/app/Http/Controllers/Json/AutoCompleteController.php b/app/Http/Controllers/Json/AutoCompleteController.php
index 26ee4b2b68..69f825ffc1 100644
--- a/app/Http/Controllers/Json/AutoCompleteController.php
+++ b/app/Http/Controllers/Json/AutoCompleteController.php
@@ -43,7 +43,7 @@ use Log;
*
* TODO autocomplete for transaction types.
*
- * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ *
*/
class AutoCompleteController extends Controller
{
@@ -68,6 +68,9 @@ class AutoCompleteController extends Controller
$filteredAccountTypes[] = $type;
}
}
+ if (0 === count($filteredAccountTypes)) {
+ $filteredAccountTypes = $allowedAccountTypes;
+ }
Log::debug(sprintf('Now in accounts("%s"). Filtering results.', $search), $filteredAccountTypes);
$return = [];
@@ -211,7 +214,7 @@ class AutoCompleteController extends Controller
$array = array_merge($array, $limited->toArray());
foreach ($array as $index => $item) {
// give another key for consistency
- $array[$index]['name'] = sprintf('#%d: %s', $item['id'], $item['description']);
+ $array[$index]['name'] = sprintf('#%d: %s', $item['transaction_group_id'], $item['description']);
}
diff --git a/app/Http/Controllers/Json/BoxController.php b/app/Http/Controllers/Json/BoxController.php
index ebdd02e6e3..137a3ae21a 100644
--- a/app/Http/Controllers/Json/BoxController.php
+++ b/app/Http/Controllers/Json/BoxController.php
@@ -52,8 +52,6 @@ class BoxController extends Controller
* @param BudgetRepositoryInterface $repository
*
* @return JsonResponse
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
- * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*/
public function available(BudgetRepositoryInterface $repository): JsonResponse
{
@@ -110,8 +108,6 @@ class BoxController extends Controller
* @param CurrencyRepositoryInterface $repository
*
* @return JsonResponse
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
- * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*/
public function balance(CurrencyRepositoryInterface $repository): JsonResponse
{
@@ -237,8 +233,6 @@ class BoxController extends Controller
* Total user net worth.
*
* @return JsonResponse
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
- * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*/
public function netWorth(): JsonResponse
{
diff --git a/app/Http/Controllers/Json/ExchangeController.php b/app/Http/Controllers/Json/ExchangeController.php
index 19a65f37d8..b5aca1ae53 100644
--- a/app/Http/Controllers/Json/ExchangeController.php
+++ b/app/Http/Controllers/Json/ExchangeController.php
@@ -37,7 +37,7 @@ use Log;
*/
class ExchangeController extends Controller
{
- /** @noinspection MoreThanThreeArgumentsInspection */
+
/**
* Returns an exchange rate.
*
diff --git a/app/Http/Controllers/Json/RecurrenceController.php b/app/Http/Controllers/Json/RecurrenceController.php
index 77ef359ae4..ab89502040 100644
--- a/app/Http/Controllers/Json/RecurrenceController.php
+++ b/app/Http/Controllers/Json/RecurrenceController.php
@@ -63,11 +63,9 @@ class RecurrenceController extends Controller
*
* @param Request $request
*
- * @throws FireflyException
* @return JsonResponse
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
- * @SuppressWarnings(PHPMD.NPathComplexity)
- * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ *
+ * @throws FireflyException
*/
public function events(Request $request): JsonResponse
{
diff --git a/app/Http/Controllers/Json/RuleController.php b/app/Http/Controllers/Json/RuleController.php
index 1b6ebdd80b..dd7a2f8245 100644
--- a/app/Http/Controllers/Json/RuleController.php
+++ b/app/Http/Controllers/Json/RuleController.php
@@ -1,4 +1,5 @@
json(['html' => $view]);
}
-}
\ No newline at end of file
+}
diff --git a/app/Http/Controllers/PiggyBankController.php b/app/Http/Controllers/PiggyBankController.php
index 4f51a874d9..5d4aab08b6 100644
--- a/app/Http/Controllers/PiggyBankController.php
+++ b/app/Http/Controllers/PiggyBankController.php
@@ -41,8 +41,8 @@ use Symfony\Component\HttpFoundation\ParameterBag;
/**
* Class PiggyBankController.
*
- * @SuppressWarnings(PHPMD.TooManyPublicMethods)
- * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ *
+ *
*/
class PiggyBankController extends Controller
{
@@ -94,6 +94,7 @@ class PiggyBankController extends Controller
// get currency:
$currency = app('amount')->getDefaultCurrency();
+ // TODO we can use getAccountCurrency() instead
$currencyId = (int)$this->accountRepos->getMetaValue($piggyBank->account, 'currency_id');
if ($currencyId > 0) {
$currency = $this->currencyRepos->findNull($currencyId);
@@ -120,6 +121,7 @@ class PiggyBankController extends Controller
// get currency:
$currency = app('amount')->getDefaultCurrency();
+ // TODO we can use getAccountCurrency() instead
$currencyId = (int)$this->accountRepos->getMetaValue($piggyBank->account, 'currency_id');
if ($currencyId > 0) {
$currency = $this->currencyRepos->findNull($currencyId);
@@ -186,8 +188,6 @@ class PiggyBankController extends Controller
* @param PiggyBank $piggyBank
*
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
- *
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
*/
public function edit(PiggyBank $piggyBank)
{
@@ -228,8 +228,6 @@ class PiggyBankController extends Controller
* @param Request $request
*
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
- *
- * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*/
public function index(Request $request)
{
@@ -298,6 +296,7 @@ class PiggyBankController extends Controller
{
$amount = $request->get('amount') ?? '0';
$currency = app('amount')->getDefaultCurrency();
+ // TODO we can use getAccountCurrency() instead
$currencyId = (int)$this->accountRepos->getMetaValue($piggyBank->account, 'currency_id');
if ($currencyId > 0) {
$currency = $this->currencyRepos->findNull($currencyId);
@@ -340,6 +339,7 @@ class PiggyBankController extends Controller
{
$amount = $request->get('amount') ?? '0';
$currency = app('amount')->getDefaultCurrency();
+ // TODO we can use getAccountCurrency() instead
$currencyId = (int)$this->accountRepos->getMetaValue($piggyBank->account, 'currency_id');
if ($currencyId > 0) {
$currency = $this->currencyRepos->findNull($currencyId);
@@ -383,6 +383,7 @@ class PiggyBankController extends Controller
$repetition = $this->piggyRepos->getRepetition($piggyBank);
// get currency:
$currency = app('amount')->getDefaultCurrency();
+ // TODO we can use getAccountCurrency() instead
$currencyId = (int)$this->accountRepos->getMetaValue($piggyBank->account, 'currency_id');
if ($currencyId > 0) {
$currency = $this->currencyRepos->findNull($currencyId);
@@ -403,6 +404,7 @@ class PiggyBankController extends Controller
$repetition = $this->piggyRepos->getRepetition($piggyBank);
// get currency:
$currency = app('amount')->getDefaultCurrency();
+ // TODO we can use getAccountCurrency() instead
$currencyId = (int)$this->accountRepos->getMetaValue($piggyBank->account, 'currency_id');
if ($currencyId > 0) {
$currency = $this->currencyRepos->findNull($currencyId);
diff --git a/app/Http/Controllers/Popup/ReportController.php b/app/Http/Controllers/Popup/ReportController.php
index 25dfe38cb4..22b5c32f40 100644
--- a/app/Http/Controllers/Popup/ReportController.php
+++ b/app/Http/Controllers/Popup/ReportController.php
@@ -31,7 +31,7 @@ use Illuminate\Http\Request;
/**
* Class ReportController.
*
- * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ *
*/
class ReportController extends Controller
{
@@ -43,7 +43,7 @@ class ReportController extends Controller
* @param Request $request
*
* @return JsonResponse
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
+ *
*/
public function general(Request $request): JsonResponse
{
@@ -69,9 +69,6 @@ class ReportController extends Controller
case 'category-entry':
$html = $this->categoryEntry($attributes);
break;
- case 'balance-amount':
- $html = $this->balanceAmount($attributes);
- break;
}
return response()->json(['html' => $html]);
diff --git a/app/Http/Controllers/PreferencesController.php b/app/Http/Controllers/PreferencesController.php
index eddb76fb25..7885276fb2 100644
--- a/app/Http/Controllers/PreferencesController.php
+++ b/app/Http/Controllers/PreferencesController.php
@@ -100,8 +100,6 @@ class PreferencesController extends Controller
*
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
- * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*/
public function postIndex(Request $request)
{
diff --git a/app/Http/Controllers/ProfileController.php b/app/Http/Controllers/ProfileController.php
index 5a37aed511..37e161cd58 100644
--- a/app/Http/Controllers/ProfileController.php
+++ b/app/Http/Controllers/ProfileController.php
@@ -51,8 +51,8 @@ use PragmaRX\Recovery\Recovery;
* Class ProfileController.
*
* @method Guard guard()
- * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
- * @SuppressWarnings(PHPMD.TooManyPublicMethods)
+ *
+ *
*/
class ProfileController extends Controller
{
@@ -438,8 +438,6 @@ class ProfileController extends Controller
* @param TokenFormRequest $request
*
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
- *
- * @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function postCode(TokenFormRequest $request)
{
@@ -524,8 +522,6 @@ class ProfileController extends Controller
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*
* @throws FireflyException
- *
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
*/
public function undoEmailChange(UserRepositoryInterface $repository, string $token, string $hash)
{
diff --git a/app/Http/Controllers/Recurring/EditController.php b/app/Http/Controllers/Recurring/EditController.php
index e99b900814..e158cdd51c 100644
--- a/app/Http/Controllers/Recurring/EditController.php
+++ b/app/Http/Controllers/Recurring/EditController.php
@@ -77,8 +77,6 @@ class EditController extends Controller
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
* @throws \FireflyIII\Exceptions\FireflyException
*
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
- * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*/
public function edit(Request $request, Recurrence $recurrence)
{
diff --git a/app/Http/Controllers/Recurring/IndexController.php b/app/Http/Controllers/Recurring/IndexController.php
index b5c7af9859..c3acc0336b 100644
--- a/app/Http/Controllers/Recurring/IndexController.php
+++ b/app/Http/Controllers/Recurring/IndexController.php
@@ -74,7 +74,7 @@ class IndexController extends Controller
*
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
* @throws \FireflyIII\Exceptions\FireflyException
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
+ *
*/
public function index(Request $request)
{
diff --git a/app/Http/Controllers/Report/BalanceController.php b/app/Http/Controllers/Report/BalanceController.php
index 0993cf4541..269cf73685 100644
--- a/app/Http/Controllers/Report/BalanceController.php
+++ b/app/Http/Controllers/Report/BalanceController.php
@@ -47,7 +47,6 @@ class BalanceController extends Controller
*/
public function general(Collection $accounts, Carbon $start, Carbon $end)
{
-
// chart properties for cache:
$cache = new CacheProperties;
$cache->addProperty($start);
@@ -58,9 +57,10 @@ class BalanceController extends Controller
return $cache->get(); // @codeCoverageIgnore
}
$helper = app(BalanceReportHelperInterface::class);
- $balance = $helper->getBalanceReport($accounts, $start, $end);
+ $report = $helper->getBalanceReport($accounts, $start, $end);
+ // TODO no budget.
try {
- $result = view('reports.partials.balance', compact('balance'))->render();
+ $result = view('reports.partials.balance', compact('report'))->render();
// @codeCoverageIgnoreStart
} catch (Throwable $e) {
Log::debug(sprintf('Could not render reports.partials.balance: %s', $e->getMessage()));
diff --git a/app/Http/Controllers/Report/BillController.php b/app/Http/Controllers/Report/BillController.php
new file mode 100644
index 0000000000..939b35f447
--- /dev/null
+++ b/app/Http/Controllers/Report/BillController.php
@@ -0,0 +1,74 @@
+.
+ */
+
+namespace FireflyIII\Http\Controllers\Report;
+
+
+use Carbon\Carbon;
+use FireflyIII\Helpers\Report\ReportHelperInterface;
+use FireflyIII\Http\Controllers\Controller;
+use FireflyIII\Support\CacheProperties;
+use Illuminate\Support\Collection;
+use Log;
+use Throwable;
+
+/**
+ * Class BillController
+ */
+class BillController extends Controller
+{
+ /**
+ * @param Collection $accounts
+ * @param Carbon $start
+ * @param Carbon $end
+ */
+ public function overview(Collection $accounts, Carbon $start, Carbon $end)
+ { // chart properties for cache:
+ $cache = new CacheProperties;
+ $cache->addProperty($start);
+ $cache->addProperty($end);
+ $cache->addProperty('bill-report');
+ $cache->addProperty($accounts->pluck('id')->toArray());
+ if ($cache->has()) {
+ return $cache->get(); // @codeCoverageIgnore
+ }
+
+
+ /** @var ReportHelperInterface $helper */
+ $helper = app(ReportHelperInterface::class);
+ $report = $helper->getBillReport($accounts, $start, $end);
+
+
+ try {
+ $result = view('reports.partials.bills', compact('report'))->render();
+ // @codeCoverageIgnoreStart
+ } catch (Throwable $e) {
+ Log::debug(sprintf('Could not render reports.partials.budgets: %s', $e->getMessage()));
+ $result = 'Could not render view.';
+ }
+ // @codeCoverageIgnoreEnd
+ $cache->store($result);
+
+ return $result;
+
+ }
+}
diff --git a/app/Http/Controllers/Report/CategoryController.php b/app/Http/Controllers/Report/CategoryController.php
index b8bc618745..d018f5f3c6 100644
--- a/app/Http/Controllers/Report/CategoryController.php
+++ b/app/Http/Controllers/Report/CategoryController.php
@@ -154,7 +154,6 @@ class CategoryController extends Controller
*
* @return mixed|string
*
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
*/
public function operations(Collection $accounts, Carbon $start, Carbon $end)
{
@@ -171,20 +170,61 @@ class CategoryController extends Controller
/** @var CategoryRepositoryInterface $repository */
$repository = app(CategoryRepositoryInterface::class);
$categories = $repository->getCategories();
- $report = [];
+ $report = [
+ 'categories' => [],
+ 'sums' => [],
+ ];
/** @var Category $category */
foreach ($categories as $category) {
- $spent = $repository->spentInPeriod(new Collection([$category]), $accounts, $start, $end);
- $earned = $repository->earnedInPeriod(new Collection([$category]), $accounts, $start, $end);
- if (0 !== bccomp($spent, '0') || 0 !== bccomp($earned, '0')) {
- $report[$category->id] = ['name' => $category->name, 'spent' => $spent, 'earned' => $earned, 'id' => $category->id];
+ $spent = $repository->spentInPeriod($category, $accounts, $start, $end);
+ $earned = $repository->earnedInPeriod($category, $accounts, $start, $end);
+ if (0 === count($spent) && 0 === count($earned)) {
+ continue;
+ }
+ $currencies = array_unique(array_merge(array_keys($spent), array_keys($earned)));
+ foreach ($currencies as $code) {
+ $currencyInfo = $spent[$code] ?? $earned[$code];
+ $key = sprintf('%s-%s', $category->id, $code);
+ $report['categories'][$key] = [
+ 'name' => $category->name,
+ 'spent' => $spent[$code]['spent'] ?? '0',
+ 'earned' => $earned[$code]['earned'] ?? '0',
+ 'id' => $category->id,
+ 'currency_id' => $currencyInfo['currency_id'],
+ 'currency_code' => $currencyInfo['currency_code'],
+ 'currency_symbol' => $currencyInfo['currency_symbol'],
+ 'currency_name' => $currencyInfo['currency_name'],
+ 'currency_decimal_places' => $currencyInfo['currency_decimal_places'],
+ ];
+
}
}
$sum = [];
- foreach ($report as $categoryId => $row) {
+ /**
+ * @var string $categoryId
+ * @var array $row
+ */
+ foreach ($report['categories'] as $categoryId => $row) {
$sum[$categoryId] = (float)$row['spent'];
}
- array_multisort($sum, SORT_ASC, $report);
+ array_multisort($sum, SORT_ASC, $report['categories']);
+
+ // get sums:
+ foreach ($report['categories'] as $entry) {
+ $currencyId = $entry['currency_id'];
+ $report['sums'][$currencyId] = $report['sums'][$currencyId] ?? [
+ 'spent' => '0',
+ 'earned' => '0',
+ 'currency_id' => $entry['currency_id'],
+ 'currency_code' => $entry['currency_code'],
+ 'currency_symbol' => $entry['currency_symbol'],
+ 'currency_name' => $entry['currency_name'],
+ 'cyrrency_decimal_places' => $entry['currency_decimal_places'],
+ ];
+ $report['sums'][$currencyId]['spent'] = bcadd($report['sums'][$currencyId]['spent'], $entry['spent']);
+ $report['sums'][$currencyId]['earned'] = bcadd($report['sums'][$currencyId]['earned'], $entry['earned']);
+ }
+
// @codeCoverageIgnoreStart
try {
$result = view('reports.partials.categories', compact('report'))->render();
@@ -199,5 +239,19 @@ class CategoryController extends Controller
return $result;
}
+ /**
+ * @param array $array
+ *
+ * @return bool
+ */
+ private function noAmountInArray(array $array): bool
+ {
+ if (0 === count($array)) {
+ return true;
+ }
+
+ return false;
+ }
+
}
diff --git a/app/Http/Controllers/Report/ExpenseController.php b/app/Http/Controllers/Report/ExpenseController.php
index ef8e3d4d2a..2e50b1befe 100644
--- a/app/Http/Controllers/Report/ExpenseController.php
+++ b/app/Http/Controllers/Report/ExpenseController.php
@@ -36,7 +36,6 @@ use Throwable;
/**
* Class ExpenseController
*
- * @SuppressWarnings(PHPMD.ExcessiveClassComplexity)
*/
class ExpenseController extends Controller
{
@@ -64,7 +63,7 @@ class ExpenseController extends Controller
}
- /** @noinspection MoreThanThreeArgumentsInspection */
+
/**
* Generates the overview per budget.
*
@@ -74,7 +73,6 @@ class ExpenseController extends Controller
* @param Carbon $end
*
* @return string
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
*/
public function budget(Collection $accounts, Collection $expense, Carbon $start, Carbon $end): string
{
@@ -119,7 +117,7 @@ class ExpenseController extends Controller
}
- /** @noinspection MoreThanThreeArgumentsInspection */
+
/**
* Generates the overview per category (spent and earned).
*
@@ -129,8 +127,6 @@ class ExpenseController extends Controller
* @param Carbon $end
*
* @return string
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
- * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*/
public function category(Collection $accounts, Collection $expense, Carbon $start, Carbon $end): string
{
@@ -183,7 +179,7 @@ class ExpenseController extends Controller
return $result;
}
- /** @noinspection MoreThanThreeArgumentsInspection */
+
/**
* Overview of spending.
*
@@ -236,7 +232,7 @@ class ExpenseController extends Controller
// for period, get spent and earned for each account (by name)
}
- /** @noinspection MoreThanThreeArgumentsInspection */
+
/**
* List of top expenses.
*
@@ -257,7 +253,7 @@ class ExpenseController extends Controller
$cache->addProperty($accounts->pluck('id')->toArray());
$cache->addProperty($expense->pluck('id')->toArray());
if ($cache->has()) {
- //return $cache->get(); // @codeCoverageIgnore
+ return $cache->get(); // @codeCoverageIgnore
}
$combined = $this->combineAccounts($expense);
$all = new Collection;
@@ -288,7 +284,7 @@ class ExpenseController extends Controller
return $result;
}
- /** @noinspection MoreThanThreeArgumentsInspection */
+
/**
* List of top income.
*
@@ -309,7 +305,7 @@ class ExpenseController extends Controller
$cache->addProperty($accounts->pluck('id')->toArray());
$cache->addProperty($expense->pluck('id')->toArray());
if ($cache->has()) {
- //return $cache->get(); // @codeCoverageIgnore
+ return $cache->get(); // @codeCoverageIgnore
}
$combined = $this->combineAccounts($expense);
$all = new Collection;
diff --git a/app/Http/Controllers/Report/OperationsController.php b/app/Http/Controllers/Report/OperationsController.php
index c5bffbba86..8cafe310a3 100644
--- a/app/Http/Controllers/Report/OperationsController.php
+++ b/app/Http/Controllers/Report/OperationsController.php
@@ -78,10 +78,10 @@ class OperationsController extends Controller
if ($cache->has()) {
return $cache->get(); // @codeCoverageIgnore
}
- $entries = $this->tasker->getExpenseReport($start, $end, $accounts);
- $type = 'expense-entry';
+ $report = $this->tasker->getExpenseReport($start, $end, $accounts);
+ $type = 'expense-entry';
try {
- $result = view('reports.partials.income-expenses', compact('entries', 'type'))->render();
+ $result = view('reports.partials.income-expenses', compact('report', 'type'))->render();
// @codeCoverageIgnoreStart
} catch (Throwable $e) {
Log::debug(sprintf('Could not render reports.partials.income-expense: %s', $e->getMessage()));
@@ -113,17 +113,16 @@ class OperationsController extends Controller
if ($cache->has()) {
return $cache->get(); // @codeCoverageIgnore
}
- $entries = $this->tasker->getIncomeReport($start, $end, $accounts);
- $type = 'income-entry';
+ $report = $this->tasker->getIncomeReport($start, $end, $accounts);
+ $type = 'income-entry';
try {
- $result = view('reports.partials.income-expenses', compact('entries', 'type'))->render();
+ $result = view('reports.partials.income-expenses', compact('report', 'type'))->render();
// @codeCoverageIgnoreStart
} catch (Throwable $e) {
Log::debug(sprintf('Could not render reports.partials.income-expenses: %s', $e->getMessage()));
$result = 'Could not render view.';
}
// @codeCoverageIgnoreEnd
-
$cache->store($result);
return $result;
@@ -150,32 +149,34 @@ class OperationsController extends Controller
return $cache->get(); // @codeCoverageIgnore
}
- $incomes = $this->tasker->getIncomeReport($start, $end, $accounts);
- $expenses = $this->tasker->getExpenseReport($start, $end, $accounts);
- $incomeSum = array_sum(
- array_map(
- function ($item) {
- return $item['sum'];
- },
- $incomes
- )
- );
+ $incomes = $this->tasker->getIncomeReport($start, $end, $accounts);
+ $expenses = $this->tasker->getExpenseReport($start, $end, $accounts);
+ $sums = [];
+ $keys = array_unique(array_merge(array_keys($incomes['sums']), array_keys($expenses['sums'])));
- $expensesSum = array_sum(
- array_map(
- function ($item) {
- return $item['sum'];
- },
- $expenses
- )
- );
- try {
- $result = view('reports.partials.operations', compact('incomeSum', 'expensesSum'))->render();
- // @codeCoverageIgnoreStart
- } catch (Throwable $e) {
- Log::debug(sprintf('Could not render reports.partials.operations: %s', $e->getMessage()));
- $result = 'Could not render view.';
+ /** @var int $currencyId */
+ foreach ($keys as $currencyId) {
+ $currencyInfo = $incomes['sums'][$currencyId] ?? $expenses['sums'][$currencyId];
+ $sums[$currencyId] = $sums[$currencyId] ?? [
+ 'currency_id' => $currencyId,
+ 'currency_name' => $currencyInfo['currency_name'],
+ 'currency_code' => $currencyInfo['currency_code'],
+ 'currency_symbol' => $currencyInfo['currency_symbol'],
+ 'currency_decimal_places' => $currencyInfo['currency_decimal_places'],
+ 'in' => $incomes['sums'][$currencyId]['sum'] ?? '0',
+ 'out' => $expenses['sums'][$currencyId]['sum'] ?? '0',
+ 'sum' => '0',
+ ];
+ $sums[$currencyId]['sum'] = bcadd($sums[$currencyId]['in'], $sums[$currencyId]['out']);
}
+
+ //try {
+ $result = view('reports.partials.operations', compact('sums'))->render();
+ // @codeCoverageIgnoreStart
+// } catch (Throwable $e) {
+// Log::debug(sprintf('Could not render reports.partials.operations: %s', $e->getMessage()));
+// $result = 'Could not render view.';
+// }
// @codeCoverageIgnoreEnd
$cache->store($result);
diff --git a/app/Http/Controllers/ReportController.php b/app/Http/Controllers/ReportController.php
index ba17f478ac..9a1c9b2272 100644
--- a/app/Http/Controllers/ReportController.php
+++ b/app/Http/Controllers/ReportController.php
@@ -38,7 +38,7 @@ use Log;
/**
* Class ReportController.
*
- * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ *
*/
class ReportController extends Controller
{
@@ -69,7 +69,7 @@ class ReportController extends Controller
}
);
}
- /** @noinspection MoreThanThreeArgumentsInspection */
+
/**
* Show account report.
*
@@ -138,7 +138,7 @@ class ReportController extends Controller
return $generator->generate();
}
- /** @noinspection MoreThanThreeArgumentsInspection */
+
/**
* Show budget report.
*
@@ -176,7 +176,7 @@ class ReportController extends Controller
return $generator->generate();
}
- /** @noinspection MoreThanThreeArgumentsInspection */
+
/**
* Show category report.
*
@@ -238,8 +238,8 @@ class ReportController extends Controller
trans(
'firefly.report_default',
[
- 'start' => $start->formatLocalized($this->monthFormat),
- 'end' => $end->formatLocalized($this->monthFormat),
+ 'start' => $start->formatLocalized($this->monthAndDayFormat),
+ 'end' => $end->formatLocalized($this->monthAndDayFormat),
]
)
);
@@ -276,7 +276,7 @@ class ReportController extends Controller
* @param string $reportType
*
* @return mixed
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
+ *
*/
public function options(string $reportType)
{
@@ -310,9 +310,7 @@ class ReportController extends Controller
*
* @throws \FireflyIII\Exceptions\FireflyException
*
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
- * @SuppressWarnings(PHPMD.NPathComplexity)
- * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ *
*/
public function postIndex(ReportFormRequest $request)
{
@@ -386,7 +384,7 @@ class ReportController extends Controller
return redirect($uri);
}
- /** @noinspection MoreThanThreeArgumentsInspection */
+
/**
* Get a tag report.
*
diff --git a/app/Http/Controllers/Rule/CreateController.php b/app/Http/Controllers/Rule/CreateController.php
index af9e56b033..c513838461 100644
--- a/app/Http/Controllers/Rule/CreateController.php
+++ b/app/Http/Controllers/Rule/CreateController.php
@@ -70,8 +70,6 @@ class CreateController extends Controller
* @param RuleGroup $ruleGroup
*
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
- * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
*/
public function create(Request $request, RuleGroup $ruleGroup = null)
{
@@ -120,8 +118,6 @@ class CreateController extends Controller
* @param Bill $bill
*
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
- * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
*/
public function createFromBill(Request $request, Bill $bill)
{
@@ -168,7 +164,7 @@ class CreateController extends Controller
* @param RuleFormRequest $request
*
* @return RedirectResponse|\Illuminate\Routing\Redirector
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
+ *
*/
public function store(RuleFormRequest $request)
{
diff --git a/app/Http/Controllers/Rule/EditController.php b/app/Http/Controllers/Rule/EditController.php
index d136c175ee..4e33ddbcaa 100644
--- a/app/Http/Controllers/Rule/EditController.php
+++ b/app/Http/Controllers/Rule/EditController.php
@@ -70,8 +70,6 @@ class EditController extends Controller
* @param Rule $rule
*
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
- * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*/
public function edit(Request $request, Rule $rule)
{
diff --git a/app/Http/Controllers/Rule/IndexController.php b/app/Http/Controllers/Rule/IndexController.php
index 4593b67de6..7bba8ffa4c 100644
--- a/app/Http/Controllers/Rule/IndexController.php
+++ b/app/Http/Controllers/Rule/IndexController.php
@@ -135,7 +135,6 @@ class IndexController extends Controller
* @param Rule $rule
*
* @return RedirectResponse|\Illuminate\Routing\Redirector
- * @SuppressWarnings(PHPMD.ShortMethodName)
*/
public function up(Rule $rule)
{
diff --git a/app/Http/Controllers/Rule/SelectController.php b/app/Http/Controllers/Rule/SelectController.php
index b5a20f49b7..a37b526533 100644
--- a/app/Http/Controllers/Rule/SelectController.php
+++ b/app/Http/Controllers/Rule/SelectController.php
@@ -47,7 +47,7 @@ use Throwable;
/**
* Class SelectController.
*
- * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ *
*/
class SelectController extends Controller
{
@@ -147,8 +147,6 @@ class SelectController extends Controller
*
* @return JsonResponse
*
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
- * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*/
public function testTriggers(TestRuleFormRequest $request): JsonResponse
{
@@ -181,10 +179,10 @@ class SelectController extends Controller
// Warn the user if only a subset of transactions is returned
$warning = '';
- if ($matchingTransactions->count() === $limit) {
+ if (count($matchingTransactions) === $limit) {
$warning = (string)trans('firefly.warning_transaction_subset', ['max_num_transactions' => $limit]); // @codeCoverageIgnore
}
- if (0 === $matchingTransactions->count()) {
+ if (0 === count($matchingTransactions)) {
$warning = (string)trans('firefly.warning_no_matching_transactions', ['num_transactions' => $range]); // @codeCoverageIgnore
}
@@ -216,8 +214,6 @@ class SelectController extends Controller
*
* @return JsonResponse
*
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
- * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*/
public function testTriggersByRule(Rule $rule): JsonResponse
{
diff --git a/app/Http/Controllers/RuleGroup/CreateController.php b/app/Http/Controllers/RuleGroup/CreateController.php
index ddf41a733e..b43bff8ea8 100644
--- a/app/Http/Controllers/RuleGroup/CreateController.php
+++ b/app/Http/Controllers/RuleGroup/CreateController.php
@@ -1,4 +1,5 @@
getPreviousUri('rule-groups.delete.uri'));
}
-}
\ No newline at end of file
+}
diff --git a/app/Http/Controllers/RuleGroup/EditController.php b/app/Http/Controllers/RuleGroup/EditController.php
index e6ab8aacf7..aa80339d50 100644
--- a/app/Http/Controllers/RuleGroup/EditController.php
+++ b/app/Http/Controllers/RuleGroup/EditController.php
@@ -1,4 +1,5 @@
isEditableGroup($group)) {
+ return $this->redirectGroupToAccount($group); // @codeCoverageIgnore
+ }
+
/** @var TransactionGroupTransformer $transformer */
$transformer = app(TransactionGroupTransformer::class);
/** @var TransactionJournal $first */
$first = $group->transactionJournals()->first();
$sourceType = $first->transactionType;
- // return to account.
- if (!in_array($sourceType->type, [TransactionType::WITHDRAWAL, TransactionType::TRANSFER, TransactionType::DEPOSIT], true)) {
- return $this->redirectToAccount($first); // @codeCoverageIgnore
- }
$groupTitle = $group->title ?? $first->description;
$groupArray = $transformer->transformObject($group);
@@ -144,6 +145,10 @@ class ConvertController extends Controller
*/
public function postIndex(Request $request, TransactionType $destinationType, TransactionGroup $group)
{
+ if (!$this->isEditableGroup($group)) {
+ return $this->redirectGroupToAccount($group); // @codeCoverageIgnore
+ }
+
/** @var TransactionJournal $journal */
foreach ($group->transactionJournals as $journal) {
// catch FF exception.
diff --git a/app/Http/Controllers/Transaction/CreateController.php b/app/Http/Controllers/Transaction/CreateController.php
index c91a82d9d8..5b5e5681dc 100644
--- a/app/Http/Controllers/Transaction/CreateController.php
+++ b/app/Http/Controllers/Transaction/CreateController.php
@@ -88,4 +88,4 @@ class CreateController extends Controller
)
);
}
-}
\ No newline at end of file
+}
diff --git a/app/Http/Controllers/Transaction/DeleteController.php b/app/Http/Controllers/Transaction/DeleteController.php
index 4a926364ef..205575e229 100644
--- a/app/Http/Controllers/Transaction/DeleteController.php
+++ b/app/Http/Controllers/Transaction/DeleteController.php
@@ -1,4 +1,5 @@
isEditableGroup($group)) {
+ return $this->redirectGroupToAccount($group); // @codeCoverageIgnore
+ }
+
Log::debug(sprintf('Start of delete view for group #%d', $group->id));
$journal = $group->transactionJournals->first();
@@ -94,6 +101,10 @@ class DeleteController extends Controller
*/
public function destroy(TransactionGroup $group): RedirectResponse
{
+ if (!$this->isEditableGroup($group)) {
+ return $this->redirectGroupToAccount($group); // @codeCoverageIgnore
+ }
+
$journal = $group->transactionJournals->first();
if (null === $journal) {
throw new NotFoundHttpException;
@@ -109,4 +120,4 @@ class DeleteController extends Controller
}
-}
\ No newline at end of file
+}
diff --git a/app/Http/Controllers/Transaction/EditController.php b/app/Http/Controllers/Transaction/EditController.php
index a31c35409e..0528ae51d7 100644
--- a/app/Http/Controllers/Transaction/EditController.php
+++ b/app/Http/Controllers/Transaction/EditController.php
@@ -1,4 +1,5 @@
isEditableGroup($transactionGroup)) {
+ return $this->redirectGroupToAccount($transactionGroup); // @codeCoverageIgnore
+ }
+
/** @var AccountRepositoryInterface $repository */
$repository = app(AccountRepositoryInterface::class);
$allowedOpposingTypes = config('firefly.allowed_opposing_types');
@@ -77,4 +83,4 @@ class EditController extends Controller
return view('transactions.edit', compact('cash', 'transactionGroup', 'allowedOpposingTypes', 'accountToTypes', 'defaultCurrency', 'previousUri'));
}
-}
\ No newline at end of file
+}
diff --git a/app/Http/Controllers/Transaction/IndexController.php b/app/Http/Controllers/Transaction/IndexController.php
index 466ba01f71..251d01d124 100644
--- a/app/Http/Controllers/Transaction/IndexController.php
+++ b/app/Http/Controllers/Transaction/IndexController.php
@@ -153,4 +153,4 @@ class IndexController extends Controller
return view('transactions.index', compact('subTitle', 'objectType', 'subTitleIcon', 'groups', 'start', 'end'));
}
-}
\ No newline at end of file
+}
diff --git a/app/Http/Controllers/Transaction/MassController.php b/app/Http/Controllers/Transaction/MassController.php
index 219fd48c1f..7fb91b005e 100644
--- a/app/Http/Controllers/Transaction/MassController.php
+++ b/app/Http/Controllers/Transaction/MassController.php
@@ -42,7 +42,7 @@ use Log;
/**
* Class MassController.
*
- * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ *
*/
class MassController extends Controller
{
@@ -90,7 +90,7 @@ class MassController extends Controller
* @param MassDeleteJournalRequest $request
*
* @return mixed
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
+ *
*/
public function destroy(MassDeleteJournalRequest $request)
{
diff --git a/app/Http/Controllers/Transaction/ShowController.php b/app/Http/Controllers/Transaction/ShowController.php
index 80b9240914..82f00f9987 100644
--- a/app/Http/Controllers/Transaction/ShowController.php
+++ b/app/Http/Controllers/Transaction/ShowController.php
@@ -128,4 +128,4 @@ class ShowController extends Controller
return $amounts;
}
-}
\ No newline at end of file
+}
diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php
index 9aa1c5a706..d22cdd797f 100644
--- a/app/Http/Kernel.php
+++ b/app/Http/Kernel.php
@@ -180,7 +180,8 @@ class Kernel extends HttpKernel
CreateFreshApiToken::class,
],
- 'api' => [
+ 'apiX' => [
+ 'auth:api',
'throttle:60,1',
'bindings',
],
diff --git a/app/Http/Middleware/Authenticate.php b/app/Http/Middleware/Authenticate.php
index 2c68878759..ec0cfe3d76 100644
--- a/app/Http/Middleware/Authenticate.php
+++ b/app/Http/Middleware/Authenticate.php
@@ -83,8 +83,6 @@ class Authenticate
* @return mixed
* @throws AuthenticationException
* @throws FireflyException
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
- * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*/
protected function authenticate($request, array $guards)
{
diff --git a/app/Http/Middleware/Installer.php b/app/Http/Middleware/Installer.php
index 732289eaa8..808ff6ccc9 100644
--- a/app/Http/Middleware/Installer.php
+++ b/app/Http/Middleware/Installer.php
@@ -41,15 +41,13 @@ class Installer
/**
* Handle an incoming request.
*
- * @throws FireflyException
- *
* @param \Illuminate\Http\Request $request
* @param \Closure $next
*
* @return mixed
*
- * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
+ *
+ * @throws FireflyException
*
*/
public function handle($request, Closure $next)
diff --git a/app/Http/Middleware/InterestingMessage.php b/app/Http/Middleware/InterestingMessage.php
index 6f7f97ee14..0a3a854671 100644
--- a/app/Http/Middleware/InterestingMessage.php
+++ b/app/Http/Middleware/InterestingMessage.php
@@ -1,4 +1,5 @@
check();
}
-}
\ No newline at end of file
+}
diff --git a/app/Http/Middleware/Range.php b/app/Http/Middleware/Range.php
index b8c4bed70d..73d2f7e1a4 100644
--- a/app/Http/Middleware/Range.php
+++ b/app/Http/Middleware/Range.php
@@ -118,8 +118,6 @@ class Range
/**
* Set the range for the current view.
- *
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
*/
private function setRange(): void
{
diff --git a/app/Http/Requests/RecurrenceFormRequest.php b/app/Http/Requests/RecurrenceFormRequest.php
index 5863128db3..ae903cf4e1 100644
--- a/app/Http/Requests/RecurrenceFormRequest.php
+++ b/app/Http/Requests/RecurrenceFormRequest.php
@@ -56,8 +56,6 @@ class RecurrenceFormRequest extends Request
* @return array
* @throws FireflyException
*
- * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
*/
public function getAll(): array
{
@@ -225,9 +223,7 @@ class RecurrenceFormRequest extends Request
* @return array
* @throws FireflyException
*
- * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
- * @SuppressWarnings(PHPMD.NPathComplexity)
+ *
*/
public function rules(): array
{
@@ -318,8 +314,6 @@ class RecurrenceFormRequest extends Request
* Parses repetition data.
*
* @return array
- *
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
*/
private function parseRepetitionData(): array
{
diff --git a/app/Http/Requests/Request.php b/app/Http/Requests/Request.php
index d531c6f7a1..27887cc05b 100644
--- a/app/Http/Requests/Request.php
+++ b/app/Http/Requests/Request.php
@@ -33,7 +33,7 @@ use Log;
*
* @codeCoverageIgnore
*
- * @SuppressWarnings(PHPMD.NumberOfChildren)
+ *
*/
class Request extends FormRequest
{
@@ -183,8 +183,6 @@ class Request extends FormRequest
* @param string $field
*
* @return string
- *
- * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*/
public function string(string $field): string
{
diff --git a/app/Http/Requests/RuleFormRequest.php b/app/Http/Requests/RuleFormRequest.php
index da90a90ba9..a8c5903c3f 100644
--- a/app/Http/Requests/RuleFormRequest.php
+++ b/app/Http/Requests/RuleFormRequest.php
@@ -45,8 +45,6 @@ class RuleFormRequest extends Request
*
* @return array
*
- * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
*/
public function getRuleData(): array
{
diff --git a/app/Import/Converter/Amount.php b/app/Import/Converter/Amount.php
index 637867f32d..c87fa7cd95 100644
--- a/app/Import/Converter/Amount.php
+++ b/app/Import/Converter/Amount.php
@@ -33,9 +33,9 @@ class Amount implements ConverterInterface
* Some people, when confronted with a problem, think "I know, I'll use regular expressions." Now they have two problems.
* - Jamie Zawinski.
*
- * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
- * @SuppressWarnings(PHPMD.NPathComplexity)
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
+ *
+ *
+ *
* @param $value
*
* @return string
diff --git a/app/Import/JobConfiguration/FakeJobConfiguration.php b/app/Import/JobConfiguration/FakeJobConfiguration.php
index b762b5397c..a515270a03 100644
--- a/app/Import/JobConfiguration/FakeJobConfiguration.php
+++ b/app/Import/JobConfiguration/FakeJobConfiguration.php
@@ -46,7 +46,7 @@ class FakeJobConfiguration implements JobConfigurationInterface
* if stage is not "new", then album must be 'station to station'
*
* @return bool
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
+ *
*/
public function configurationComplete(): bool
{
@@ -70,7 +70,7 @@ class FakeJobConfiguration implements JobConfigurationInterface
*
* @return MessageBag
*
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
+ *
*/
public function configureJob(array $data): MessageBag
{
@@ -128,7 +128,7 @@ class FakeJobConfiguration implements JobConfigurationInterface
*
* @return string
*
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
+ *
*/
public function getNextView(): string
{
diff --git a/app/Import/JobConfiguration/FileJobConfiguration.php b/app/Import/JobConfiguration/FileJobConfiguration.php
index b41e8e3156..9eb1aa4f75 100644
--- a/app/Import/JobConfiguration/FileJobConfiguration.php
+++ b/app/Import/JobConfiguration/FileJobConfiguration.php
@@ -89,10 +89,10 @@ class FileJobConfiguration implements JobConfigurationInterface
/**
* Returns the view of the next step in the job configuration.
*
- * @throws FireflyException
* @return string
*
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
+ *
+ *@throws FireflyException
*/
public function getNextView(): string
{
@@ -132,7 +132,7 @@ class FileJobConfiguration implements JobConfigurationInterface
* @return FileConfigurationInterface
* @throws FireflyException
*
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
+ *
*/
private function getConfigurationObject(): FileConfigurationInterface
{
diff --git a/app/Import/JobConfiguration/SpectreJobConfiguration.php b/app/Import/JobConfiguration/SpectreJobConfiguration.php
index fde970cd58..7f9bf1dea3 100644
--- a/app/Import/JobConfiguration/SpectreJobConfiguration.php
+++ b/app/Import/JobConfiguration/SpectreJobConfiguration.php
@@ -111,7 +111,7 @@ class SpectreJobConfiguration implements JobConfigurationInterface
* @return SpectreJobConfigurationInterface
* @throws FireflyException
*
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
+ *
*/
private function getHandler(): SpectreJobConfigurationInterface
{
diff --git a/app/Import/JobConfiguration/YnabJobConfiguration.php b/app/Import/JobConfiguration/YnabJobConfiguration.php
index 1fabb496c7..803867e397 100644
--- a/app/Import/JobConfiguration/YnabJobConfiguration.php
+++ b/app/Import/JobConfiguration/YnabJobConfiguration.php
@@ -109,7 +109,7 @@ class YnabJobConfiguration implements JobConfigurationInterface
* @return YnabJobConfigurationInterface
* @throws FireflyException
*
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
+ *
*/
private function getHandler(): YnabJobConfigurationInterface
{
diff --git a/app/Import/Routine/FakeRoutine.php b/app/Import/Routine/FakeRoutine.php
index 14ed949977..e271a4b1d2 100644
--- a/app/Import/Routine/FakeRoutine.php
+++ b/app/Import/Routine/FakeRoutine.php
@@ -52,8 +52,8 @@ class FakeRoutine implements RoutineInterface
* @return void
* @throws FireflyException
*
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
- * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ *
+ *
*/
public function run(): void
{
diff --git a/app/Import/Routine/SpectreRoutine.php b/app/Import/Routine/SpectreRoutine.php
index 2805142ebd..1171ff5e5e 100644
--- a/app/Import/Routine/SpectreRoutine.php
+++ b/app/Import/Routine/SpectreRoutine.php
@@ -49,8 +49,8 @@ class SpectreRoutine implements RoutineInterface
*
* @throws FireflyException
*
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
- * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ *
+ *
*/
public function run(): void
{
diff --git a/app/Import/Specifics/AbnAmroDescription.php b/app/Import/Specifics/AbnAmroDescription.php
index 7f373d897d..68b1b1e318 100644
--- a/app/Import/Specifics/AbnAmroDescription.php
+++ b/app/Import/Specifics/AbnAmroDescription.php
@@ -64,7 +64,7 @@ class AbnAmroDescription implements SpecificInterface
*
* @return array
*
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
+ *
*/
public function run(array $row): array
{
@@ -132,8 +132,8 @@ class AbnAmroDescription implements SpecificInterface
*
* @return bool true if the description is SEPA format, false otherwise
*
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
- * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ *
+ *
*/
protected function parseSepaDescription(): bool
{
@@ -189,8 +189,8 @@ class AbnAmroDescription implements SpecificInterface
*
* @return bool true if the description is TRTP format, false otherwise
*
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
- * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ *
+ *
*/
protected function parseTRTPDescription(): bool
{
diff --git a/app/Import/Specifics/Belfius.php b/app/Import/Specifics/Belfius.php
index 714cfb9848..1a57f03bdd 100644
--- a/app/Import/Specifics/Belfius.php
+++ b/app/Import/Specifics/Belfius.php
@@ -61,7 +61,7 @@ class Belfius implements SpecificInterface
*
* @return array
*
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
+ *
*/
public function run(array $row): array
{
diff --git a/app/Import/Specifics/IngBelgium.php b/app/Import/Specifics/IngBelgium.php
index b77e811696..c284e33518 100644
--- a/app/Import/Specifics/IngBelgium.php
+++ b/app/Import/Specifics/IngBelgium.php
@@ -59,7 +59,7 @@ class IngBelgium implements SpecificInterface
*
* @return array
*
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
+ *
*/
public function run(array $row): array
{
diff --git a/app/Import/Specifics/IngDescription.php b/app/Import/Specifics/IngDescription.php
index 74d142d8d3..122437ba89 100644
--- a/app/Import/Specifics/IngDescription.php
+++ b/app/Import/Specifics/IngDescription.php
@@ -66,7 +66,7 @@ class IngDescription implements SpecificInterface
*
* @return array
*
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
+ *
*/
public function run(array $row): array
{
diff --git a/app/Import/Specifics/RabobankDescription.php b/app/Import/Specifics/RabobankDescription.php
index 7dea7e493a..6ef8a99560 100644
--- a/app/Import/Specifics/RabobankDescription.php
+++ b/app/Import/Specifics/RabobankDescription.php
@@ -59,7 +59,7 @@ class RabobankDescription implements SpecificInterface
*
* @return array
*
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
+ *
*/
public function run(array $row): array
{
diff --git a/app/Import/Storage/ImportArrayStorage.php b/app/Import/Storage/ImportArrayStorage.php
index b10c3a9f92..9ca1c863af 100644
--- a/app/Import/Storage/ImportArrayStorage.php
+++ b/app/Import/Storage/ImportArrayStorage.php
@@ -51,7 +51,7 @@ use Log;
*
* Class ImportArrayStorage
*
- * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ *
*/
class ImportArrayStorage
{
@@ -201,8 +201,8 @@ class ImportArrayStorage
* @return Collection
* @throws FireflyException
*
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
- * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ *
+ *
*/
private function storeGroupArray(): Collection
{
@@ -388,9 +388,9 @@ class ImportArrayStorage
*
* @return bool
*
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
- * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
- * @SuppressWarnings(PHPMD.NPathComplexity)
+ *
+ *
+ *
*/
private function transferExists(array $transaction): bool
{
diff --git a/app/Jobs/CreateRecurringTransactions.php b/app/Jobs/CreateRecurringTransactions.php
index e77c04ee40..cb8dc4f88e 100644
--- a/app/Jobs/CreateRecurringTransactions.php
+++ b/app/Jobs/CreateRecurringTransactions.php
@@ -67,7 +67,7 @@ use Log;
/**
* Class CreateRecurringTransactions.
- * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ *
*
*/
class CreateRecurringTransactions implements ShouldQueue
@@ -97,6 +97,7 @@ class CreateRecurringTransactions implements ShouldQueue
*/
public function setDate(Carbon $date): void
{
+ $date->startOfDay();
$this->date = $date;
}
@@ -227,7 +228,7 @@ class CreateRecurringTransactions implements ShouldQueue
* @param Carbon $date
*
* @return array
- * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ *
*/
private function getTransactionData(Recurrence $recurrence, Carbon $date): array
{
@@ -301,8 +302,9 @@ class CreateRecurringTransactions implements ShouldQueue
private function handleOccurrence(Recurrence $recurrence, Carbon $date): ?TransactionGroup
{
Log::debug(sprintf('Now at date %s.', $date->format('Y-m-d')));
+ $date->startOfDay();
if ($date->ne($this->date)) {
- Log::debug(sprintf('%s is not not today (%s)', $date->format('Y-m-d'), $this->date->format('Y-m-d')));
+ Log::debug(sprintf('%s is not today (%s)', $date->format('Y-m-d'), $this->date->format('Y-m-d')));
return null;
}
@@ -439,8 +441,8 @@ class CreateRecurringTransactions implements ShouldQueue
* @param Recurrence $recurrence
*
* @return bool
- * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
+ *
+ *
*/
private function validRecurrence(Recurrence $recurrence): bool
{
diff --git a/app/Mail/AccessTokenCreatedMail.php b/app/Mail/AccessTokenCreatedMail.php
index 65d702602e..9080d7503a 100644
--- a/app/Mail/AccessTokenCreatedMail.php
+++ b/app/Mail/AccessTokenCreatedMail.php
@@ -30,6 +30,7 @@ use Illuminate\Queue\SerializesModels;
/**
* Class AccessTokenCreatedMail
+ *
* @codeCoverageIgnore
*/
class AccessTokenCreatedMail extends Mailable
diff --git a/app/Mail/AdminTestMail.php b/app/Mail/AdminTestMail.php
index 17e24ed50f..f132d0837c 100644
--- a/app/Mail/AdminTestMail.php
+++ b/app/Mail/AdminTestMail.php
@@ -30,6 +30,7 @@ use Illuminate\Queue\SerializesModels;
* Class AdminTestMail.
*
* Sends a test mail to administrators.
+ *
* @codeCoverageIgnore
*/
class AdminTestMail extends Mailable
diff --git a/app/Mail/ConfirmEmailChangeMail.php b/app/Mail/ConfirmEmailChangeMail.php
index 74d8c8b75e..3ac01c4bbe 100644
--- a/app/Mail/ConfirmEmailChangeMail.php
+++ b/app/Mail/ConfirmEmailChangeMail.php
@@ -30,6 +30,7 @@ use Illuminate\Queue\SerializesModels;
* Class ConfirmEmailChangeMail
*
* Sends message to new address to confirm change.
+ *
* @codeCoverageIgnore
*/
class ConfirmEmailChangeMail extends Mailable
diff --git a/app/Mail/OAuthTokenCreatedMail.php b/app/Mail/OAuthTokenCreatedMail.php
index f8729a4ce2..4146b0cfff 100644
--- a/app/Mail/OAuthTokenCreatedMail.php
+++ b/app/Mail/OAuthTokenCreatedMail.php
@@ -31,6 +31,7 @@ use Laravel\Passport\Client;
/**
* Class OAuthTokenCreatedMail
+ *
* @codeCoverageIgnore
*/
class OAuthTokenCreatedMail extends Mailable
diff --git a/app/Mail/RegisteredUser.php b/app/Mail/RegisteredUser.php
index c66955da2b..f56b689e6b 100644
--- a/app/Mail/RegisteredUser.php
+++ b/app/Mail/RegisteredUser.php
@@ -31,6 +31,7 @@ use Illuminate\Queue\SerializesModels;
* Sends newly registered user an email message.
*
* Class RegisteredUser
+ *
* @codeCoverageIgnore
*/
class RegisteredUser extends Mailable
diff --git a/app/Mail/ReportNewJournalsMail.php b/app/Mail/ReportNewJournalsMail.php
index 5c38a2173a..0ffe29868c 100644
--- a/app/Mail/ReportNewJournalsMail.php
+++ b/app/Mail/ReportNewJournalsMail.php
@@ -31,6 +31,7 @@ use Illuminate\Support\Collection;
* Class ReportNewJournalsMail.
*
* Sends a list of newly created journals to the user.
+ *
* @codeCoverageIgnore
*/
class ReportNewJournalsMail extends Mailable
diff --git a/app/Mail/RequestedNewPassword.php b/app/Mail/RequestedNewPassword.php
index bc102856e4..53735fffa6 100644
--- a/app/Mail/RequestedNewPassword.php
+++ b/app/Mail/RequestedNewPassword.php
@@ -30,6 +30,7 @@ use Illuminate\Queue\SerializesModels;
/**
* Sends user link for new password.
* Class RequestedNewPassword
+ *
* @codeCoverageIgnore
*/
class RequestedNewPassword extends Mailable
diff --git a/app/Mail/UndoEmailChangeMail.php b/app/Mail/UndoEmailChangeMail.php
index 69deb68073..4b73f0468d 100644
--- a/app/Mail/UndoEmailChangeMail.php
+++ b/app/Mail/UndoEmailChangeMail.php
@@ -28,6 +28,7 @@ use Illuminate\Queue\SerializesModels;
/**
* Class UndoEmailChangeMail
+ *
* @codeCoverageIgnore
*/
class UndoEmailChangeMail extends Mailable
diff --git a/app/Models/Transaction.php b/app/Models/Transaction.php
index 8591b1f2c0..9259fabb6f 100644
--- a/app/Models/Transaction.php
+++ b/app/Models/Transaction.php
@@ -23,13 +23,11 @@ declare(strict_types=1);
namespace FireflyIII\Models;
use Carbon\Carbon;
-use FireflyIII\User;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\SoftDeletes;
-use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
/**
* Class Transaction.
@@ -159,8 +157,6 @@ class Transaction extends Model
/**
* Check if a table is joined.
*
- *
- *
* @param Builder $query
* @param string $table
*
diff --git a/app/Providers/EventServiceProvider.php b/app/Providers/EventServiceProvider.php
index 4afe6a89c7..c5bf2a20fa 100644
--- a/app/Providers/EventServiceProvider.php
+++ b/app/Providers/EventServiceProvider.php
@@ -112,7 +112,7 @@ class EventServiceProvider extends ServiceProvider
}
/**
- * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ *
*/
protected function registerCreateEvents(): void
{
diff --git a/app/Providers/FireflyServiceProvider.php b/app/Providers/FireflyServiceProvider.php
index 2288539806..8d15def23d 100644
--- a/app/Providers/FireflyServiceProvider.php
+++ b/app/Providers/FireflyServiceProvider.php
@@ -53,8 +53,8 @@ use FireflyIII\Services\IP\IPRetrievalInterface;
use FireflyIII\Services\Password\PwndVerifierV3;
use FireflyIII\Services\Password\Verifier;
use FireflyIII\Support\Amount;
-use FireflyIII\Support\FireflyConfig;
use FireflyIII\Support\ExpandedForm;
+use FireflyIII\Support\FireflyConfig;
use FireflyIII\Support\Form\AccountForm;
use FireflyIII\Support\Form\CurrencyForm;
use FireflyIII\Support\Form\PiggyBankForm;
@@ -63,9 +63,9 @@ use FireflyIII\Support\Navigation;
use FireflyIII\Support\Preferences;
use FireflyIII\Support\Steam;
use FireflyIII\Support\Twig\AmountFormat;
-use FireflyIII\Support\Twig\Extension\TransactionGroupTwig;
use FireflyIII\Support\Twig\General;
use FireflyIII\Support\Twig\Rule;
+use FireflyIII\Support\Twig\TransactionGroupTwig;
use FireflyIII\Support\Twig\Translation;
use FireflyIII\Validation\FireflyValidator;
use Illuminate\Foundation\Application;
@@ -80,7 +80,7 @@ use Validator;
* Class FireflyServiceProvider.
*
* @codeCoverageIgnore
- * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ *
*/
class FireflyServiceProvider extends ServiceProvider
{
@@ -90,7 +90,7 @@ class FireflyServiceProvider extends ServiceProvider
public function boot(): void
{
Validator::resolver(
- /** @noinspection MoreThanThreeArgumentsInspection */
+
function ($translator, $data, $rules, $messages) {
return new FireflyValidator($translator, $data, $rules, $messages);
}
@@ -108,7 +108,7 @@ class FireflyServiceProvider extends ServiceProvider
/**
* Register stuff.
*
- * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ *
*/
public function register(): void
{
diff --git a/app/Providers/RouteServiceProvider.php b/app/Providers/RouteServiceProvider.php
index 3a9524ec65..050d063971 100644
--- a/app/Providers/RouteServiceProvider.php
+++ b/app/Providers/RouteServiceProvider.php
@@ -58,7 +58,7 @@ class RouteServiceProvider extends ServiceProvider
protected function mapApiRoutes(): void
{
Route::prefix('api/v1')
- ->middleware('auth:api')
+ ->middleware('apiX')
->namespace($this->namespace)
->group(base_path('routes/api.php'));
}
diff --git a/app/Repositories/Account/AccountRepository.php b/app/Repositories/Account/AccountRepository.php
index 9967f08b79..55d61a41b2 100644
--- a/app/Repositories/Account/AccountRepository.php
+++ b/app/Repositories/Account/AccountRepository.php
@@ -40,7 +40,7 @@ use Log;
/**
* Class AccountRepository.
- * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ *
*/
class AccountRepository implements AccountRepositoryInterface
{
diff --git a/app/Repositories/Account/AccountTasker.php b/app/Repositories/Account/AccountTasker.php
index f4ee5c1086..f58a6d6dce 100644
--- a/app/Repositories/Account/AccountTasker.php
+++ b/app/Repositories/Account/AccountTasker.php
@@ -55,7 +55,6 @@ class AccountTasker implements AccountTaskerInterface
* @param Carbon $end
*
* @return array
- * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*/
public function getAccountReport(Collection $accounts, Carbon $start, Carbon $end): array
{
@@ -63,36 +62,42 @@ class AccountTasker implements AccountTaskerInterface
$yesterday->subDay();
$startSet = app('steam')->balancesByAccounts($accounts, $yesterday);
$endSet = app('steam')->balancesByAccounts($accounts, $end);
-
Log::debug('Start of accountreport');
/** @var AccountRepositoryInterface $repository */
- $repository = app(AccountRepositoryInterface::class);
-
- /** @var CurrencyRepositoryInterface $currencyRepository */
- $currencyRepository = app(CurrencyRepositoryInterface::class);
- $defaultCurrency = app('amount')->getDefaultCurrencyByUser($this->user);
+ $repository = app(AccountRepositoryInterface::class);
+ $defaultCurrency = app('amount')->getDefaultCurrencyByUser($this->user);
$return = [
- 'currencies' => [],
- 'start' => '0',
- 'end' => '0',
- 'difference' => '0',
- 'accounts' => [],
+ 'accounts' => [],
+ 'sums' => [],
];
/** @var Account $account */
foreach ($accounts as $account) {
- $id = $account->id;
- $currencyId = (int)$repository->getMetaValue($account, 'currency_id');
- $currency = $currencyRepository->findNull($currencyId);
- $return['currencies'][] = $currencyId;
- $entry = [
- 'name' => $account->name,
- 'id' => $account->id,
- 'currency' => $currency ?? $defaultCurrency,
- 'start_balance' => '0',
- 'end_balance' => '0',
+ $id = $account->id;
+ $currency = $repository->getAccountCurrency($account) ?? $defaultCurrency;
+ $return['sums'][$currency->id] = $return['sums'][$currency->id] ?? [
+ 'start' => '0',
+ 'end' => '0',
+ 'difference' => '0',
+ 'currency_id' => $currency->id,
+ 'currency_code' => $currency->code,
+ 'currency_symbol' => $currency->symbol,
+ 'currency_name' => $currency->name,
+ 'currency_decimal_places' => $currency->decimal_places,];
+
+
+ $entry = [
+ 'name' => $account->name,
+ 'id' => $account->id,
+ 'currency_id' => $currency->id,
+ 'currency_code' => $currency->code,
+ 'currency_symbol' => $currency->symbol,
+ 'currency_name' => $currency->name,
+ 'currency_decimal_places' => $currency->decimal_places,
+ 'start_balance' => '0',
+ 'end_balance' => '0',
];
// get first journal date:
@@ -106,13 +111,14 @@ class AccountTasker implements AccountTaskerInterface
$entry['start_balance'] = $first->transactions()->where('account_id', $account->id)->first()->amount;
Log::debug(sprintf('Account %s was opened on %s, so opening balance is %f', $account->name, $start->format('Y-m-d'), $entry['start_balance']));
}
- $return['start'] = bcadd($return['start'], $entry['start_balance']);
- $return['end'] = bcadd($return['end'], $entry['end_balance']);
-
- $return['accounts'][$id] = $entry;
+ $return['sums'][$currency->id]['start'] = bcadd($return['sums'][$currency->id]['start'], $entry['start_balance']);
+ $return['sums'][$currency->id]['end'] = bcadd($return['sums'][$currency->id]['end'], $entry['end_balance']);
+ $return['accounts'][$id] = $entry;
+ }
+
+ foreach (array_keys($return['sums']) as $index) {
+ $return['sums'][$index]['difference'] = bcsub($return['sums'][$index]['end'], $return['sums'][$index]['start']);
}
- $return['currencies'] = count(array_unique($return['currencies']));
- $return['difference'] = bcsub($return['end'], $return['start']);
return $return;
}
@@ -133,22 +139,23 @@ class AccountTasker implements AccountTaskerInterface
/** @var GroupCollectorInterface $collector */
$collector = app(GroupCollectorInterface::class);
- $collector->setAccounts($accounts)->setRange($start, $end);
- $collector->setTypes([TransactionType::WITHDRAWAL, TransactionType::TRANSFER])
- ->withAccountInformation();
+ $collector->setSourceAccounts($accounts)->setRange($start, $end);
+ $collector->excludeDestinationAccounts($accounts);
+ $collector->setTypes([TransactionType::WITHDRAWAL, TransactionType::TRANSFER])->withAccountInformation();
$journals = $collector->getExtractedJournals();
- $expenses = $this->groupByDestination($journals);
+
+ $report = $this->groupExpenseByDestination($journals);
// sort the result
// Obtain a list of columns
$sum = [];
- foreach ($expenses as $accountId => $row) {
+ foreach ($report['accounts'] as $accountId => $row) {
$sum[$accountId] = (float)$row['sum'];
}
- array_multisort($sum, SORT_ASC, $expenses);
+ array_multisort($sum, SORT_ASC, $report['accounts']);
- return $expenses;
+ return $report;
}
/**
@@ -160,28 +167,27 @@ class AccountTasker implements AccountTaskerInterface
*/
public function getIncomeReport(Carbon $start, Carbon $end, Collection $accounts): array
{
- // get all expenses for the given accounts in the given period!
+ // get all incomes for the given accounts in the given period!
// also transfers!
// get all transactions:
/** @var GroupCollectorInterface $collector */
$collector = app(GroupCollectorInterface::class);
-
- $collector->setAccounts($accounts)->setRange($start, $end);
- $collector->setTypes([TransactionType::DEPOSIT, TransactionType::TRANSFER])
- ->withAccountInformation();
- $income = $this->groupByDestination($collector->getExtractedJournals());
+ $collector->setDestinationAccounts($accounts)->setRange($start, $end);
+ $collector->excludeSourceAccounts($accounts);
+ $collector->setTypes([TransactionType::DEPOSIT, TransactionType::TRANSFER])->withAccountInformation();
+ $report = $this->groupIncomeBySource($collector->getExtractedJournals());
// sort the result
// Obtain a list of columns
$sum = [];
- foreach ($income as $accountId => $row) {
+ foreach ($report['accounts'] as $accountId => $row) {
$sum[$accountId] = (float)$row['sum'];
}
- array_multisort($sum, SORT_DESC, $income);
+ array_multisort($sum, SORT_DESC, $report['accounts']);
- return $income;
+ return $report;
}
/**
@@ -196,57 +202,119 @@ class AccountTasker implements AccountTaskerInterface
* @param array $array
*
* @return array
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
*/
- private function groupByDestination(array $array): array
+ private function groupExpenseByDestination(array $array): array
{
$defaultCurrency = app('amount')->getDefaultCurrencyByUser($this->user);
/** @var CurrencyRepositoryInterface $currencyRepos */
$currencyRepos = app(CurrencyRepositoryInterface::class);
$currencies = [$defaultCurrency->id => $defaultCurrency,];
- $expenses = [];
- $countAccounts = []; // if count remains 0 use original name, not the name with the currency.
-
+ $report = [
+ 'accounts' => [],
+ 'sums' => [],
+ ];
/** @var array $journal */
foreach ($array as $journal) {
- $opposingId = (int)$journal['destination_account_id'];
- $currencyId = (int)$journal['currency_id'];
- $key = sprintf('%s-%s', $opposingId, $currencyId);
- $name = sprintf('%s (%s)', $journal['destination_account_name'], $journal['currency_name']);
- $countAccounts[$opposingId] = isset($countAccounts[$opposingId]) ? $countAccounts[$opposingId] + 1 : 1;
- if (!isset($expenses[$key])) {
- $currencies[$currencyId] = $currencies[$currencyId] ?? $currencyRepos->findNull($currencyId);
- $expenses[$key] = [
- 'id' => $opposingId,
- 'name' => $name,
- 'original' => $journal['destination_account_name'],
- 'sum' => '0',
- 'average' => '0',
- 'currencies' => [],
- 'single_currency' => $currencies[$currencyId],
- 'count' => 0,
+ $sourceId = (int)$journal['destination_account_id'];
+ $currencyId = (int)$journal['currency_id'];
+ $key = sprintf('%s-%s', $sourceId, $currencyId);
+ $currencies[$currencyId] = $currencies[$currencyId] ?? $currencyRepos->findNull($currencyId);
+ $report['accounts'][$key] = $report['accounts'][$key] ?? [
+ 'id' => $sourceId,
+ 'name' => $journal['destination_account_name'],
+ 'sum' => '0',
+ 'average' => '0',
+ 'count' => 0,
+ 'currency_id' => $currencies[$currencyId]->id,
+ 'currency_name' => $currencies[$currencyId]->name,
+ 'currency_symbol' => $currencies[$currencyId]->symbol,
+ 'currency_code' => $currencies[$currencyId]->code,
+ 'currency_decimal_places' => $currencies[$currencyId]->decimal_places,
+ ];
+ $report['accounts'][$key]['sum'] = bcadd($report['accounts'][$key]['sum'], $journal['amount']);
+
+ Log::debug(sprintf('Sum for %s is now %s', $journal['destination_account_name'], $report['accounts'][$key]['sum']));
+
+ ++$report['accounts'][$key]['count'];
+ }
+
+ // do averages and sums.
+ foreach (array_keys($report['accounts']) as $key) {
+ if ($report['accounts'][$key]['count'] > 1) {
+ $report['accounts'][$key]['average'] = bcdiv($report['accounts'][$key]['sum'], (string)$report['accounts'][$key]['count']);
+ }
+ $currencyId = $report['accounts'][$key]['currency_id'];
+ $report['sums'][$currencyId] = $report['sums'][$currencyId] ?? [
+ 'sum' => '0',
+ 'currency_id' => $report['accounts'][$key]['currency_id'],
+ 'currency_name' => $report['accounts'][$key]['currency_name'],
+ 'currency_symbol' => $report['accounts'][$key]['currency_symbol'],
+ 'currency_code' => $report['accounts'][$key]['currency_code'],
+ 'currency_decimal_places' => $report['accounts'][$key]['currency_decimal_places'],
+ ];
+ $report['sums'][$currencyId]['sum'] = bcadd($report['sums'][$currencyId]['sum'], $report['accounts'][$key]['sum']);
+ }
+ return $report;
+ }
+
+ /**
+ * @param array $array
+ *
+ * @return array
+ */
+ private function groupIncomeBySource(array $array): array
+ {
+ $defaultCurrency = app('amount')->getDefaultCurrencyByUser($this->user);
+ /** @var CurrencyRepositoryInterface $currencyRepos */
+ $currencyRepos = app(CurrencyRepositoryInterface::class);
+ $currencies = [$defaultCurrency->id => $defaultCurrency,];
+ $report = [
+ 'accounts' => [],
+ 'sums' => [],
+ ];
+
+ /** @var array $journal */
+ foreach ($array as $journal) {
+ $sourceId = (int)$journal['source_account_id'];
+ $currencyId = (int)$journal['currency_id'];
+ $key = sprintf('%s-%s', $sourceId, $currencyId);
+ if (!isset($report['accounts'][$key])) {
+ $currencies[$currencyId] = $currencies[$currencyId] ?? $currencyRepos->findNull($currencyId);
+ $report['accounts'][$key] = [
+ 'id' => $sourceId,
+ 'name' => $journal['source_account_name'],
+ 'sum' => '0',
+ 'average' => '0',
+ 'count' => 0,
+ 'currency_id' => $currencies[$currencyId]->id,
+ 'currency_name' => $currencies[$currencyId]->name,
+ 'currency_symbol' => $currencies[$currencyId]->symbol,
+ 'currency_code' => $currencies[$currencyId]->code,
+ 'currency_decimal_places' => $currencies[$currencyId]->decimal_places,
];
}
- $expenses[$key]['currencies'][] = (int)$journal['currency_id'];
- $expenses[$key]['sum'] = bcadd($expenses[$key]['sum'], $journal['amount']);
- ++$expenses[$key]['count'];
- }
- // do averages:
- $keys = array_keys($expenses);
- foreach ($keys as $key) {
- $opposingId = $expenses[$key]['id'];
- if (1 === $countAccounts[$opposingId]) {
- $expenses[$key]['name'] = $expenses[$key]['original'];
- }
-
- if ($expenses[$key]['count'] > 1) {
- $expenses[$key]['average'] = bcdiv($expenses[$key]['sum'], (string)$expenses[$key]['count']);
- }
- $expenses[$key]['currencies'] = count(array_unique($expenses[$key]['currencies']));
- $expenses[$key]['all_currencies'] = count($currencies);
+ $report['accounts'][$key]['sum'] = bcadd($report['accounts'][$key]['sum'], bcmul($journal['amount'], '-1'));
+ ++$report['accounts'][$key]['count'];
}
- return $expenses;
+ // do averages and sums.
+ foreach (array_keys($report['accounts']) as $key) {
+ if ($report['accounts'][$key]['count'] > 1) {
+ $report['accounts'][$key]['average'] = bcdiv($report['accounts'][$key]['sum'], (string)$report['accounts'][$key]['count']);
+ }
+ $currencyId = $report['accounts'][$key]['currency_id'];
+ $report['sums'][$currencyId] = $report['sums'][$currencyId] ?? [
+ 'sum' => '0',
+ 'currency_id' => $report['accounts'][$key]['currency_id'],
+ 'currency_name' => $report['accounts'][$key]['currency_name'],
+ 'currency_symbol' => $report['accounts'][$key]['currency_symbol'],
+ 'currency_code' => $report['accounts'][$key]['currency_code'],
+ 'currency_decimal_places' => $report['accounts'][$key]['currency_decimal_places'],
+ ];
+ $report['sums'][$currencyId]['sum'] = bcadd($report['sums'][$currencyId]['sum'], $report['accounts'][$key]['sum']);
+ }
+
+ return $report;
}
}
diff --git a/app/Repositories/Attachment/AttachmentRepository.php b/app/Repositories/Attachment/AttachmentRepository.php
index 7976c8c0fa..299c4c34a9 100644
--- a/app/Repositories/Attachment/AttachmentRepository.php
+++ b/app/Repositories/Attachment/AttachmentRepository.php
@@ -22,7 +22,6 @@ declare(strict_types=1);
namespace FireflyIII\Repositories\Attachment;
-use Carbon\Carbon;
use Crypt;
use Exception;
use FireflyIII\Exceptions\FireflyException;
@@ -38,7 +37,7 @@ use Log;
/**
* Class AttachmentRepository.
- * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ *
*/
class AttachmentRepository implements AttachmentRepositoryInterface
{
diff --git a/app/Repositories/Bill/BillRepository.php b/app/Repositories/Bill/BillRepository.php
index 228193dd05..b089ceca6d 100644
--- a/app/Repositories/Bill/BillRepository.php
+++ b/app/Repositories/Bill/BillRepository.php
@@ -41,7 +41,7 @@ use Log;
/**
* Class BillRepository.
- * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ *
*/
class BillRepository implements BillRepositoryInterface
{
@@ -192,13 +192,13 @@ class BillRepository implements BillRepositoryInterface
$set = $this->user->bills()
->leftJoin(
'transaction_journals',
- function (JoinClause $join) {
+ static function (JoinClause $join) {
$join->on('transaction_journals.bill_id', '=', 'bills.id')->whereNull('transaction_journals.deleted_at');
}
)
->leftJoin(
'transactions',
- function (JoinClause $join) {
+ static function (JoinClause $join) {
$join->on('transaction_journals.id', '=', 'transactions.transaction_journal_id')->where('transactions.amount', '<', 0);
}
)
diff --git a/app/Repositories/Budget/BudgetRepository.php b/app/Repositories/Budget/BudgetRepository.php
index bb612da44c..7117414748 100644
--- a/app/Repositories/Budget/BudgetRepository.php
+++ b/app/Repositories/Budget/BudgetRepository.php
@@ -46,9 +46,9 @@ use Navigation;
/**
* Class BudgetRepository.
*
- * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
- * @SuppressWarnings(PHPMD.TooManyPublicMethods)
- * @SuppressWarnings(PHPMD.ExcessiveClassComplexity)
+ *
+ *
+ *
*/
class BudgetRepository implements BudgetRepositoryInterface
{
@@ -105,7 +105,7 @@ class BudgetRepository implements BudgetRepositoryInterface
*
* @return array
*
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
+ *
*/
public function collectBudgetInformation(Collection $budgets, Carbon $start, Carbon $end): array
{
@@ -173,16 +173,16 @@ class BudgetRepository implements BudgetRepositoryInterface
* @param Carbon $end
*
* @return Collection
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
- * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ *
+ *
*/
public function getBudgetLimits(Budget $budget, Carbon $start = null, Carbon $end = null): Collection
{
if (null === $end && null === $start) {
- return $budget->budgetlimits()->orderBy('budget_limits.start_date', 'DESC')->get(['budget_limits.*']);
+ return $budget->budgetlimits()->with(['transactionCurrency'])->orderBy('budget_limits.start_date', 'DESC')->get(['budget_limits.*']);
}
if (null === $end xor null === $start) {
- $query = $budget->budgetlimits()->orderBy('budget_limits.start_date', 'DESC');
+ $query = $budget->budgetlimits()->with(['transactionCurrency'])->orderBy('budget_limits.start_date', 'DESC');
// one of the two is null
if (null !== $end) {
// end date must be before $end.
@@ -335,8 +335,8 @@ class BudgetRepository implements BudgetRepositoryInterface
* @param Budget $budget
*
* @return Carbon
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
- * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ *
+ *
*/
public function firstUseDate(Budget $budget): ?Carbon
{
@@ -377,8 +377,8 @@ class BudgetRepository implements BudgetRepositoryInterface
* @param Carbon $end
*
* @return Collection
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
- * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ *
+ *
*/
public function getAllBudgetLimits(Carbon $start = null, Carbon $end = null): Collection
{
@@ -467,7 +467,7 @@ class BudgetRepository implements BudgetRepositoryInterface
return $amount;
}
- /** @noinspection MoreThanThreeArgumentsInspection */
+
/**
* @param Carbon $start
@@ -544,7 +544,7 @@ class BudgetRepository implements BudgetRepositoryInterface
return $set;
}
- /** @noinspection MoreThanThreeArgumentsInspection */
+
/**
* Get all budgets with these ID's.
@@ -570,7 +570,7 @@ class BudgetRepository implements BudgetRepositoryInterface
return $set;
}
- /** @noinspection MoreThanThreeArgumentsInspection */
+
/**
* @param Collection $accounts
@@ -704,6 +704,7 @@ class BudgetRepository implements BudgetRepositoryInterface
'id' => $transaction['currency_id'],
'decimal_places' => $transaction['currency_decimal_places'],
'code' => $transaction['currency_code'],
+ 'name' => $transaction['currency_name'],
'symbol' => $transaction['currency_symbol'],
];
}
@@ -720,9 +721,10 @@ class BudgetRepository implements BudgetRepositoryInterface
$return[] = [
'currency_id' => $currency['id'],
'currency_code' => $code,
+ 'currency_name' => $currency['name'],
'currency_symbol' => $currency['symbol'],
'currency_decimal_places' => $currency['decimal_places'],
- 'amount' => round($spent, $currency['decimal_places']),
+ 'amount' => $spent,
];
}
@@ -792,9 +794,10 @@ class BudgetRepository implements BudgetRepositoryInterface
$return[] = [
'currency_id' => $currency['id'],
'currency_code' => $code,
+ 'currency_name' => $currency['name'],
'currency_symbol' => $currency['symbol'],
'currency_decimal_places' => $currency['decimal_places'],
- 'amount' => round($spent, $currency['decimal_places']),
+ 'amount' => $spent,
];
}
@@ -819,7 +822,7 @@ class BudgetRepository implements BudgetRepositoryInterface
return $newBudget;
}
- /** @noinspection MoreThanThreeArgumentsInspection */
+
/**
* @param array $data
@@ -867,7 +870,7 @@ class BudgetRepository implements BudgetRepositoryInterface
/**
* @return bool
- * @SuppressWarnings(PHPMD.CyclomaticComplexity) // it's 5.
+ * // it's 5.
*/
public function cleanupBudgets(): bool
{
@@ -989,8 +992,8 @@ class BudgetRepository implements BudgetRepositoryInterface
* @param string $amount
*
* @return BudgetLimit|null
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
- * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ *
+ *
*/
public function updateLimitAmount(Budget $budget, Carbon $start, Carbon $end, string $amount): ?BudgetLimit
{
@@ -1069,7 +1072,7 @@ class BudgetRepository implements BudgetRepositoryInterface
$query->where('start_date', '>=', $start->format('Y-m-d H:i:s'));
}
if (null !== $end) {
- $query->where('emd_date', '<=', $end->format('Y-m-d H:i:s'));
+ $query->where('end_date', '<=', $end->format('Y-m-d H:i:s'));
}
return $query->get();
diff --git a/app/Repositories/Budget/BudgetRepositoryInterface.php b/app/Repositories/Budget/BudgetRepositoryInterface.php
index 0a59706dd8..d906d4af10 100644
--- a/app/Repositories/Budget/BudgetRepositoryInterface.php
+++ b/app/Repositories/Budget/BudgetRepositoryInterface.php
@@ -147,6 +147,8 @@ interface BudgetRepositoryInterface
public function getAvailableBudget(TransactionCurrency $currency, Carbon $start, Carbon $end): string;
/**
+ * TODO only used in API
+ *
* @param Carbon $start
* @param Carbon $end
*
@@ -165,6 +167,8 @@ interface BudgetRepositoryInterface
public function getAvailableBudgetsByDate(?Carbon $start, ?Carbon $end): Collection;
/**
+ * TODO only used in API
+ *
* Returns all available budget objects.
*
* @param TransactionCurrency $currency
@@ -205,7 +209,7 @@ interface BudgetRepositoryInterface
*/
public function getByIds(array $budgetIds): Collection;
- /** @noinspection MoreThanThreeArgumentsInspection */
+
/**
* @return Collection
@@ -244,7 +248,7 @@ interface BudgetRepositoryInterface
*/
public function setBudgetOrder(Budget $budget, int $order): void;
- /** @noinspection MoreThanThreeArgumentsInspection */
+
/**
* @param User $user
@@ -252,6 +256,7 @@ interface BudgetRepositoryInterface
public function setUser(User $user);
/**
+ * TODO this method is not multi-currency aware.
* @param Collection $budgets
* @param Collection $accounts
* @param Carbon $start
@@ -261,7 +266,7 @@ interface BudgetRepositoryInterface
*/
public function spentInPeriod(Collection $budgets, Collection $accounts, Carbon $start, Carbon $end): string;
- /** @noinspection MoreThanThreeArgumentsInspection */
+
/**
* Return multi-currency spent information.
@@ -332,7 +337,7 @@ interface BudgetRepositoryInterface
*/
public function updateBudgetLimit(BudgetLimit $budgetLimit, array $data): BudgetLimit;
- /** @noinspection MoreThanThreeArgumentsInspection */
+
/**
* @param Budget $budget
* @param Carbon $start
diff --git a/app/Repositories/Category/CategoryRepository.php b/app/Repositories/Category/CategoryRepository.php
index 9f3db26a2d..b901fcff5f 100644
--- a/app/Repositories/Category/CategoryRepository.php
+++ b/app/Repositories/Category/CategoryRepository.php
@@ -37,9 +37,9 @@ use Navigation;
/**
* Class CategoryRepository.
*
- * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
- * @SuppressWarnings(PHPMD.TooManyPublicMethods)
- * @SuppressWarnings(PHPMD.ExcessiveClassComplexity)
+ *
+ *
+ *
*/
class CategoryRepository implements CategoryRepositoryInterface
{
@@ -72,23 +72,6 @@ class CategoryRepository implements CategoryRepositoryInterface
return true;
}
- /** @noinspection MoreThanThreeArgumentsInspection */
- /**
- * @param Collection $categories
- * @param Collection $accounts
- * @param Carbon $start
- * @param Carbon $end
- *
- * @return string
- */
- public function earnedInPeriod(Collection $categories, Collection $accounts, Carbon $start, Carbon $end): string
- {
- $set = $this->earnedInPeriodCollection($categories, $accounts, $start, $end);
-
- return $this->sumJournals($set);
- }
-
- /** @noinspection MoreThanThreeArgumentsInspection */
/**
* @param Collection $categories
* @param Collection $accounts
@@ -97,18 +80,54 @@ class CategoryRepository implements CategoryRepositoryInterface
*
* @return array
*/
- public function earnedInPeriodCollection(Collection $categories, Collection $accounts, Carbon $start, Carbon $end): array
+ public function earnedInPeriod(Category $category, Collection $accounts, Carbon $start, Carbon $end): array
{
/** @var GroupCollectorInterface $collector */
$collector = app(GroupCollectorInterface::class);
+
+
$collector->setUser($this->user);
- if (0 !== $accounts->count()) {
+ $collector->setRange($start, $end)->setTypes([TransactionType::DEPOSIT])->setCategory($category);
+
+ if ($accounts->count() > 0) {
$collector->setAccounts($accounts);
}
+ // collect and group results:
+ $array = $collector->getExtractedJournals();
+ $return = [];
- $collector->setRange($start, $end)->setTypes([TransactionType::DEPOSIT])->setCategories($categories);
+ foreach ($array as $journal) {
+ $currencyCode = $journal['currency_code'];
+ if (!isset($return[$currencyCode])) {
+ $return[$currencyCode] = [
+ 'currency_id' => $journal['currency_id'],
+ 'currency_code' => $journal['currency_code'],
+ 'currency_name' => $journal['currency_name'],
+ 'currency_symbol' => $journal['currency_symbol'],
+ 'currency_decimal_places' => $journal['currency_decimal_places'],
+ 'earned' => '0',
+ ];
+ }
- return $collector->getExtractedJournals();
+ // also extract foreign currency information:
+ if (null !== $journal['foreign_currency_id']) {
+ $currencyCode = $journal['foreign_currency_code'];
+ if (!isset($return[$currencyCode])) {
+ $return[$currencyCode] = [
+ 'currency_id' => $journal['foreign_currency_id'],
+ 'currency_code' => $journal['foreign_currency_code'],
+ 'currency_name' => $journal['foreign_currency_name'],
+ 'currency_symbol' => $journal['foreign_currency_symbol'],
+ 'currency_decimal_places' => $journal['foreign_currency_decimal_places'],
+ 'earned' => '0',
+ ];
+ }
+ $return[$currencyCode]['earned'] = bcadd($return[$currencyCode]['earned'], app('steam')->positive($journal['foreign_amount']));
+ }
+ $return[$currencyCode]['earned'] = bcadd($return[$currencyCode]['earned'], app('steam')->positive($journal['amount']));
+ }
+
+ return $return;
}
/**
@@ -260,7 +279,7 @@ class CategoryRepository implements CategoryRepositoryInterface
return $this->user->categories()->find($categoryId);
}
- /** @noinspection MoreThanThreeArgumentsInspection */
+
/**
* Find a category.
@@ -298,13 +317,13 @@ class CategoryRepository implements CategoryRepositoryInterface
return $factory->findOrCreate(null, $data['name']);
}
- /** @noinspection MoreThanThreeArgumentsInspection */
+
/**
* @param Category $category
*
* @return Carbon|null
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
+ *
*/
public function firstUseDate(Category $category): ?Carbon
{
@@ -346,7 +365,7 @@ class CategoryRepository implements CategoryRepositoryInterface
*
* @return Carbon|null
*
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
+ *
*/
public function lastUseDate(Category $category, Collection $accounts): ?Carbon
{
@@ -370,7 +389,7 @@ class CategoryRepository implements CategoryRepositoryInterface
return $lastJournalDate;
}
- /** @noinspection MoreThanThreeArgumentsInspection */
+
/**
* @param Collection $categories
@@ -414,7 +433,7 @@ class CategoryRepository implements CategoryRepositoryInterface
return $data;
}
- /** @noinspection MoreThanThreeArgumentsInspection */
+
/**
* @param Collection $accounts
@@ -453,9 +472,10 @@ class CategoryRepository implements CategoryRepositoryInterface
return $result;
}
- /** @noinspection MoreThanThreeArgumentsInspection */
+
/**
+ * TODO not multi currency aware.
* @param Collection $categories
* @param Collection $accounts
* @param Carbon $start
@@ -491,7 +511,7 @@ class CategoryRepository implements CategoryRepositoryInterface
foreach ($journals as $journal) {
$categoryId = (int)$journal['category_id'];
$date = $journal['date']->format($carbonFormat);
- $data[$categoryId]['entries'][$date] = bcadd($data[$categoryId]['entries'][$date] ?? '0', $journal['amount']);
+ $data[$categoryId]['entries'][$date] = bcadd($data[$categoryId]['entries'][$date] ?? '0', bcmul($journal['amount'],'-1'));
}
return $data;
@@ -529,7 +549,7 @@ class CategoryRepository implements CategoryRepositoryInterface
if (!isset($result['entries'][$date])) {
$result['entries'][$date] = '0';
}
- $result['entries'][$date] = bcadd($result['entries'][$date], $journal['amount']);
+ $result['entries'][$date] = bcadd($result['entries'][$date], bcmul($journal['amount'],'-1'));
}
Log::debug('Done looping transactions..');
Log::debug('Finished periodIncomeNoCategory()');
@@ -561,42 +581,61 @@ class CategoryRepository implements CategoryRepositoryInterface
}
/**
- * @param Collection $categories
- * @param Collection $accounts
- * @param Carbon $start
- * @param Carbon $end
+ * Returns the amount spent in a category, for a set of accounts, in a specific period.
*
- * @return string
- */
- public function spentInPeriod(Collection $categories, Collection $accounts, Carbon $start, Carbon $end): string
- {
- $array = $this->spentInPeriodCollection($categories, $accounts, $start, $end);
-
- return $this->sumJournals($array);
- }
-
- /**
- * @param Collection $categories
+ * @param Category $category
* @param Collection $accounts
- * @param Carbon $start
- * @param Carbon $end
+ * @param Carbon $start
+ * @param Carbon $end
*
* @return array
*/
- public function spentInPeriodCollection(Collection $categories, Collection $accounts, Carbon $start, Carbon $end): array
+ public function spentInPeriod(Category $category, Collection $accounts, Carbon $start, Carbon $end): array
{
/** @var GroupCollectorInterface $collector */
$collector = app(GroupCollectorInterface::class);
-
-
$collector->setUser($this->user);
- $collector->setRange($start, $end)->setTypes([TransactionType::WITHDRAWAL])->setCategories($categories);
+ $collector->setRange($start, $end)->setTypes([TransactionType::WITHDRAWAL])->setCategory($category);
if ($accounts->count() > 0) {
$collector->setAccounts($accounts);
}
+ // collect and group results:
+ $array = $collector->getExtractedJournals();
+ $return = [];
- return $collector->getExtractedJournals();
+ foreach ($array as $journal) {
+ $currencyCode = $journal['currency_code'];
+ if (!isset($return[$currencyCode])) {
+ $return[$currencyCode] = [
+ 'currency_id' => $journal['currency_id'],
+ 'currency_code' => $journal['currency_code'],
+ 'currency_name' => $journal['currency_name'],
+ 'currency_symbol' => $journal['currency_symbol'],
+ 'currency_decimal_places' => $journal['currency_decimal_places'],
+ 'spent' => '0',
+ ];
+ }
+
+ // also extract foreign currency information:
+ if (null !== $journal['foreign_currency_id']) {
+ $currencyCode = $journal['foreign_currency_code'];
+ if (!isset($return[$currencyCode])) {
+ $return[$currencyCode] = [
+ 'currency_id' => $journal['foreign_currency_id'],
+ 'currency_code' => $journal['foreign_currency_code'],
+ 'currency_name' => $journal['foreign_currency_name'],
+ 'currency_symbol' => $journal['foreign_currency_symbol'],
+ 'currency_decimal_places' => $journal['foreign_currency_decimal_places'],
+ 'spent' => '0',
+ ];
+ }
+ $return[$currencyCode]['spent'] = bcadd($return[$currencyCode]['spent'], $journal['foreign_amount']);
+ }
+ $return[$currencyCode]['spent'] = bcadd($return[$currencyCode]['spent'], $journal['amount']);
+ }
+
+ return $return;
}
/**
@@ -714,7 +753,10 @@ class CategoryRepository implements CategoryRepositoryInterface
}
/**
+ * TODO does not take currencies into account.
+ *
* @param array $journals
+ *
* @return string
*/
private function sumJournals(array $journals): string
diff --git a/app/Repositories/Category/CategoryRepositoryInterface.php b/app/Repositories/Category/CategoryRepositoryInterface.php
index 52a136d37d..973e594e8b 100644
--- a/app/Repositories/Category/CategoryRepositoryInterface.php
+++ b/app/Repositories/Category/CategoryRepositoryInterface.php
@@ -49,28 +49,16 @@ interface CategoryRepositoryInterface
public function destroy(Category $category): bool;
/**
- * @param Collection $categories
- * @param Collection $accounts
- * @param Carbon $start
- * @param Carbon $end
+ * Returns the amount earned in a category, for a set of accounts, in a specific period.
*
- * @return string
- */
- public function earnedInPeriod(Collection $categories, Collection $accounts, Carbon $start, Carbon $end): string;
-
- /** @noinspection MoreThanThreeArgumentsInspection */
-
- /**
- * @param Collection $categories
+ * @param Category $category
* @param Collection $accounts
* @param Carbon $start
* @param Carbon $end
*
* @return array
*/
- public function earnedInPeriodCollection(Collection $categories, Collection $accounts, Carbon $start, Carbon $end): array;
-
- /** @noinspection MoreThanThreeArgumentsInspection */
+ public function earnedInPeriod(Category $category, Collection $accounts, Carbon $start, Carbon $end): array;
/**
* A very cryptic method name that means:
@@ -136,7 +124,7 @@ interface CategoryRepositoryInterface
*/
public function getCategories(): Collection;
- /** @noinspection MoreThanThreeArgumentsInspection */
+
/**
* Return most recent transaction(journal) date or null when never used before.
@@ -149,6 +137,7 @@ interface CategoryRepositoryInterface
public function lastUseDate(Category $category, Collection $accounts): ?Carbon;
/**
+ * TODO not multi-currency
* @param Collection $categories
* @param Collection $accounts
* @param Carbon $start
@@ -158,9 +147,10 @@ interface CategoryRepositoryInterface
*/
public function periodExpenses(Collection $categories, Collection $accounts, Carbon $start, Carbon $end): array;
- /** @noinspection MoreThanThreeArgumentsInspection */
+
/**
+ * TODO not multi-currency
* @param Collection $accounts
* @param Carbon $start
* @param Carbon $end
@@ -170,6 +160,7 @@ interface CategoryRepositoryInterface
public function periodExpensesNoCategory(Collection $accounts, Carbon $start, Carbon $end): array;
/**
+ * TODO not multi-currency
* @param Collection $categories
* @param Collection $accounts
* @param Carbon $start
@@ -180,6 +171,7 @@ interface CategoryRepositoryInterface
public function periodIncome(Collection $categories, Collection $accounts, Carbon $start, Carbon $end): array;
/**
+ * TODO not multi-currency
* @param Collection $accounts
* @param Carbon $start
* @param Carbon $end
@@ -188,7 +180,7 @@ interface CategoryRepositoryInterface
*/
public function periodIncomeNoCategory(Collection $accounts, Carbon $start, Carbon $end): array;
- /** @noinspection MoreThanThreeArgumentsInspection */
+
/**
* @param string $query
@@ -197,34 +189,24 @@ interface CategoryRepositoryInterface
*/
public function searchCategory(string $query): Collection;
- /** @noinspection MoreThanThreeArgumentsInspection */
+
/**
* @param User $user
*/
public function setUser(User $user);
- /** @noinspection MoreThanThreeArgumentsInspection */
-
/**
- * @param Collection $categories
- * @param Collection $accounts
- * @param Carbon $start
- * @param Carbon $end
+ * Returns the amount spent in a category, for a set of accounts, in a specific period.
*
- * @return string
- */
- public function spentInPeriod(Collection $categories, Collection $accounts, Carbon $start, Carbon $end): string;
-
- /**
- * @param Collection $categories
+ * @param Category $category
* @param Collection $accounts
* @param Carbon $start
* @param Carbon $end
*
* @return array
*/
- public function spentInPeriodCollection(Collection $categories, Collection $accounts, Carbon $start, Carbon $end): array;
+ public function spentInPeriod(Category $category, Collection $accounts, Carbon $start, Carbon $end): array;
/**
* A very cryptic method name that means:
diff --git a/app/Repositories/ImportJob/ImportJobRepository.php b/app/Repositories/ImportJob/ImportJobRepository.php
index bd8bf775f7..155fd4e095 100644
--- a/app/Repositories/ImportJob/ImportJobRepository.php
+++ b/app/Repositories/ImportJob/ImportJobRepository.php
@@ -38,7 +38,7 @@ use Symfony\Component\HttpFoundation\File\UploadedFile;
/**
* Class ImportJobRepository.
*
- * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ *
*/
class ImportJobRepository implements ImportJobRepositoryInterface
{
diff --git a/app/Repositories/Journal/JournalAPIRepository.php b/app/Repositories/Journal/JournalAPIRepository.php
index 0539760db0..1dccb71327 100644
--- a/app/Repositories/Journal/JournalAPIRepository.php
+++ b/app/Repositories/Journal/JournalAPIRepository.php
@@ -1,4 +1,5 @@
user = $user;
}
-}
\ No newline at end of file
+}
diff --git a/app/Repositories/Journal/JournalAPIRepositoryInterface.php b/app/Repositories/Journal/JournalAPIRepositoryInterface.php
index db85122487..1c1c597dae 100644
--- a/app/Repositories/Journal/JournalAPIRepositoryInterface.php
+++ b/app/Repositories/Journal/JournalAPIRepositoryInterface.php
@@ -1,4 +1,5 @@
user = $user;
}
-}
\ No newline at end of file
+}
diff --git a/app/Repositories/Journal/JournalCLIRepositoryInterface.php b/app/Repositories/Journal/JournalCLIRepositoryInterface.php
index 34ffc7852b..3027a7d1c6 100644
--- a/app/Repositories/Journal/JournalCLIRepositoryInterface.php
+++ b/app/Repositories/Journal/JournalCLIRepositoryInterface.php
@@ -1,4 +1,5 @@
destroy($group);
}
-}
\ No newline at end of file
+}
diff --git a/app/Repositories/TransactionGroup/TransactionGroupRepositoryInterface.php b/app/Repositories/TransactionGroup/TransactionGroupRepositoryInterface.php
index b47713dd43..2055726702 100644
--- a/app/Repositories/TransactionGroup/TransactionGroupRepositoryInterface.php
+++ b/app/Repositories/TransactionGroup/TransactionGroupRepositoryInterface.php
@@ -130,4 +130,4 @@ interface TransactionGroupRepositoryInterface
*/
public function update(TransactionGroup $transactionGroup, array $data): TransactionGroup;
-}
\ No newline at end of file
+}
diff --git a/app/Repositories/TransactionType/TransactionTypeRepository.php b/app/Repositories/TransactionType/TransactionTypeRepository.php
index 0e139c6787..c325ae104a 100644
--- a/app/Repositories/TransactionType/TransactionTypeRepository.php
+++ b/app/Repositories/TransactionType/TransactionTypeRepository.php
@@ -81,4 +81,4 @@ class TransactionTypeRepository implements TransactionTypeRepositoryInterface
return TransactionType::where('type', 'LIKE', sprintf('%%%s%%', $query))->get();
}
-}
\ No newline at end of file
+}
diff --git a/app/Repositories/TransactionType/TransactionTypeRepositoryInterface.php b/app/Repositories/TransactionType/TransactionTypeRepositoryInterface.php
index 0300889cf5..b8332bfa7d 100644
--- a/app/Repositories/TransactionType/TransactionTypeRepositoryInterface.php
+++ b/app/Repositories/TransactionType/TransactionTypeRepositoryInterface.php
@@ -51,4 +51,4 @@ interface TransactionTypeRepositoryInterface
* @return Collection
*/
public function searchTypes(string $query): Collection;
-}
\ No newline at end of file
+}
diff --git a/app/Repositories/User/UserRepository.php b/app/Repositories/User/UserRepository.php
index 4ca7f388f3..a14ff743f3 100644
--- a/app/Repositories/User/UserRepository.php
+++ b/app/Repositories/User/UserRepository.php
@@ -32,7 +32,7 @@ use Log;
/**
* Class UserRepository.
*
- * @SuppressWarnings(PHPMD.TooManyPublicMethods)
+ *
*/
class UserRepository implements UserRepositoryInterface
{
diff --git a/app/Rules/BelongsUser.php b/app/Rules/BelongsUser.php
index c9497d45dc..9faa949ffd 100644
--- a/app/Rules/BelongsUser.php
+++ b/app/Rules/BelongsUser.php
@@ -69,8 +69,8 @@ class BelongsUser implements Rule
* @return bool
* @throws FireflyException
*
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
- * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ *
+ *
*/
public function passes($attribute, $value): bool
{
@@ -110,7 +110,7 @@ class BelongsUser implements Rule
*
* @return int
*
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
+ *
*/
protected function countField(string $class, string $field, string $value): int
{
diff --git a/app/Rules/IsAssetAccountId.php b/app/Rules/IsAssetAccountId.php
index 84c6b72bec..292035144a 100644
--- a/app/Rules/IsAssetAccountId.php
+++ b/app/Rules/IsAssetAccountId.php
@@ -50,8 +50,6 @@ class IsAssetAccountId implements Rule
* @param mixed $value
*
* @return bool
- *
- * @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function passes($attribute, $value): bool
{
diff --git a/app/Rules/IsValidAttachmentModel.php b/app/Rules/IsValidAttachmentModel.php
index 33ff7c0d27..132c3fae26 100644
--- a/app/Rules/IsValidAttachmentModel.php
+++ b/app/Rules/IsValidAttachmentModel.php
@@ -74,8 +74,6 @@ class IsValidAttachmentModel implements Rule
* @param mixed $value
*
* @return bool
- *
- * @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function passes($attribute, $value): bool
{
diff --git a/app/Rules/UniqueIban.php b/app/Rules/UniqueIban.php
index c3d18d4da2..e7ed37c61c 100644
--- a/app/Rules/UniqueIban.php
+++ b/app/Rules/UniqueIban.php
@@ -72,8 +72,8 @@ class UniqueIban implements Rule
* @param mixed $value
*
* @return bool
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
- * @SuppressWarnings(PHPMD.UnusedFormalParameter)
+ *
+ *
*/
public function passes($attribute, $value): bool
{
@@ -127,7 +127,7 @@ class UniqueIban implements Rule
/**
* @return array
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
+ *
*/
private function getMaxOccurrences(): array
{
diff --git a/app/Rules/ValidJournals.php b/app/Rules/ValidJournals.php
index a9b449b9f1..719d112a8d 100644
--- a/app/Rules/ValidJournals.php
+++ b/app/Rules/ValidJournals.php
@@ -52,7 +52,7 @@ class ValidJournals implements Rule
* @param mixed $value
*
* @return bool
- * @SuppressWarnings(PHPMD.UnusedFormalParameter)
+ *
*/
public function passes($attribute, $value): bool
{
diff --git a/app/Rules/ValidRecurrenceRepetitionType.php b/app/Rules/ValidRecurrenceRepetitionType.php
index c984e6b0ee..858bef0b47 100644
--- a/app/Rules/ValidRecurrenceRepetitionType.php
+++ b/app/Rules/ValidRecurrenceRepetitionType.php
@@ -49,8 +49,8 @@ class ValidRecurrenceRepetitionType implements Rule
* @param mixed $value
*
* @return bool
- * @SuppressWarnings(PHPMD.UnusedFormalParameter)
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
+ *
+ *
*/
public function passes($attribute, $value): bool
{
diff --git a/app/Rules/ValidRecurrenceRepetitionValue.php b/app/Rules/ValidRecurrenceRepetitionValue.php
index 620e317e7f..bd0d59dfab 100644
--- a/app/Rules/ValidRecurrenceRepetitionValue.php
+++ b/app/Rules/ValidRecurrenceRepetitionValue.php
@@ -53,8 +53,8 @@ class ValidRecurrenceRepetitionValue implements Rule
* @param mixed $value
*
* @return bool
- * @SuppressWarnings(PHPMD.UnusedFormalParameter)
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
+ *
+ *
*/
public function passes($attribute, $value): bool
{
@@ -104,7 +104,7 @@ class ValidRecurrenceRepetitionValue implements Rule
*
* @return bool
*
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
+ *
*/
private function validateNdom(string $value): bool
{
diff --git a/app/Services/Bunq/ApiContext.php b/app/Services/Bunq/ApiContext.php
index b6bff72041..37b1c9f77c 100644
--- a/app/Services/Bunq/ApiContext.php
+++ b/app/Services/Bunq/ApiContext.php
@@ -39,7 +39,7 @@ use Tests\Object\FakeApiContext;
*/
class ApiContext
{
- /** @noinspection MoreThanThreeArgumentsInspection */
+
/**
* @param BunqEnumApiEnvironmentType $environmentType
* @param string $apiKey
@@ -47,9 +47,9 @@ class ApiContext
* @param array $permittedIps
* @param string|null $proxyUrl
*
- * @throws FireflyException
* @return BunqApiContext|FakeApiContext
- * @SuppressWarnings(PHPMD.ExcessiveParameterList)
+ *
+ *@throws FireflyException
*/
public function create(BunqEnumApiEnvironmentType $environmentType, string $apiKey, string $description, array $permittedIps, string $proxyUrl = null
) {
diff --git a/app/Services/Internal/Destroy/RecurrenceDestroyService.php b/app/Services/Internal/Destroy/RecurrenceDestroyService.php
index ebd7fd0a6c..b7fc3d8233 100644
--- a/app/Services/Internal/Destroy/RecurrenceDestroyService.php
+++ b/app/Services/Internal/Destroy/RecurrenceDestroyService.php
@@ -48,7 +48,7 @@ class RecurrenceDestroyService
* Delete recurrence.
*
* @param Recurrence $recurrence
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
+ *
*/
public function destroy(Recurrence $recurrence): void
{
diff --git a/app/Services/Internal/Destroy/TransactionGroupDestroyService.php b/app/Services/Internal/Destroy/TransactionGroupDestroyService.php
index e45ef99259..44cc335255 100644
--- a/app/Services/Internal/Destroy/TransactionGroupDestroyService.php
+++ b/app/Services/Internal/Destroy/TransactionGroupDestroyService.php
@@ -50,4 +50,4 @@ class TransactionGroupDestroyService
}
}
-}
\ No newline at end of file
+}
diff --git a/app/Services/Internal/Support/AccountServiceTrait.php b/app/Services/Internal/Support/AccountServiceTrait.php
index 5c759ad55b..d7fe590f87 100644
--- a/app/Services/Internal/Support/AccountServiceTrait.php
+++ b/app/Services/Internal/Support/AccountServiceTrait.php
@@ -86,7 +86,7 @@ trait AccountServiceTrait
*
* @param Account $account
* @param array $data
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
+ *
*/
public function updateMetaData(Account $account, array $data): void
{
diff --git a/app/Services/Internal/Support/JournalServiceTrait.php b/app/Services/Internal/Support/JournalServiceTrait.php
index a4838d9a15..1e15c4634f 100644
--- a/app/Services/Internal/Support/JournalServiceTrait.php
+++ b/app/Services/Internal/Support/JournalServiceTrait.php
@@ -263,7 +263,7 @@ trait JournalServiceTrait
*
* @param TransactionJournal $journal
* @param array $tags
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
+ *
*
* @codeCoverageIgnore
*/
diff --git a/app/Services/Internal/Update/GroupUpdateService.php b/app/Services/Internal/Update/GroupUpdateService.php
index a6658b2195..129e55df89 100644
--- a/app/Services/Internal/Update/GroupUpdateService.php
+++ b/app/Services/Internal/Update/GroupUpdateService.php
@@ -165,4 +165,4 @@ class GroupUpdateService
$updateService->update();
}
-}
\ No newline at end of file
+}
diff --git a/app/Services/Password/PwndVerifierV3.php b/app/Services/Password/PwndVerifierV3.php
index 833c86872e..96d5fadf88 100644
--- a/app/Services/Password/PwndVerifierV3.php
+++ b/app/Services/Password/PwndVerifierV3.php
@@ -1,4 +1,5 @@
formatAnything($currency, $balance, false);
- $name = sprintf('%s (%s)', $account->name, $formatted);
- $grouped[$key][$account->id] = $name;
+ $grouped[$key][$account->id] = sprintf('%s (%s)', $account->name, $formatted);
}
return $this->select($name, $grouped, $value, $options);
@@ -107,8 +107,7 @@ class AccountForm
$key = (string)trans(sprintf('firefly.opt_group_%s', $role));
$formatted = app('amount')->formatAnything($currency, $balance, false);
- $name = sprintf('%s (%s)', $account->name, $formatted);
- $grouped[$key][$account->id] = $name;
+ $grouped[$key][$account->id] = sprintf('%s (%s)', $account->name, $formatted);
}
@@ -157,8 +156,7 @@ class AccountForm
}
$key = (string)trans('firefly.opt_group_' . $role);
$formatted = app('amount')->formatAnything($currency, $balance, false);
- $name = sprintf('%s (%s)', $account->name, $formatted);
- $grouped[$key][$account->id] = $name;
+ $grouped[$key][$account->id] = sprintf('%s (%s)', $account->name, $formatted);
}
return $this->select($name, $grouped, $value, $options);
@@ -203,8 +201,7 @@ class AccountForm
}
$key = (string)trans(sprintf('firefly.opt_group_%s', $role));
$formatted = app('amount')->formatAnything($currency, $balance, false);
- $name = sprintf('%s (%s)', $account->name, $formatted);
- $grouped[$key][$account->id] = $name;
+ $grouped[$key][$account->id] = sprintf('%s (%s)', $account->name, $formatted);
}
return $this->select($name, $grouped, $value, $options);
@@ -327,4 +324,4 @@ class AccountForm
return $this->select($name, $grouped, $value, $options);
}
-}
\ No newline at end of file
+}
diff --git a/app/Support/Form/CurrencyForm.php b/app/Support/Form/CurrencyForm.php
index 8dac83b809..60dff2f040 100644
--- a/app/Support/Form/CurrencyForm.php
+++ b/app/Support/Form/CurrencyForm.php
@@ -1,4 +1,5 @@
currencyField($name, 'amount', $value, $options);
}
-}
\ No newline at end of file
+}
diff --git a/app/Support/Form/FormSupport.php b/app/Support/Form/FormSupport.php
index 947c7374e1..9a10ddeaed 100644
--- a/app/Support/Form/FormSupport.php
+++ b/app/Support/Form/FormSupport.php
@@ -1,4 +1,5 @@
select($name, $array, $value, $options);
}
-}
\ No newline at end of file
+}
diff --git a/app/Support/Form/RuleForm.php b/app/Support/Form/RuleForm.php
index 1cf57d9c16..2851b36581 100644
--- a/app/Support/Form/RuleForm.php
+++ b/app/Support/Form/RuleForm.php
@@ -1,4 +1,5 @@
findNull((int)$accountRepos->getMetaValue($account, 'currency_id'));
if (null === $currency) {
$currency = $default;
@@ -115,8 +113,6 @@ trait ChartGeneration
* @param Carbon $end
*
* @return array
- *
- * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*/
protected function getChartData(Collection $accounts, Carbon $start, Carbon $end): array // chart helper function
{
@@ -140,25 +136,24 @@ trait ChartGeneration
$currentEnd = app('navigation')->endOfPeriod($currentStart, '1M');
$earned = (string)array_sum(
array_map(
- function ($item) {
+ static function ($item) {
return $item['sum'];
},
- $tasker->getIncomeReport($currentStart, $currentEnd, $accounts)
+ $tasker->getIncomeReport($currentStart, $currentEnd, $accounts)['accounts']
)
);
-
$spent = (string)array_sum(
array_map(
- function ($item) {
+ static function ($item) {
return $item['sum'];
},
- $tasker->getExpenseReport($currentStart, $currentEnd, $accounts)
+ $tasker->getExpenseReport($currentStart, $currentEnd, $accounts)['accounts']
)
);
$label = $currentStart->format('Y-m') . '-01';
$spentArray[$label] = bcmul($spent, '-1');
- $earnedArray[$label] = $earned;
+ $earnedArray[$label] = bcmul($earned, '-1');
$currentStart = app('navigation')->addPeriod($currentStart, '1M', 0);
}
$result = [
@@ -169,96 +164,4 @@ trait ChartGeneration
return $result;
}
-
- /**
- * Chart for a specific period (start and end).
- *
- *
- * @param Category $category
- * @param Carbon $start
- * @param Carbon $end
- *
- * @return array
- *
- * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
- */
- protected function makePeriodChart(Category $category, Carbon $start, Carbon $end): array // chart helper method.
- {
- $cache = new CacheProperties;
- $cache->addProperty($start);
- $cache->addProperty($end);
- $cache->addProperty($category->id);
- $cache->addProperty('chart.category.period-chart');
-
-
- if ($cache->has()) {
- return $cache->get(); // @codeCoverageIgnore
- }
-
- /** @var AccountRepositoryInterface $accountRepository */
- $accountRepository = app(AccountRepositoryInterface::class);
- $accounts = $accountRepository->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET]);
- $repository = app(CategoryRepositoryInterface::class);
- /** @var GeneratorInterface $generator */
- $generator = app(GeneratorInterface::class);
-
- // chart data
- $chartData = [
- [
- 'label' => (string)trans('firefly.spent'),
- 'entries' => [],
- 'type' => 'bar',
- 'backgroundColor' => 'rgba(219, 68, 55, 0.5)', // red
- ],
- [
- 'label' => (string)trans('firefly.earned'),
- 'entries' => [],
- 'type' => 'bar',
- 'backgroundColor' => 'rgba(0, 141, 76, 0.5)', // green
- ],
- [
- 'label' => (string)trans('firefly.sum'),
- 'entries' => [],
- 'type' => 'line',
- 'fill' => false,
- ],
- ];
-
- $step = $this->calculateStep($start, $end);
-
-
- while ($start <= $end) {
- $spent = $repository->spentInPeriod(new Collection([$category]), $accounts, $start, $start);
- $earned = $repository->earnedInPeriod(new Collection([$category]), $accounts, $start, $start);
- $sum = bcadd($spent, $earned);
- $label = trim(app('navigation')->periodShow($start, $step));
- $chartData[0]['entries'][$label] = round(bcmul($spent, '-1'), 12);
- $chartData[1]['entries'][$label] = round($earned, 12);
- $chartData[2]['entries'][$label] = round($sum, 12);
-
- // @codeCoverageIgnoreStart
- switch ($step) {
- default:
- case '1D':
- $start->addDay();
- break;
- case '1W':
- $start->addDays(7);
- break;
- case '1M':
- $start->addMonth();
- break;
- case '1Y':
- $start->addYear();
- break;
- }
- // @codeCoverageIgnoreEnd
- }
-
- $data = $generator->multiSet($chartData);
- $cache->store($data);
-
- return $data;
- }
-
}
diff --git a/app/Support/Http/Controllers/GetConfigurationData.php b/app/Support/Http/Controllers/GetConfigurationData.php
index 94f7472d15..49c3d558d0 100644
--- a/app/Support/Http/Controllers/GetConfigurationData.php
+++ b/app/Support/Http/Controllers/GetConfigurationData.php
@@ -88,7 +88,7 @@ trait GetConfigurationData
* Get config for date range.
*
* @return array
- * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ *
*/
protected function getDateRangeConfig(): array // get configuration + get preferences.
{
@@ -177,7 +177,7 @@ trait GetConfigurationData
* @param string $specificPage
*
* @return array
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
+ *
*/
protected function getSpecificSteps(string $route, string $specificPage): array // get config values
{
diff --git a/app/Support/Http/Controllers/PeriodOverview.php b/app/Support/Http/Controllers/PeriodOverview.php
index 285d611040..ce045bf2ea 100644
--- a/app/Support/Http/Controllers/PeriodOverview.php
+++ b/app/Support/Http/Controllers/PeriodOverview.php
@@ -28,7 +28,6 @@ use FireflyIII\Helpers\Collector\GroupCollectorInterface;
use FireflyIII\Models\Account;
use FireflyIII\Models\Category;
use FireflyIII\Models\Tag;
-use FireflyIII\Models\Transaction;
use FireflyIII\Models\TransactionType;
use FireflyIII\Support\CacheProperties;
use Illuminate\Support\Collection;
@@ -281,7 +280,7 @@ trait PeriodOverview
* @param Carbon $theDate
*
* @return array
- * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ *
*/
protected function getNoCategoryPeriodOverview(Carbon $theDate): array
{
@@ -375,7 +374,7 @@ trait PeriodOverview
$cache->addProperty('tag-period-entries');
$cache->addProperty($tag->id);
if ($cache->has()) {
- // return $cache->get(); // @codeCoverageIgnore
+ return $cache->get(); // @codeCoverageIgnore
}
/** @var array $dates */
$dates = app('navigation')->blockPeriods($start, $end, $range);
diff --git a/app/Support/Http/Controllers/RenderPartialViews.php b/app/Support/Http/Controllers/RenderPartialViews.php
index 4605e9d8eb..b97ce71663 100644
--- a/app/Support/Http/Controllers/RenderPartialViews.php
+++ b/app/Support/Http/Controllers/RenderPartialViews.php
@@ -23,7 +23,6 @@ declare(strict_types=1);
namespace FireflyIII\Support\Http\Controllers;
-use FireflyIII\Helpers\Collection\BalanceLine;
use FireflyIII\Helpers\Report\PopupReportInterface;
use FireflyIII\Models\AccountType;
use FireflyIII\Models\Budget;
@@ -76,56 +75,6 @@ trait RenderPartialViews
return $result;
}
- /**
- * View for balance row.
- *
- * @param array $attributes
- *
- * @return string
- *
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
- */
- protected function balanceAmount(array $attributes): string // generate view for report.
- {
- $role = (int)$attributes['role'];
- /** @var BudgetRepositoryInterface $budgetRepository */
- $budgetRepository = app(BudgetRepositoryInterface::class);
-
- /** @var AccountRepositoryInterface $accountRepository */
- $accountRepository = app(AccountRepositoryInterface::class);
-
- /** @var PopupReportInterface $popupHelper */
- $popupHelper = app(PopupReportInterface::class);
- $budget = $budgetRepository->findNull((int)$attributes['budgetId']);
- $account = $accountRepository->findNull((int)$attributes['accountId']);
-
-
- switch (true) {
- case BalanceLine::ROLE_DEFAULTROLE === $role && null !== $budget && null !== $account:
- // normal row with a budget:
- $journals = $popupHelper->balanceForBudget($budget, $account, $attributes);
- break;
- case BalanceLine::ROLE_DEFAULTROLE === $role && null === $budget && null !== $account:
- // normal row without a budget:
- $budget = new Budget;
- $journals = $popupHelper->balanceForNoBudget($account, $attributes);
- $budget->name = (string)trans('firefly.no_budget');
- break;
- case BalanceLine::ROLE_TAGROLE === $role:
- // row with tag info.
- return 'Firefly cannot handle this type of info-button (BalanceLine::TagRole)';
- }
- // @codeCoverageIgnoreStart
- try {
- $view = view('popup.report.balance-amount', compact('journals', 'budget', 'account'))->render();
- } catch (Throwable $e) {
- Log::error(sprintf('Could not render: %s', $e->getMessage()));
- $view = 'Firefly III could not render the view. Please see the log files.';
- }
- // @codeCoverageIgnoreEnd
-
- return $view;
- }
/**
* Get options for budget report.
diff --git a/app/Support/Http/Controllers/RequestInformation.php b/app/Support/Http/Controllers/RequestInformation.php
index 419286429b..b30e530e63 100644
--- a/app/Support/Http/Controllers/RequestInformation.php
+++ b/app/Support/Http/Controllers/RequestInformation.php
@@ -65,8 +65,8 @@ trait RequestInformation
* @param string $language
*
* @return string
- * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
+ *
+ *
*/
protected function getHelpText(string $route, string $language): string // get from internet.
{
@@ -213,7 +213,7 @@ trait RequestInformation
* @param Carbon $date
*
* @return bool
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
+ *
*/
protected function notInSessionRange(Carbon $date): bool // Validate a preference
{
@@ -245,7 +245,7 @@ trait RequestInformation
$attributes['location'] = $attributes['location'] ?? '';
$attributes['accounts'] = AccountList::routeBinder($attributes['accounts'] ?? '', new Route('get', '', []));
try {
- $attributes['startDate'] = Carbon::createFromFormat('Ymd', $attributes['startDate']);
+ $attributes['startDate'] = Carbon::createFromFormat('Ymd', $attributes['startDate'])->startOfDay();
} catch (InvalidArgumentException $e) {
Log::debug(sprintf('Not important error message: %s', $e->getMessage()));
$date = Carbon::now()->startOfMonth();
@@ -253,7 +253,7 @@ trait RequestInformation
}
try {
- $attributes['endDate'] = Carbon::createFromFormat('Ymd', $attributes['endDate']);
+ $attributes['endDate'] = Carbon::createFromFormat('Ymd', $attributes['endDate'])->endOfDay();
} catch (InvalidArgumentException $e) {
Log::debug(sprintf('Not important error message: %s', $e->getMessage()));
$date = Carbon::now()->startOfMonth();
diff --git a/app/Support/Http/Controllers/TransactionCalculation.php b/app/Support/Http/Controllers/TransactionCalculation.php
index d4642e7c2a..cb2dbe5456 100644
--- a/app/Support/Http/Controllers/TransactionCalculation.php
+++ b/app/Support/Http/Controllers/TransactionCalculation.php
@@ -109,8 +109,6 @@ trait TransactionCalculation
* @param Carbon $end
*
* @return array
- *
- *
*/
protected function getExpensesInCategories(Collection $accounts, Collection $categories, Carbon $start, Carbon $end): array
{
@@ -175,8 +173,6 @@ trait TransactionCalculation
* @param Carbon $end
*
* @return Collection
- *
- * @SuppressWarnings(PHPMD.ExcessiveParameterList)
*/
protected function getIncomeForTags(Collection $accounts, Collection $tags, Carbon $start, Carbon $end): array
{
diff --git a/app/Support/Http/Controllers/UserNavigation.php b/app/Support/Http/Controllers/UserNavigation.php
index b23e90fc1f..4575083844 100644
--- a/app/Support/Http/Controllers/UserNavigation.php
+++ b/app/Support/Http/Controllers/UserNavigation.php
@@ -26,8 +26,9 @@ namespace FireflyIII\Support\Http\Controllers;
use FireflyIII\Models\Account;
use FireflyIII\Models\AccountType;
use FireflyIII\Models\Transaction;
+use FireflyIII\Models\TransactionGroup;
use FireflyIII\Models\TransactionJournal;
-use Illuminate\Http\RedirectResponse;
+use FireflyIII\Models\TransactionType;
use Illuminate\Support\ViewErrorBag;
use Log;
@@ -37,6 +38,108 @@ use Log;
*/
trait UserNavigation
{
+
+ //if (!$this->isEditableAccount($account)) {
+ // return $this->redirectAccountToAccount($account); // @codeCoverageIgnore
+ // }
+
+ /**
+ * Will return false if you cant edit this account type.
+ *
+ * @param Account $account
+ *
+ * @return bool
+ */
+ protected function isEditableAccount(Account $account): bool
+ {
+ $editable = [AccountType::EXPENSE, AccountType::REVENUE, AccountType::ASSET, AccountType::LOAN, AccountType::DEBT, AccountType::MORTGAGE];
+ $type = $account->accountType->type;
+
+ return in_array($type, $editable, true);
+ }
+
+ /**
+ * @param TransactionGroup $group
+ *
+ * @return bool
+ */
+ protected function isEditableGroup(TransactionGroup $group): bool
+ {
+ /** @var TransactionJournal $journal */
+ $journal = $group->transactionJournals()->first();
+ if (null === $journal) {
+ return false;
+ }
+ $type = $journal->transactionType->type;
+ $editable = [TransactionType::WITHDRAWAL, TransactionType::TRANSFER, TransactionType::DEPOSIT];
+
+ return in_array($type, $editable, true);
+ }
+
+ /**
+ * @param TransactionGroup $group
+ *
+ * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
+ */
+ protected function redirectGroupToAccount(TransactionGroup $group)
+ {
+ /** @var TransactionJournal $journal */
+ $journal = $group->transactionJournals()->first();
+ if (null === $journal) {
+ Log::error(sprintf('No journals in group #%d', $group->id));
+
+ return redirect(route('index'));
+ }
+ // prefer redirect to everything but expense and revenue:
+ $transactions = $journal->transactions;
+ $ignore = [AccountType::REVENUE, AccountType::EXPENSE, AccountType::RECONCILIATION, AccountType::INITIAL_BALANCE];
+ /** @var Transaction $transaction */
+ foreach ($transactions as $transaction) {
+ $type = $transaction->account->accountType->type;
+ if (!in_array($type, $ignore)) {
+ return redirect(route('accounts.show', [$transaction->account_id]));
+ }
+ }
+
+ return redirect(route('index'));
+ }
+
+ /**
+ * @param Account $account
+ *
+ * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
+ */
+ protected function redirectAccountToAccount(Account $account)
+ {
+ $type = $account->accountType->type;
+ if (AccountType::RECONCILIATION === $type || AccountType::INITIAL_BALANCE === $type) {
+ // reconciliation must be stored somewhere in this account's transactions.
+
+ /** @var Transaction $transaction */
+ $transaction = $account->transactions()->first();
+ if (null === $transaction) {
+ Log::error(sprintf('Account #%d has no transactions. Dont know where it belongs.', $account->id));
+ session()->flash('error', trans('firefly.cant_find_redirect_account'));
+
+ return redirect(route('index'));
+ }
+ $journal = $transaction->transactionJournal;
+ /** @var Transaction $other */
+ $other = $journal->transactions()->where('id', '!=', $transaction->id)->first();
+ if (null === $other) {
+ Log::error(sprintf('Account #%d has no valid journals. Dont know where it belongs.', $account->id));
+ session()->flash('error', trans('firefly.cant_find_redirect_account'));
+
+ return redirect(route('index'));
+ }
+
+ return redirect(route('accounts.show', [$other->account_id]));
+ }
+
+ return redirect(route('index'));
+ }
+
+
/**
* Functionality:.
*
@@ -59,94 +162,72 @@ trait UserNavigation
Log::debug(sprintf('URI is now %s (uri contains jscript)', $uri));
}
- // "forbidden" words for specific identifiers:
- // if these are in the previous URI, don't refer back there.
- // $array = [
- // 'accounts.delete.uri' => '/accounts/show/',
- // 'transactions.delete.uri' => '/transactions/show/',
- // 'attachments.delete.uri' => '/attachments/show/',
- // 'bills.delete.uri' => '/bills/show/',
- // 'budgets.delete.uri' => '/budgets/show/',
- // 'categories.delete.uri' => '/categories/show/',
- // 'currencies.delete.uri' => '/currencies/show/',
- // 'piggy-banks.delete.uri' => '/piggy-banks/show/',
- // 'tags.delete.uri' => '/tags/show/',
- // 'rules.delete.uri' => '/rules/edit/',
- // 'transactions.mass-delete.uri' => '/transactions/show/',
- // ];
- //$forbidden = $array[$identifier] ?? '/show/';
- //Log::debug(sprintf('The forbidden word for %s is "%s"', $identifier, $forbidden));
-
-
- // if (
- // !(false === strpos($identifier, 'delete'))
- // && !(false === strpos($uri, $forbidden))) {
- // $uri = $this->redirectUri;
- // //Log::debug(sprintf('URI is now %s (identifier contains "delete")', $uri));
- // }
-
-
- // more debug notes:
- //Log::debug(sprintf('strpos($identifier, "delete"): %s', var_export(strpos($identifier, 'delete'), true)));
- //Log::debug(sprintf('strpos($uri, $forbidden): %s', var_export(strpos($uri, $forbidden), true)));
Log::debug(sprintf('Return direct link %s', $uri));
return $uri;
}
-
- /**
- * Redirect to asset account that transaction belongs to.
- *
- * @param TransactionJournal $journal
- *
- * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
- * @codeCoverageIgnore
- */
- protected function redirectToAccount(TransactionJournal $journal)
- {
- $valid = [AccountType::DEFAULT, AccountType::ASSET];
- $transactions = $journal->transactions;
- /** @var Transaction $transaction */
- foreach ($transactions as $transaction) {
- $account = $transaction->account;
- if (in_array($account->accountType->type, $valid, true)) {
- return redirect(route('accounts.show', [$account->id]));
- }
- }
- // @codeCoverageIgnoreStart
- session()->flash('error', (string)trans('firefly.cannot_redirect_to_account'));
-
- return redirect(route('index'));
- // @codeCoverageIgnoreEnd
- }
-
- /**
- * @param Account $account
- *
- * @return RedirectResponse|\Illuminate\Routing\Redirector
- * @codeCoverageIgnore
- */
- protected function redirectToOriginalAccount(Account $account)
- {
- /** @var Transaction $transaction */
- $transaction = $account->transactions()->first();
- if (null === $transaction) {
- app('session')->flash('error', trans('firefly.account_missing_transaction', ['name' => e($account->name), 'id' => $account->id]));
- Log::error(sprintf('Expected a transaction. Account #%d has none. BEEP, error.', $account->id));
-
- return redirect(route('index'));
- }
-
- $journal = $transaction->transactionJournal;
- /** @var Transaction $opposingTransaction */
- $opposingTransaction = $journal->transactions()->where('transactions.id', '!=', $transaction->id)->first();
-
- if (null === $opposingTransaction) {
- app('session')->flash('error', trans('firefly.account_missing_transaction', ['name' => e($account->name), 'id' => $account->id]));
- Log::error(sprintf('Expected an opposing transaction. Account #%d has none. BEEP, error.', $account->id));
- }
-
- return redirect(route('accounts.show', [$opposingTransaction->account_id]));
- }
+ //
+ // /**
+ // * Redirect to asset account that transaction belongs to.
+ // *
+ // * @param TransactionGroup $group
+ // *
+ // * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
+ // * @codeCoverageIgnore
+ // */
+ // protected function redirectToAccount(TransactionGroup $group)
+ // {
+ // $journals = $group->transactionJournals;
+ // $first = $journals->first();
+ //
+ // if (null === $first) {
+ // return redirect(route('index'));
+ // }
+ //
+ //
+ // $valid = [AccountType::DEFAULT, AccountType::ASSET];
+ // $transactions = $journal->transactions;
+ // /** @var Transaction $transaction */
+ // foreach ($transactions as $transaction) {
+ // $account = $transaction->account;
+ // if (in_array($account->accountType->type, $valid, true)) {
+ // return redirect(route('accounts.show', [$account->id]));
+ // }
+ // }
+ // // @codeCoverageIgnoreStart
+ // session()->flash('error', (string)trans('firefly.cannot_redirect_to_account'));
+ //
+ // return redirect(route('index'));
+ // // @codeCoverageIgnoreEnd
+ // }
+ //
+ // /**
+ // * @param Account $account
+ // *
+ // * @return RedirectResponse|\Illuminate\Routing\Redirector
+ // * @codeCoverageIgnore
+ // */
+ // protected function redirectToOriginalAccount(Account $account)
+ // {
+ // /** @var Transaction $transaction */
+ // $transaction = $account->transactions()->first();
+ // if (null === $transaction) {
+ // app('session')->flash('error', trans('firefly.account_missing_transaction', ['name' => e($account->name), 'id' => $account->id]));
+ // Log::error(sprintf('Expected a transaction. Account #%d has none. BEEP, error.', $account->id));
+ //
+ // return redirect(route('index'));
+ // }
+ //
+ // $journal = $transaction->transactionJournal;
+ // /** @var Transaction $opposingTransaction */
+ // $opposingTransaction = $journal->transactions()->where('transactions.id', '!=', $transaction->id)->first();
+ //
+ // if (null === $opposingTransaction) {
+ // app('session')->flash('error', trans('firefly.account_missing_transaction', ['name' => e($account->name), 'id' => $account->id]));
+ // Log::error(sprintf('Expected an opposing transaction. Account #%d has none. BEEP, error.', $account->id));
+ // }
+ //
+ // return redirect(route('accounts.show', [$opposingTransaction->account_id]));
+ // }
/**
* @param string $identifier
diff --git a/app/Support/Import/JobConfiguration/Bunq/ChooseAccountsHandler.php b/app/Support/Import/JobConfiguration/Bunq/ChooseAccountsHandler.php
index 48bf73f351..c991c27777 100644
--- a/app/Support/Import/JobConfiguration/Bunq/ChooseAccountsHandler.php
+++ b/app/Support/Import/JobConfiguration/Bunq/ChooseAccountsHandler.php
@@ -154,6 +154,7 @@ class ChooseAccountsHandler implements BunqJobConfigurationInterface
/** @var AccountModel $localAccount */
foreach ($collection as $localAccount) {
$accountId = $localAccount->id;
+ // TODO we can use getAccountCurrency() instead
$currencyId = (int)$this->accountRepository->getMetaValue($localAccount, 'currency_id');
$currency = $this->getCurrency($currencyId);
$localAccounts[$accountId] = [
diff --git a/app/Support/Import/JobConfiguration/File/ConfigureMappingHandler.php b/app/Support/Import/JobConfiguration/File/ConfigureMappingHandler.php
index 9eedad889a..5e71b017ce 100644
--- a/app/Support/Import/JobConfiguration/File/ConfigureMappingHandler.php
+++ b/app/Support/Import/JobConfiguration/File/ConfigureMappingHandler.php
@@ -272,7 +272,7 @@ class ConfigureMappingHandler implements FileConfigurationInterface
*
* @return array
* @throws FireflyException
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
+ *
*/
public function getValuesForMapping(Reader $reader, array $config, array $columnConfig): array
{
diff --git a/app/Support/Import/JobConfiguration/File/ConfigureRolesHandler.php b/app/Support/Import/JobConfiguration/File/ConfigureRolesHandler.php
index 3d5c9ca4c4..a5fa035884 100644
--- a/app/Support/Import/JobConfiguration/File/ConfigureRolesHandler.php
+++ b/app/Support/Import/JobConfiguration/File/ConfigureRolesHandler.php
@@ -58,7 +58,7 @@ class ConfigureRolesHandler implements FileConfigurationInterface
* @param array $config
*
* @return MessageBag
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
+ *
*/
public function configurationComplete(array $config): MessageBag
{
diff --git a/app/Support/Import/JobConfiguration/Spectre/ChooseAccountsHandler.php b/app/Support/Import/JobConfiguration/Spectre/ChooseAccountsHandler.php
index 268c789c36..2255c29329 100644
--- a/app/Support/Import/JobConfiguration/Spectre/ChooseAccountsHandler.php
+++ b/app/Support/Import/JobConfiguration/Spectre/ChooseAccountsHandler.php
@@ -110,7 +110,7 @@ class ChooseAccountsHandler implements SpectreJobConfigurationInterface
*
* @return array
* @throws FireflyException
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
+ *
*/
public function getNextData(): array
{
@@ -157,6 +157,7 @@ class ChooseAccountsHandler implements SpectreJobConfigurationInterface
/** @var AccountModel $account */
foreach ($accounts as $account) {
$accountId = $account->id;
+ // TODO we can use getAccountCurrency() instead
$currencyId = (int)$this->accountRepository->getMetaValue($account, 'currency_id');
$currency = $this->getCurrency($currencyId);
$array[$accountId] = [
diff --git a/app/Support/Import/JobConfiguration/Ynab/SelectAccountsHandler.php b/app/Support/Import/JobConfiguration/Ynab/SelectAccountsHandler.php
index 1602a4de96..0c23723baa 100644
--- a/app/Support/Import/JobConfiguration/Ynab/SelectAccountsHandler.php
+++ b/app/Support/Import/JobConfiguration/Ynab/SelectAccountsHandler.php
@@ -127,6 +127,7 @@ class SelectAccountsHandler implements YnabJobConfigurationInterface
/** @var Account $account */
foreach ($ffAccounts as $account) {
$accountId = $account->id;
+ // TODO we can use getAccountCurrency() instead
$currencyId = (int)$this->accountRepository->getMetaValue($account, 'currency_id');
$currency = $this->getCurrency($currencyId);
$array[$accountId] = [
diff --git a/app/Support/Import/JobConfiguration/Ynab/SelectBudgetHandler.php b/app/Support/Import/JobConfiguration/Ynab/SelectBudgetHandler.php
index e04ea1b84c..cec0e7259b 100644
--- a/app/Support/Import/JobConfiguration/Ynab/SelectBudgetHandler.php
+++ b/app/Support/Import/JobConfiguration/Ynab/SelectBudgetHandler.php
@@ -170,6 +170,7 @@ class SelectBudgetHandler implements YnabJobConfigurationInterface
}
/** @var Account $account */
foreach ($this->accounts as $account) {
+ // TODO we can use getAccountCurrency() instead
$currencyId = (int)$this->accountRepository->getMetaValue($account, 'currency_id');
Log::debug(sprintf('Currency of %s is %d (looking for %d).', $account->name, $currencyId, $currency->id));
if ($currencyId === $currency->id) {
diff --git a/app/Support/Import/Placeholder/ImportTransaction.php b/app/Support/Import/Placeholder/ImportTransaction.php
index 2ae4d3b3f6..3882ba8066 100644
--- a/app/Support/Import/Placeholder/ImportTransaction.php
+++ b/app/Support/Import/Placeholder/ImportTransaction.php
@@ -132,7 +132,7 @@ class ImportTransaction
* @param ColumnValue $columnValue
*
* @throws FireflyException
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
+ *
*/
public function addColumnValue(ColumnValue $columnValue): void
{
diff --git a/app/Support/Import/Routine/File/AssetAccountMapper.php b/app/Support/Import/Routine/File/AssetAccountMapper.php
index fa4ead0ad3..1ed799959f 100644
--- a/app/Support/Import/Routine/File/AssetAccountMapper.php
+++ b/app/Support/Import/Routine/File/AssetAccountMapper.php
@@ -60,7 +60,7 @@ class AssetAccountMapper
* @param array $data
*
* @return Account
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
+ *
*/
public function map(?int $accountId, array $data): Account
{
diff --git a/app/Support/Import/Routine/File/MappedValuesValidator.php b/app/Support/Import/Routine/File/MappedValuesValidator.php
index c0bc90c704..ba0833aa23 100644
--- a/app/Support/Import/Routine/File/MappedValuesValidator.php
+++ b/app/Support/Import/Routine/File/MappedValuesValidator.php
@@ -81,7 +81,7 @@ class MappedValuesValidator
*
* @return array
* @throws FireflyException
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
+ *
*/
public function validate(array $mappings): array
{
diff --git a/app/Support/Import/Routine/File/OpposingAccountMapper.php b/app/Support/Import/Routine/File/OpposingAccountMapper.php
index 817f45d54b..c65c35c6f0 100644
--- a/app/Support/Import/Routine/File/OpposingAccountMapper.php
+++ b/app/Support/Import/Routine/File/OpposingAccountMapper.php
@@ -45,7 +45,7 @@ class OpposingAccountMapper
* @param array $data
*
* @return Account
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
+ *
*/
public function map(?int $accountId, string $amount, array $data): Account
{
diff --git a/app/Support/Import/Routine/Spectre/StageImportDataHandler.php b/app/Support/Import/Routine/Spectre/StageImportDataHandler.php
index e0849fff7d..f63618b648 100644
--- a/app/Support/Import/Routine/Spectre/StageImportDataHandler.php
+++ b/app/Support/Import/Routine/Spectre/StageImportDataHandler.php
@@ -108,7 +108,7 @@ class StageImportDataHandler
* @param LocalAccount $originalSource
*
* @return array
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
+ *
*/
private function convertToArray(array $transactions, SpectreAccount $spectreAccount, LocalAccount $originalSource): array
{
diff --git a/app/Support/Navigation.php b/app/Support/Navigation.php
index 1850087b94..66209f668f 100644
--- a/app/Support/Navigation.php
+++ b/app/Support/Navigation.php
@@ -25,6 +25,7 @@ namespace FireflyIII\Support;
use Carbon\Carbon;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Helpers\Fiscal\FiscalHelperInterface;
+use Log;
/**
* Class Navigation.
@@ -37,8 +38,6 @@ class Navigation
* @param $skip
*
* @return \Carbon\Carbon
- *
- * @throws \FireflyIII\Exceptions\FireflyException
*/
public function addPeriod(Carbon $theDate, string $repeatFreq, int $skip): Carbon
{
@@ -73,7 +72,9 @@ class Navigation
];
if (!isset($functionMap[$repeatFreq])) {
- throw new FireflyException(sprintf('Cannot do addPeriod for $repeat_freq "%s"', $repeatFreq));
+ Log::error(sprintf('Cannot do addPeriod for $repeat_freq "%s"', $repeatFreq));
+
+ return $theDate;
}
if (isset($modifierMap[$repeatFreq])) {
$add *= $modifierMap[$repeatFreq];
@@ -103,7 +104,7 @@ class Navigation
*
* @return array
* @throws \FireflyIII\Exceptions\FireflyException
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
+ *
*/
public function blockPeriods(\Carbon\Carbon $start, \Carbon\Carbon $end, string $range): array
{
@@ -169,8 +170,6 @@ class Navigation
* @param $repeatFreq
*
* @return \Carbon\Carbon
- *
- * @throws \FireflyIII\Exceptions\FireflyException
*/
public function endOfPeriod(\Carbon\Carbon $end, string $repeatFreq): Carbon
{
@@ -220,7 +219,9 @@ class Navigation
if (!isset($functionMap[$repeatFreq])) {
- throw new FireflyException(sprintf('Cannot do endOfPeriod for $repeat_freq "%s"', $repeatFreq));
+ Log::error(sprintf('Cannot do endOfPeriod for $repeat_freq "%s"', $repeatFreq));
+
+ return $end;
}
$function = $functionMap[$repeatFreq];
@@ -323,8 +324,6 @@ class Navigation
* @param string $repeatFrequency
*
* @return string
- *
- * @throws \FireflyIII\Exceptions\FireflyException
*/
public function periodShow(\Carbon\Carbon $theDate, string $repeatFrequency): string
{
@@ -355,7 +354,10 @@ class Navigation
}
// special formatter for quarter of year
- throw new FireflyException(sprintf('No date formats for frequency "%s"!', $repeatFrequency));
+ Log::error(sprintf('No date formats for frequency "%s"!', $repeatFrequency));
+
+ return $date->format('Y-m-d');
+
}
/**
@@ -478,8 +480,6 @@ class Navigation
* @param $repeatFreq
*
* @return \Carbon\Carbon
- *
- * @throws \FireflyIII\Exceptions\FireflyException
*/
public function startOfPeriod(Carbon $theDate, string $repeatFreq): Carbon
{
@@ -520,8 +520,10 @@ class Navigation
if ('custom' === $repeatFreq) {
return $date; // the date is already at the start.
}
+ Log::error(sprintf('Cannot do startOfPeriod for $repeat_freq "%s"', $repeatFreq));
+
+ return $theDate;
- throw new FireflyException(sprintf('Cannot do startOfPeriod for $repeat_freq "%s"', $repeatFreq));
}
/**
diff --git a/app/Support/NullArrayObject.php b/app/Support/NullArrayObject.php
index a7d9fe98b1..eaa7978555 100644
--- a/app/Support/NullArrayObject.php
+++ b/app/Support/NullArrayObject.php
@@ -59,4 +59,4 @@ class NullArrayObject extends ArrayObject
return null;
}
-}
\ No newline at end of file
+}
diff --git a/app/Support/Repositories/Recurring/CalculateRangeOccurrences.php b/app/Support/Repositories/Recurring/CalculateRangeOccurrences.php
index aab5bf92ec..3662fa1622 100644
--- a/app/Support/Repositories/Recurring/CalculateRangeOccurrences.php
+++ b/app/Support/Repositories/Recurring/CalculateRangeOccurrences.php
@@ -32,7 +32,7 @@ use Illuminate\Support\Facades\Log;
*/
trait CalculateRangeOccurrences
{
- /** @noinspection MoreThanThreeArgumentsInspection */
+
/**
* Get the number of daily occurrences for a recurring transaction until date $end is reached. Will skip every $skipMod-1 occurrences.
*
@@ -60,7 +60,7 @@ trait CalculateRangeOccurrences
return $return;
}
- /** @noinspection MoreThanThreeArgumentsInspection */
+
/**
* Get the number of daily occurrences for a recurring transaction until date $end is reached. Will skip every $skipMod-1 occurrences.
*
@@ -70,7 +70,7 @@ trait CalculateRangeOccurrences
* @param string $moment
*
* @return array
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
+ *
*/
protected function getMonthlyInRange(Carbon $start, Carbon $end, int $skipMod, string $moment): array
{
@@ -107,7 +107,7 @@ trait CalculateRangeOccurrences
return $return;
}
- /** @noinspection MoreThanThreeArgumentsInspection */
+
/**
* Get the number of daily occurrences for a recurring transaction until date $end is reached. Will skip every $skipMod-1 occurrences.
@@ -150,7 +150,7 @@ trait CalculateRangeOccurrences
* @param string $moment
*
* @return array
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
+ *
*/
protected function getWeeklyInRange(Carbon $start, Carbon $end, int $skipMod, string $moment): array
{
@@ -194,7 +194,7 @@ trait CalculateRangeOccurrences
* @param string $moment
*
* @return array
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
+ *
*/
protected function getYearlyInRange(Carbon $start, Carbon $end, int $skipMod, string $moment): array
{
diff --git a/app/Support/Repositories/Recurring/CalculateXOccurrences.php b/app/Support/Repositories/Recurring/CalculateXOccurrences.php
index 3404cf0cad..7f223c5cca 100644
--- a/app/Support/Repositories/Recurring/CalculateXOccurrences.php
+++ b/app/Support/Repositories/Recurring/CalculateXOccurrences.php
@@ -32,7 +32,7 @@ use Carbon\Carbon;
*/
trait CalculateXOccurrences
{
- /** @noinspection MoreThanThreeArgumentsInspection */
+
/**
* Calculates the number of daily occurrences for a recurring transaction, starting at the date, until $count is reached. It will skip
* over $skipMod -1 recurrences.
@@ -61,7 +61,7 @@ trait CalculateXOccurrences
return $return;
}
- /** @noinspection MoreThanThreeArgumentsInspection */
+
/**
* Calculates the number of monthly occurrences for a recurring transaction, starting at the date, until $count is reached. It will skip
@@ -100,7 +100,7 @@ trait CalculateXOccurrences
return $return;
}
- /** @noinspection MoreThanThreeArgumentsInspection */
+
/**
* Calculates the number of NDOM occurrences for a recurring transaction, starting at the date, until $count is reached. It will skip
* over $skipMod -1 recurrences.
@@ -139,7 +139,7 @@ trait CalculateXOccurrences
return $return;
}
- /** @noinspection MoreThanThreeArgumentsInspection */
+
/**
* Calculates the number of weekly occurrences for a recurring transaction, starting at the date, until $count is reached. It will skip
@@ -183,7 +183,7 @@ trait CalculateXOccurrences
return $return;
}
- /** @noinspection MoreThanThreeArgumentsInspection */
+
/**
* Calculates the number of yearly occurrences for a recurring transaction, starting at the date, until $count is reached. It will skip
diff --git a/app/Support/Repositories/Recurring/FiltersWeekends.php b/app/Support/Repositories/Recurring/FiltersWeekends.php
index 3c91f1947f..83d5be55cc 100644
--- a/app/Support/Repositories/Recurring/FiltersWeekends.php
+++ b/app/Support/Repositories/Recurring/FiltersWeekends.php
@@ -42,8 +42,8 @@ trait FiltersWeekends
* @param array $dates
*
* @return array
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
- * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ *
+ *
*/
protected function filterWeekends(RecurrenceRepetition $repetition, array $dates): array
{
diff --git a/app/Support/Search/Search.php b/app/Support/Search/Search.php
index 7d62c2cff7..32ac58a3eb 100644
--- a/app/Support/Search/Search.php
+++ b/app/Support/Search/Search.php
@@ -181,7 +181,7 @@ class Search implements SearchInterface
* @param GroupCollectorInterface $collector
*
* @return GroupCollectorInterface
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
+ *
*/
private function applyModifiers(GroupCollectorInterface $collector): GroupCollectorInterface
{
diff --git a/app/Support/Twig/AmountFormat.php b/app/Support/Twig/AmountFormat.php
index ad712e781f..2e75a264fd 100644
--- a/app/Support/Twig/AmountFormat.php
+++ b/app/Support/Twig/AmountFormat.php
@@ -122,8 +122,8 @@ class AmountFormat extends Twig_Extension
{
return new Twig_SimpleFunction(
'formatAmountBySymbol',
- /** @noinspection MoreThanThreeArgumentsInspection */
- function (string $amount, string $symbol, int $decimalPlaces = null, bool $coloured = null): string {
+
+ static function (string $amount, string $symbol, int $decimalPlaces = null, bool $coloured = null): string {
$decimalPlaces = $decimalPlaces ?? 2;
$coloured = $coloured ?? true;
$currency = new TransactionCurrency;
diff --git a/app/Support/Twig/TransactionGroupTwig.php b/app/Support/Twig/TransactionGroupTwig.php
index 65b459e83d..4d1c91238e 100644
--- a/app/Support/Twig/TransactionGroupTwig.php
+++ b/app/Support/Twig/TransactionGroupTwig.php
@@ -21,7 +21,7 @@
declare(strict_types=1);
-namespace FireflyIII\Support\Twig\Extension;
+namespace FireflyIII\Support\Twig;
use Carbon\Carbon;
use DB;
@@ -330,4 +330,4 @@ class TransactionGroupTwig extends Twig_Extension
return null !== $first->foreign_amount;
}
-}
\ No newline at end of file
+}
diff --git a/app/TransactionRules/Actions/ClearNotes.php b/app/TransactionRules/Actions/ClearNotes.php
index 7b83617770..b5f4f1a114 100644
--- a/app/TransactionRules/Actions/ClearNotes.php
+++ b/app/TransactionRules/Actions/ClearNotes.php
@@ -22,6 +22,7 @@ declare(strict_types=1);
namespace FireflyIII\TransactionRules\Actions;
+use Exception;
use FireflyIII\Models\Note;
use FireflyIII\Models\RuleAction;
use FireflyIII\Models\TransactionJournal;
@@ -47,7 +48,7 @@ class ClearNotes implements ActionInterface
* @param TransactionJournal $journal
*
* @return bool
- * @throws \Exception
+ * @throws Exception
*/
public function act(TransactionJournal $journal): bool
{
diff --git a/app/TransactionRules/Actions/ConvertToDeposit.php b/app/TransactionRules/Actions/ConvertToDeposit.php
index f06ce92b41..a5b49ee83c 100644
--- a/app/TransactionRules/Actions/ConvertToDeposit.php
+++ b/app/TransactionRules/Actions/ConvertToDeposit.php
@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\TransactionRules\Actions;
+use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Factory\AccountFactory;
use FireflyIII\Models\Account;
use FireflyIII\Models\AccountType;
@@ -57,7 +58,7 @@ class ConvertToDeposit implements ActionInterface
* @param TransactionJournal $journal
*
* @return bool
- * @throws \FireflyIII\Exceptions\FireflyException
+ * @throws FireflyException
*/
public function act(TransactionJournal $journal): bool
{
@@ -121,7 +122,7 @@ class ConvertToDeposit implements ActionInterface
* @param TransactionJournal $journal
*
* @return bool
- * @throws \FireflyIII\Exceptions\FireflyException
+ * @throws FireflyException
*/
private function convertTransfer(TransactionJournal $journal): bool
{
@@ -163,7 +164,7 @@ class ConvertToDeposit implements ActionInterface
* @param TransactionJournal $journal
*
* @return bool
- * @throws \FireflyIII\Exceptions\FireflyException
+ * @throws FireflyException
*/
private function convertWithdrawal(TransactionJournal $journal): bool
{
diff --git a/app/TransactionRules/Actions/ConvertToWithdrawal.php b/app/TransactionRules/Actions/ConvertToWithdrawal.php
index 3729ec340a..63546b2d65 100644
--- a/app/TransactionRules/Actions/ConvertToWithdrawal.php
+++ b/app/TransactionRules/Actions/ConvertToWithdrawal.php
@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\TransactionRules\Actions;
+use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Factory\AccountFactory;
use FireflyIII\Models\Account;
use FireflyIII\Models\AccountType;
@@ -58,7 +59,7 @@ class ConvertToWithdrawal implements ActionInterface
* @param TransactionJournal $journal
*
* @return bool
- * @throws \FireflyIII\Exceptions\FireflyException
+ * @throws FireflyException
*/
public function act(TransactionJournal $journal): bool
{
@@ -122,7 +123,7 @@ class ConvertToWithdrawal implements ActionInterface
* @param TransactionJournal $journal
*
* @return bool
- * @throws \FireflyIII\Exceptions\FireflyException
+ * @throws FireflyException
*/
private function convertDeposit(TransactionJournal $journal): bool
{
@@ -175,7 +176,7 @@ class ConvertToWithdrawal implements ActionInterface
* @param TransactionJournal $journal
*
* @return bool
- * @throws \FireflyIII\Exceptions\FireflyException
+ * @throws FireflyException
*/
private function convertTransfer(TransactionJournal $journal): bool
{
diff --git a/app/TransactionRules/Actions/RemoveTag.php b/app/TransactionRules/Actions/RemoveTag.php
index 186bc3f739..301a34baad 100644
--- a/app/TransactionRules/Actions/RemoveTag.php
+++ b/app/TransactionRules/Actions/RemoveTag.php
@@ -23,7 +23,6 @@ declare(strict_types=1);
namespace FireflyIII\TransactionRules\Actions;
use FireflyIII\Models\RuleAction;
-use FireflyIII\Models\Tag;
use FireflyIII\Models\TransactionJournal;
use Log;
@@ -47,6 +46,7 @@ class RemoveTag implements ActionInterface
/**
* Remove tag X
+ *
* @param TransactionJournal $journal
*
* @return bool
@@ -55,7 +55,7 @@ class RemoveTag implements ActionInterface
{
// if tag does not exist, no need to continue:
$name = $this->action->action_value;
- $tag = $journal->user->tags()->where('tag', $name)->first();
+ $tag = $journal->user->tags()->where('tag', $name)->first();
if (null !== $tag) {
Log::debug(sprintf('RuleAction RemoveTag removed tag #%d ("%s") from journal #%d.', $tag->id, $tag->tag, $journal->id));
diff --git a/app/TransactionRules/Actions/SetBudget.php b/app/TransactionRules/Actions/SetBudget.php
index 94e85cb570..2782647000 100644
--- a/app/TransactionRules/Actions/SetBudget.php
+++ b/app/TransactionRules/Actions/SetBudget.php
@@ -47,13 +47,14 @@ class SetBudget implements ActionInterface
/**
* Set budget.
+ *
* @param TransactionJournal $journal
*
* @return bool
*/
public function act(TransactionJournal $journal): bool
{
- $search = $this->action->action_value;
+ $search = $this->action->action_value;
$budget = $journal->user->budgets()->where('name', $search)->first();
if (null === $budget) {
diff --git a/app/TransactionRules/Actions/SetCategory.php b/app/TransactionRules/Actions/SetCategory.php
index 04b1c77d23..6daeef7fba 100644
--- a/app/TransactionRules/Actions/SetCategory.php
+++ b/app/TransactionRules/Actions/SetCategory.php
@@ -24,7 +24,6 @@ namespace FireflyIII\TransactionRules\Actions;
use FireflyIII\Factory\CategoryFactory;
use FireflyIII\Models\RuleAction;
-use FireflyIII\Models\Transaction;
use FireflyIII\Models\TransactionJournal;
use Log;
diff --git a/app/TransactionRules/Actions/SetDestinationAccount.php b/app/TransactionRules/Actions/SetDestinationAccount.php
index 885fc6e2ff..fc9e03b411 100644
--- a/app/TransactionRules/Actions/SetDestinationAccount.php
+++ b/app/TransactionRules/Actions/SetDestinationAccount.php
@@ -133,9 +133,9 @@ class SetDestinationAccount implements ActionInterface
if (null === $account) {
$data = [
'name' => $this->action->action_value,
- 'account_type' => 'expense',
+ 'account_type' => 'expense',
'account_type_id' => null,
- 'virtual_balance' => 0,
+ 'virtual_balance' => 0,
'active' => true,
'iban' => null,
];
diff --git a/app/TransactionRules/Actions/SetSourceAccount.php b/app/TransactionRules/Actions/SetSourceAccount.php
index 9622f4ea4e..a131be87f3 100644
--- a/app/TransactionRules/Actions/SetSourceAccount.php
+++ b/app/TransactionRules/Actions/SetSourceAccount.php
@@ -137,9 +137,9 @@ class SetSourceAccount implements ActionInterface
// create new revenue account with this name:
$data = [
'name' => $this->action->action_value,
- 'account_type' => 'revenue',
+ 'account_type' => 'revenue',
'account_type_id' => null,
- 'virtual_balance' => 0,
+ 'virtual_balance' => 0,
'active' => true,
'iban' => null,
];
diff --git a/app/TransactionRules/Engine/RuleEngine.php b/app/TransactionRules/Engine/RuleEngine.php
index aa58ff754d..537322de1c 100644
--- a/app/TransactionRules/Engine/RuleEngine.php
+++ b/app/TransactionRules/Engine/RuleEngine.php
@@ -1,4 +1,5 @@
triggerMode = self::TRIGGER_STORE;
}
- /**
- * @param int $triggerMode
- */
- public function setTriggerMode(int $triggerMode): void
- {
- $this->triggerMode = $triggerMode;
- }
-
- /**
- * @param bool $allRules
- */
- public function setAllRules(bool $allRules): void
- {
- Log::debug('RuleEngine will apply ALL rules.');
- $this->allRules = $allRules;
- }
-
-
- /**
- * @param array $rulesToApply
- */
- public function setRulesToApply(array $rulesToApply): void
- {
- Log::debug('RuleEngine will try rules', $rulesToApply);
- $this->rulesToApply = $rulesToApply;
- }
-
- /**
- * @param User $user
- */
- public function setUser(User $user): void
- {
- $this->user = $user;
- $this->ruleGroupRepository->setUser($user);
- $this->ruleGroups = $this->ruleGroupRepository->getActiveGroups();
- }
-
- /**
- * @param TransactionJournal $transactionJournal
- */
- public function processTransactionJournal(TransactionJournal $transactionJournal): void
- {
- Log::debug(sprintf('Will process transaction journal #%d ("%s")', $transactionJournal->id, $transactionJournal->description));
- /** @var RuleGroup $group */
- foreach ($this->ruleGroups as $group) {
- Log::debug(sprintf('Now at rule group #%d', $group->id));
- $groupTriggered = false;
- /** @var Rule $rule */
- foreach ($group->rules as $rule) {
- Log::debug(sprintf('Now at rule #%d from rule group #%d', $rule->id, $group->id));
- $ruleTriggered = false;
- // if in rule selection, or group in selection or all rules, it's included.
- if ($this->includeRule($rule)) {
- Log::debug(sprintf('Rule #%d is included.', $rule->id));
- /** @var Processor $processor */
- $processor = app(Processor::class);
- $ruleTriggered = false;
- try {
- $processor->make($rule, true);
- $ruleTriggered = $processor->handleTransactionJournal($transactionJournal);
- } catch (FireflyException $e) {
- Log::error($e->getMessage());
- }
-
- if ($ruleTriggered) {
- Log::debug('The rule was triggered, so the group is as well!');
- $groupTriggered = true;
- }
- }
- if (!$this->includeRule($rule)) {
- Log::debug(sprintf('Rule #%d is not included.', $rule->id));
- }
-
- // if the rule is triggered and stop processing is true, cancel the entire group.
- if ($ruleTriggered && $rule->stop_processing) {
- Log::info(sprintf('Break out group #%d because rule #%d was triggered.', $group->id, $rule->id));
- break;
- }
- }
- // if group is triggered and stop processing is true, cancel the whole thing.
- if ($groupTriggered && $group->stop_processing) {
- Log::info(sprintf('Break out ALL because group #%d was triggered.', $group->id));
- break;
- }
- }
- Log::debug('Done processing this transaction journal.');
- }
-
/**
* @param array $journal
*/
@@ -212,8 +124,96 @@ class RuleEngine
Log::debug('Done processing this transaction journal.');
}
+ /**
+ * @param TransactionJournal $transactionJournal
+ */
+ public function processTransactionJournal(TransactionJournal $transactionJournal): void
+ {
+ Log::debug(sprintf('Will process transaction journal #%d ("%s")', $transactionJournal->id, $transactionJournal->description));
+ /** @var RuleGroup $group */
+ foreach ($this->ruleGroups as $group) {
+ Log::debug(sprintf('Now at rule group #%d', $group->id));
+ $groupTriggered = false;
+ /** @var Rule $rule */
+ foreach ($group->rules as $rule) {
+ Log::debug(sprintf('Now at rule #%d from rule group #%d', $rule->id, $group->id));
+ $ruleTriggered = false;
+ // if in rule selection, or group in selection or all rules, it's included.
+ if ($this->includeRule($rule)) {
+ Log::debug(sprintf('Rule #%d is included.', $rule->id));
+ /** @var Processor $processor */
+ $processor = app(Processor::class);
+ $ruleTriggered = false;
+ try {
+ $processor->make($rule, true);
+ $ruleTriggered = $processor->handleTransactionJournal($transactionJournal);
+ } catch (FireflyException $e) {
+ Log::error($e->getMessage());
+ }
+
+ if ($ruleTriggered) {
+ Log::debug('The rule was triggered, so the group is as well!');
+ $groupTriggered = true;
+ }
+ }
+ if (!$this->includeRule($rule)) {
+ Log::debug(sprintf('Rule #%d is not included.', $rule->id));
+ }
+
+ // if the rule is triggered and stop processing is true, cancel the entire group.
+ if ($ruleTriggered && $rule->stop_processing) {
+ Log::info(sprintf('Break out group #%d because rule #%d was triggered.', $group->id, $rule->id));
+ break;
+ }
+ }
+ // if group is triggered and stop processing is true, cancel the whole thing.
+ if ($groupTriggered && $group->stop_processing) {
+ Log::info(sprintf('Break out ALL because group #%d was triggered.', $group->id));
+ break;
+ }
+ }
+ Log::debug('Done processing this transaction journal.');
+ }
+
+ /**
+ * @param bool $allRules
+ */
+ public function setAllRules(bool $allRules): void
+ {
+ Log::debug('RuleEngine will apply ALL rules.');
+ $this->allRules = $allRules;
+ }
+
+ /**
+ * @param array $rulesToApply
+ */
+ public function setRulesToApply(array $rulesToApply): void
+ {
+ Log::debug('RuleEngine will try rules', $rulesToApply);
+ $this->rulesToApply = $rulesToApply;
+ }
+
+ /**
+ * @param int $triggerMode
+ */
+ public function setTriggerMode(int $triggerMode): void
+ {
+ $this->triggerMode = $triggerMode;
+ }
+
+ /**
+ * @param User $user
+ */
+ public function setUser(User $user): void
+ {
+ $this->user = $user;
+ $this->ruleGroupRepository->setUser($user);
+ $this->ruleGroups = $this->ruleGroupRepository->getActiveGroups();
+ }
+
/**
* @param Rule $rule
+ *
* @return bool
*/
private function includeRule(Rule $rule): bool
@@ -224,10 +224,10 @@ class RuleEngine
return false;
}
- $validTrigger = ('store-journal' === $trigger->trigger_value && self::TRIGGER_STORE === $this->triggerMode) ||
- ('update-journal' === $trigger->trigger_value && self::TRIGGER_UPDATE === $this->triggerMode);
+ $validTrigger = ('store-journal' === $trigger->trigger_value && self::TRIGGER_STORE === $this->triggerMode)
+ || ('update-journal' === $trigger->trigger_value && self::TRIGGER_UPDATE === $this->triggerMode);
return $validTrigger && ($this->allRules || in_array($rule->id, $this->rulesToApply, true));
}
-}
\ No newline at end of file
+}
diff --git a/app/TransactionRules/Factory/TriggerFactory.php b/app/TransactionRules/Factory/TriggerFactory.php
index 4d5c10e69e..9af587d3c9 100644
--- a/app/TransactionRules/Factory/TriggerFactory.php
+++ b/app/TransactionRules/Factory/TriggerFactory.php
@@ -78,11 +78,11 @@ class TriggerFactory
* @param string $triggerValue
* @param bool $stopProcessing
*
- * @see TriggerFactory::getTrigger
- *
* @return AbstractTrigger
*
* @throws FireflyException
+ * @see TriggerFactory::getTrigger
+ *
*/
public static function makeTriggerFromStrings(string $triggerType, string $triggerValue, bool $stopProcessing): AbstractTrigger
{
diff --git a/app/TransactionRules/Processor.php b/app/TransactionRules/Processor.php
index e57a655801..225de82a3d 100644
--- a/app/TransactionRules/Processor.php
+++ b/app/TransactionRules/Processor.php
@@ -22,6 +22,7 @@ declare(strict_types=1);
namespace FireflyIII\TransactionRules;
+use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Models\Rule;
use FireflyIII\Models\RuleAction;
use FireflyIII\Models\RuleTrigger;
@@ -62,16 +63,71 @@ class Processor
$this->actions = new Collection;
}
+ /**
+ * Return found triggers
+ *
+ * @return int
+ */
+ public function getFoundTriggers(): int
+ {
+ return $this->foundTriggers;
+ }
+
+ /**
+ * Set found triggers
+ *
+ * @param int $foundTriggers
+ */
+ public function setFoundTriggers(int $foundTriggers): void
+ {
+ $this->foundTriggers = $foundTriggers;
+ }
+
/**
* Returns the rule
*
- * @return \FireflyIII\Models\Rule
+ * @return Rule
*/
public function getRule(): Rule
{
return $this->rule;
}
+ /**
+ * This method will scan the given transaction journal and check if it matches the triggers found in the Processor
+ * If so, it will also attempt to run the given actions on the journal. It returns a bool indicating if the transaction journal
+ * matches all of the triggers (regardless of whether the Processor could act on it).
+ *
+ * @param array $journal
+ *
+ * @return bool
+ * @throws FireflyException
+ */
+ public function handleJournalArray(array $journal): bool
+ {
+
+ Log::debug(sprintf('handleJournalArray for journal #%d (group #%d)', $journal['transaction_journal_id'], $journal['transaction_group_id']));
+
+ // grab the actual journal.
+ $this->journal = TransactionJournal::find($journal['transaction_journal_id']);
+ // get all triggers:
+ $triggered = $this->triggered();
+ if ($triggered) {
+ Log::debug('Rule is triggered, go to actions.');
+ if ($this->actions->count() > 0) {
+ Log::debug('Has more than zero actions.');
+ $this->actions();
+ }
+ if (0 === $this->actions->count()) {
+ Log::info('Rule has no actions!');
+ }
+
+ return true;
+ }
+
+ return false;
+ }
+
/**
* This method will scan the given transaction journal and check if it matches the triggers found in the Processor
* If so, it will also attempt to run the given actions on the journal. It returns a bool indicating if the transaction journal
@@ -80,7 +136,7 @@ class Processor
* @param Transaction $transaction
*
* @return bool
- * @throws \FireflyIII\Exceptions\FireflyException
+ * @throws FireflyException
*/
public function handleTransaction(Transaction $transaction): bool
{
@@ -107,6 +163,140 @@ class Processor
return false;
}
+ /**
+ * This method will scan the given transaction journal and check if it matches the triggers found in the Processor
+ * If so, it will also attempt to run the given actions on the journal. It returns a bool indicating if the transaction journal
+ * matches all of the triggers (regardless of whether the Processor could act on it).
+ *
+ * @param TransactionJournal $journal
+ *
+ * @return bool
+ * @throws FireflyException
+ */
+ public function handleTransactionJournal(TransactionJournal $journal): bool
+ {
+ Log::debug(sprintf('handleTransactionJournal for journal %d', $journal->id));
+ $this->journal = $journal;
+ // get all triggers:
+ $triggered = $this->triggered();
+ if ($triggered) {
+ if ($this->actions->count() > 0) {
+ $this->actions();
+ }
+
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * @return bool
+ */
+ public function isStrict(): bool
+ {
+ return $this->strict;
+ }
+
+ /**
+ * @param bool $strict
+ */
+ public function setStrict(bool $strict): void
+ {
+ $this->strict = $strict;
+ }
+
+ /**
+ * This method will make a Processor that will process each transaction journal using the triggers
+ * and actions found in the given Rule.
+ *
+ * @param Rule $rule
+ * @param bool $includeActions
+ *
+ * @throws FireflyException
+ */
+ public function make(Rule $rule, bool $includeActions = null): void
+ {
+ $includeActions = $includeActions ?? true;
+ Log::debug(sprintf('Making new rule from Rule %d', $rule->id));
+ Log::debug(sprintf('Rule is strict: %s', var_export($rule->strict, true)));
+ $this->rule = $rule;
+ $this->strict = $rule->strict;
+ $triggerSet = $rule->ruleTriggers()->orderBy('order', 'ASC')->get();
+ /** @var RuleTrigger $trigger */
+ foreach ($triggerSet as $trigger) {
+ Log::debug(sprintf('Push trigger %d', $trigger->id));
+ $this->triggers->push(TriggerFactory::getTrigger($trigger));
+ }
+ if (true === $includeActions) {
+ $this->actions = $rule->ruleActions()->orderBy('order', 'ASC')->get();
+ }
+ }
+
+ /**
+ * This method will make a Processor that will process each transaction journal using the given
+ * trigger (singular!). It can only report if the transaction journal was hit by the given trigger
+ * and will not be able to act on it using actions.
+ *
+ * @param string $triggerName
+ * @param string $triggerValue
+ *
+ * @throws FireflyException
+ */
+ public function makeFromString(string $triggerName, string $triggerValue): void
+ {
+ Log::debug(sprintf('Processor::makeFromString("%s", "%s")', $triggerName, $triggerValue));
+ $trigger = TriggerFactory::makeTriggerFromStrings($triggerName, $triggerValue, false);
+ $this->triggers->push($trigger);
+ }
+
+ /**
+ * This method will make a Processor that will process each transaction journal using the given
+ * triggers. It can only report if the transaction journal was hit by the given triggers
+ * and will not be able to act on it using actions.
+ *
+ * The given triggers must be in the following format:
+ *
+ * [type => xx, value => yy, stop_processing => bool], [type => xx, value => yy, stop_processing => bool],
+ *
+ * @param array $triggers
+ *
+ * @throws FireflyException
+ */
+ public function makeFromStringArray(array $triggers): void
+ {
+ foreach ($triggers as $entry) {
+ $entry['value'] = $entry['value'] ?? '';
+ $trigger = TriggerFactory::makeTriggerFromStrings($entry['type'], $entry['value'], $entry['stop_processing']);
+ $this->triggers->push($trigger);
+ }
+
+ }
+
+ /**
+ * Run the actions
+ *
+ * @return void
+ * @throws FireflyException
+ */
+ private function actions(): void
+ {
+ /**
+ * @var int
+ * @var RuleAction $action
+ */
+ foreach ($this->actions as $action) {
+ /** @var ActionInterface $actionClass */
+ $actionClass = ActionFactory::getAction($action);
+ Log::debug(sprintf('Fire action %s on journal #%d', get_class($actionClass), $this->journal->id));
+ $actionClass->act($this->journal);
+ if ($action->stop_processing) {
+ Log::debug('Stop processing now and break.');
+ break;
+ }
+ }
+ }
+
/**
* Method to check whether the current transaction would be triggered
* by the given list of triggers.
@@ -147,193 +337,4 @@ class Processor
return $result;
}
-
- /**
- * Return found triggers
- *
- * @return int
- */
- public function getFoundTriggers(): int
- {
- return $this->foundTriggers;
- }
-
- /**
- * Set found triggers
- *
- * @param int $foundTriggers
- */
- public function setFoundTriggers(int $foundTriggers): void
- {
- $this->foundTriggers = $foundTriggers;
- }
-
- /**
- * Run the actions
- *
- * @return void
- * @throws \FireflyIII\Exceptions\FireflyException
- */
- private function actions(): void
- {
- /**
- * @var int
- * @var RuleAction $action
- */
- foreach ($this->actions as $action) {
- /** @var ActionInterface $actionClass */
- $actionClass = ActionFactory::getAction($action);
- Log::debug(sprintf('Fire action %s on journal #%d', get_class($actionClass), $this->journal->id));
- $actionClass->act($this->journal);
- if ($action->stop_processing) {
- Log::debug('Stop processing now and break.');
- break;
- }
- }
- }
-
- /**
- * This method will scan the given transaction journal and check if it matches the triggers found in the Processor
- * If so, it will also attempt to run the given actions on the journal. It returns a bool indicating if the transaction journal
- * matches all of the triggers (regardless of whether the Processor could act on it).
- *
- * @param array $journal
- *
- * @return bool
- * @throws \FireflyIII\Exceptions\FireflyException
- */
- public function handleJournalArray(array $journal): bool
- {
-
- Log::debug(sprintf('handleJournalArray for journal #%d (group #%d)', $journal['transaction_journal_id'], $journal['transaction_group_id']));
-
- // grab the actual journal.
- $this->journal = TransactionJournal::find($journal['transaction_journal_id']);
- // get all triggers:
- $triggered = $this->triggered();
- if ($triggered) {
- Log::debug('Rule is triggered, go to actions.');
- if ($this->actions->count() > 0) {
- Log::debug('Has more than zero actions.');
- $this->actions();
- }
- if (0 === $this->actions->count()) {
- Log::info('Rule has no actions!');
- }
-
- return true;
- }
-
- return false;
- }
-
- /**
- * This method will scan the given transaction journal and check if it matches the triggers found in the Processor
- * If so, it will also attempt to run the given actions on the journal. It returns a bool indicating if the transaction journal
- * matches all of the triggers (regardless of whether the Processor could act on it).
- *
- * @param TransactionJournal $journal
- *
- * @return bool
- * @throws \FireflyIII\Exceptions\FireflyException
- */
- public function handleTransactionJournal(TransactionJournal $journal): bool
- {
- Log::debug(sprintf('handleTransactionJournal for journal %d', $journal->id));
- $this->journal = $journal;
- // get all triggers:
- $triggered = $this->triggered();
- if ($triggered) {
- if ($this->actions->count() > 0) {
- $this->actions();
- }
-
- return true;
- }
-
- return false;
- }
-
- /**
- * @return bool
- */
- public function isStrict(): bool
- {
- return $this->strict;
- }
-
- /**
- * @param bool $strict
- */
- public function setStrict(bool $strict): void
- {
- $this->strict = $strict;
- }
-
- /**
- * This method will make a Processor that will process each transaction journal using the triggers
- * and actions found in the given Rule.
- *
- * @param Rule $rule
- * @param bool $includeActions
- *
- * @throws \FireflyIII\Exceptions\FireflyException
- */
- public function make(Rule $rule, bool $includeActions = null): void
- {
- $includeActions = $includeActions ?? true;
- Log::debug(sprintf('Making new rule from Rule %d', $rule->id));
- Log::debug(sprintf('Rule is strict: %s', var_export($rule->strict, true)));
- $this->rule = $rule;
- $this->strict = $rule->strict;
- $triggerSet = $rule->ruleTriggers()->orderBy('order', 'ASC')->get();
- /** @var RuleTrigger $trigger */
- foreach ($triggerSet as $trigger) {
- Log::debug(sprintf('Push trigger %d', $trigger->id));
- $this->triggers->push(TriggerFactory::getTrigger($trigger));
- }
- if (true === $includeActions) {
- $this->actions = $rule->ruleActions()->orderBy('order', 'ASC')->get();
- }
- }
-
- /**
- * This method will make a Processor that will process each transaction journal using the given
- * trigger (singular!). It can only report if the transaction journal was hit by the given trigger
- * and will not be able to act on it using actions.
- *
- * @param string $triggerName
- * @param string $triggerValue
- *
- * @throws \FireflyIII\Exceptions\FireflyException
- */
- public function makeFromString(string $triggerName, string $triggerValue): void
- {
- Log::debug(sprintf('Processor::makeFromString("%s", "%s")', $triggerName, $triggerValue));
- $trigger = TriggerFactory::makeTriggerFromStrings($triggerName, $triggerValue, false);
- $this->triggers->push($trigger);
- }
-
- /**
- * This method will make a Processor that will process each transaction journal using the given
- * triggers. It can only report if the transaction journal was hit by the given triggers
- * and will not be able to act on it using actions.
- *
- * The given triggers must be in the following format:
- *
- * [type => xx, value => yy, stop_processing => bool], [type => xx, value => yy, stop_processing => bool],
- *
- * @param array $triggers
- *
- * @throws \FireflyIII\Exceptions\FireflyException
- */
- public function makeFromStringArray(array $triggers): void
- {
- foreach ($triggers as $entry) {
- $entry['value'] = $entry['value'] ?? '';
- $trigger = TriggerFactory::makeTriggerFromStrings($entry['type'], $entry['value'], $entry['stop_processing']);
- $this->triggers->push($trigger);
- }
-
- }
}
diff --git a/app/TransactionRules/TransactionMatcher.php b/app/TransactionRules/TransactionMatcher.php
index f54cd3dc23..34c45143d6 100644
--- a/app/TransactionRules/TransactionMatcher.php
+++ b/app/TransactionRules/TransactionMatcher.php
@@ -23,6 +23,7 @@ declare(strict_types=1);
namespace FireflyIII\TransactionRules;
use Carbon\Carbon;
+use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Helpers\Collector\GroupCollectorInterface;
use FireflyIII\Models\Rule;
use FireflyIII\Models\RuleTrigger;
@@ -78,7 +79,7 @@ class TransactionMatcher
* triggers onto each transaction journal until enough matches are found ($limit).
*
* @return array
- * @throws \FireflyIII\Exceptions\FireflyException
+ * @throws FireflyException
*/
public function findTransactionsByRule(): array
{
@@ -107,10 +108,10 @@ class TransactionMatcher
* transaction journals matching the given $triggers. This is accomplished by trying to fire these
* triggers onto each transaction journal until enough matches are found ($limit).
*
- * @return Collection
- * @throws \FireflyIII\Exceptions\FireflyException
+ * @return array
+ * @throws FireflyException
*/
- public function findTransactionsByTriggers(): Collection
+ public function findTransactionsByTriggers(): array
{
if (0 === count($this->triggers)) {
return new Collection;
@@ -125,9 +126,7 @@ class TransactionMatcher
// If the list of matchingTransactions is larger than the maximum number of results
// (e.g. if a large percentage of the transactions match), truncate the list
- $result = $result->slice(0, $this->searchLimit);
-
- return $result;
+ return array_slice($result, 0, $this->searchLimit);
}
/**
@@ -251,7 +250,7 @@ class TransactionMatcher
*
* @param Processor $processor
*
- * @return Collection
+ * @return array
*/
private function runProcessor(Processor $processor): array
{
@@ -265,7 +264,7 @@ class TransactionMatcher
// - all transactions have been fetched from the database
// - the maximum number of transactions to return has been found
// - the maximum number of transactions to search in have been searched
- $pageSize = min($this->searchLimit, min($this->triggeredLimit, 50));
+ $pageSize = $this->searchLimit;
$processed = 0;
$page = 1;
$totalResult = [];
diff --git a/app/Transformers/BillTransformer.php b/app/Transformers/BillTransformer.php
index 84a4a8fe67..6f469b8824 100644
--- a/app/Transformers/BillTransformer.php
+++ b/app/Transformers/BillTransformer.php
@@ -127,7 +127,7 @@ class BillTransformer extends AbstractTransformer
* @param Bill $bill
* @param Carbon $date
*
- * @return \Carbon\Carbon
+ * @return Carbon
*/
protected function nextDateMatch(Bill $bill, Carbon $date): Carbon
{
diff --git a/app/Transformers/CategoryTransformer.php b/app/Transformers/CategoryTransformer.php
index fec2cb6141..794fc4fc25 100644
--- a/app/Transformers/CategoryTransformer.php
+++ b/app/Transformers/CategoryTransformer.php
@@ -24,10 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Transformers;
-use Carbon\Carbon;
use FireflyIII\Models\Category;
-use FireflyIII\Models\Transaction;
-use FireflyIII\Models\TransactionCurrency;
use FireflyIII\Repositories\Category\CategoryRepositoryInterface;
use Illuminate\Support\Collection;
use Log;
@@ -68,8 +65,8 @@ class CategoryTransformer extends AbstractTransformer
$start = $this->parameters->get('start');
$end = $this->parameters->get('end');
if (null !== $start && null !== $end) {
- $spent = $this->getSpentInformation($category, $start, $end);
- $earned = $this->getEarnedInformation($category, $start, $end);
+ $earned = array_values($this->repository->earnedInPeriod($category, new Collection, $start, $end));
+ $spent = array_values($this->repository->spentInPeriod($category, new Collection, $start, $end));
}
$data = [
'id' => (int)$category->id,
@@ -88,77 +85,4 @@ class CategoryTransformer extends AbstractTransformer
return $data;
}
-
- /**
- * @param Category $category
- * @param Carbon $start
- * @param Carbon $end
- *
- * @return array
- */
- private function getEarnedInformation(Category $category, Carbon $start, Carbon $end): array
- {
- $collection = $this->repository->earnedInPeriodCollection(new Collection([$category]), new Collection, $start, $end);
- $return = [];
- $total = [];
- $currencies = [];
- /** @var Transaction $transaction */
- foreach ($collection as $transaction) {
- $code = $transaction->transaction_currency_code;
- if (!isset($currencies[$code])) {
- $currencies[$code] = $transaction->transactionCurrency;
- }
- $total[$code] = isset($total[$code]) ? bcadd($total[$code], $transaction->transaction_amount) : $transaction->transaction_amount;
- }
- foreach ($total as $code => $earned) {
- /** @var TransactionCurrency $currency */
- $currency = $currencies[$code];
- $return[] = [
- 'currency_id' => $currency->id,
- 'currency_code' => $code,
- 'currency_symbol' => $currency->symbol,
- 'currency_decimal_places' => $currency->decimal_places,
- 'amount' => round($earned, $currency->decimal_places),
- ];
- }
-
- return $return;
- }
-
- /**
- * @param Category $category
- * @param Carbon $start
- * @param Carbon $end
- *
- * @return array
- */
- private function getSpentInformation(Category $category, Carbon $start, Carbon $end): array
- {
- $collection = $this->repository->spentInPeriodCollection(new Collection([$category]), new Collection, $start, $end);
- $return = [];
- $total = [];
- $currencies = [];
- /** @var Transaction $transaction */
- foreach ($collection as $transaction) {
- $code = $transaction->transaction_currency_code;
- if (!isset($currencies[$code])) {
- $currencies[$code] = $transaction->transactionCurrency;
- }
- $total[$code] = isset($total[$code]) ? bcadd($total[$code], $transaction->transaction_amount) : $transaction->transaction_amount;
- }
- foreach ($total as $code => $spent) {
- /** @var TransactionCurrency $currency */
- $currency = $currencies[$code];
- $return[] = [
- 'currency_id' => $currency->id,
- 'currency_code' => $code,
- 'currency_symbol' => $currency->symbol,
- 'currency_decimal_places' => $currency->decimal_places,
- 'amount' => round($spent, $currency->decimal_places),
- ];
- }
-
- return $return;
- }
-
}
diff --git a/app/Transformers/PiggyBankEventTransformer.php b/app/Transformers/PiggyBankEventTransformer.php
index dd9f1d40ab..22211b28b3 100644
--- a/app/Transformers/PiggyBankEventTransformer.php
+++ b/app/Transformers/PiggyBankEventTransformer.php
@@ -75,6 +75,7 @@ class PiggyBankEventTransformer extends AbstractTransformer
$this->piggyRepos->setUser($account->user);
// get associated currency or fall back to the default:
+ // TODO we can use getAccountCurrency() instead
$currencyId = (int)$this->repository->getMetaValue($account, 'currency_id');
$currency = $this->currencyRepos->findNull($currencyId);
if (null === $currency) {
diff --git a/app/Transformers/PiggyBankTransformer.php b/app/Transformers/PiggyBankTransformer.php
index 268994ba22..35fe31dfdd 100644
--- a/app/Transformers/PiggyBankTransformer.php
+++ b/app/Transformers/PiggyBankTransformer.php
@@ -77,6 +77,7 @@ class PiggyBankTransformer extends AbstractTransformer
$this->piggyRepos->setUser($account->user);
// get currency from account, or use default.
+ // TODO we can use getAccountCurrency() instead
$currencyId = (int)$this->accountRepos->getMetaValue($account, 'currency_id');
$currency = $this->currencyRepos->findNull($currencyId);
if (null === $currency) {
diff --git a/app/Transformers/TransactionGroupTransformer.php b/app/Transformers/TransactionGroupTransformer.php
index 1248bb81f4..62cb133acd 100644
--- a/app/Transformers/TransactionGroupTransformer.php
+++ b/app/Transformers/TransactionGroupTransformer.php
@@ -360,4 +360,4 @@ class TransactionGroupTransformer extends AbstractTransformer
return $result;
}
-}
\ No newline at end of file
+}
diff --git a/app/User.php b/app/User.php
index 330dc20a7f..cc609c62fd 100644
--- a/app/User.php
+++ b/app/User.php
@@ -24,6 +24,8 @@ declare(strict_types=1);
namespace FireflyIII;
+use Eloquent;
+use Exception;
use FireflyIII\Events\RequestedNewPassword;
use FireflyIII\Models\Account;
use FireflyIII\Models\Attachment;
@@ -43,66 +45,75 @@ use FireflyIII\Models\Tag;
use FireflyIII\Models\Transaction;
use FireflyIII\Models\TransactionGroup;
use FireflyIII\Models\TransactionJournal;
+use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Relations\HasManyThrough;
use Illuminate\Foundation\Auth\User as Authenticatable;
+use Illuminate\Notifications\DatabaseNotification;
+use Illuminate\Notifications\DatabaseNotificationCollection;
use Illuminate\Notifications\Notifiable;
+use Illuminate\Support\Carbon;
use Illuminate\Support\Collection;
+use Laravel\Passport\Client;
use Laravel\Passport\HasApiTokens;
+use Laravel\Passport\Token;
use Request;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
/**
* Class User.
*
- * @property int $id
- * @property string $email
- * @property bool $isAdmin used in admin user controller.
- * @property bool $has2FA used in admin user controller.
- * @property array $prefs used in admin user controller.
- * @property string password
- * @property string $mfa_secret
- * @property Collection roles
- * @property string blocked_code
- * @property bool blocked
- * @property \Illuminate\Support\Carbon|null $created_at
- * @property \Illuminate\Support\Carbon|null $updated_at
- * @property string|null $remember_token
- * @property string|null $reset
- * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Account[] $accounts
- * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Attachment[] $attachments
- * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\AvailableBudget[] $availableBudgets
- * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Bill[] $bills
- * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Budget[] $budgets
- * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Category[] $categories
- * @property-read \Illuminate\Database\Eloquent\Collection|\Laravel\Passport\Client[] $clients
- * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\CurrencyExchangeRate[] $currencyExchangeRates
- * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\ImportJob[] $importJobs
- * @property-read \Illuminate\Notifications\DatabaseNotificationCollection|\Illuminate\Notifications\DatabaseNotification[] $notifications
- * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\PiggyBank[] $piggyBanks
- * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Preference[] $preferences
- * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Recurrence[] $recurrences
- * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\RuleGroup[] $ruleGroups
- * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Rule[] $rules
- * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Tag[] $tags
- * @property-read \Illuminate\Database\Eloquent\Collection|\Laravel\Passport\Token[] $tokens
- * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\TransactionGroup[] $transactionGroups
- * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\TransactionJournal[] $transactionJournals
- * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Transaction[] $transactions
- * @method static \Illuminate\Database\Eloquent\Builder|\FireflyIII\User newModelQuery()
- * @method static \Illuminate\Database\Eloquent\Builder|\FireflyIII\User newQuery()
- * @method static \Illuminate\Database\Eloquent\Builder|\FireflyIII\User query()
- * @method static \Illuminate\Database\Eloquent\Builder|\FireflyIII\User whereBlocked($value)
- * @method static \Illuminate\Database\Eloquent\Builder|\FireflyIII\User whereBlockedCode($value)
- * @method static \Illuminate\Database\Eloquent\Builder|\FireflyIII\User whereCreatedAt($value)
- * @method static \Illuminate\Database\Eloquent\Builder|\FireflyIII\User whereEmail($value)
- * @method static \Illuminate\Database\Eloquent\Builder|\FireflyIII\User whereId($value)
- * @method static \Illuminate\Database\Eloquent\Builder|\FireflyIII\User wherePassword($value)
- * @method static \Illuminate\Database\Eloquent\Builder|\FireflyIII\User whereRememberToken($value)
- * @method static \Illuminate\Database\Eloquent\Builder|\FireflyIII\User whereReset($value)
- * @method static \Illuminate\Database\Eloquent\Builder|\FireflyIII\User whereUpdatedAt($value)
- * @mixin \Eloquent
+ * @property int $id
+ * @property string $email
+ * @property bool $isAdmin used in admin user
+ * controller.
+ * @property bool $has2FA used in admin user
+ * controller.
+ * @property array $prefs used in admin user
+ * controller.
+ * @property string password
+ * @property string $mfa_secret
+ * @property Collection roles
+ * @property string blocked_code
+ * @property bool blocked
+ * @property Carbon|null $created_at
+ * @property Carbon|null $updated_at
+ * @property string|null $remember_token
+ * @property string|null $reset
+ * @property-read \Illuminate\Database\Eloquent\Collection|Account[] $accounts
+ * @property-read \Illuminate\Database\Eloquent\Collection|Attachment[] $attachments
+ * @property-read \Illuminate\Database\Eloquent\Collection|AvailableBudget[] $availableBudgets
+ * @property-read \Illuminate\Database\Eloquent\Collection|Bill[] $bills
+ * @property-read \Illuminate\Database\Eloquent\Collection|Budget[] $budgets
+ * @property-read \Illuminate\Database\Eloquent\Collection|Category[] $categories
+ * @property-read \Illuminate\Database\Eloquent\Collection|Client[] $clients
+ * @property-read \Illuminate\Database\Eloquent\Collection|CurrencyExchangeRate[] $currencyExchangeRates
+ * @property-read \Illuminate\Database\Eloquent\Collection|ImportJob[] $importJobs
+ * @property-read DatabaseNotificationCollection|DatabaseNotification[] $notifications
+ * @property-read \Illuminate\Database\Eloquent\Collection|PiggyBank[] $piggyBanks
+ * @property-read \Illuminate\Database\Eloquent\Collection|Preference[] $preferences
+ * @property-read \Illuminate\Database\Eloquent\Collection|Recurrence[] $recurrences
+ * @property-read \Illuminate\Database\Eloquent\Collection|RuleGroup[] $ruleGroups
+ * @property-read \Illuminate\Database\Eloquent\Collection|Rule[] $rules
+ * @property-read \Illuminate\Database\Eloquent\Collection|Tag[] $tags
+ * @property-read \Illuminate\Database\Eloquent\Collection|Token[] $tokens
+ * @property-read \Illuminate\Database\Eloquent\Collection|TransactionGroup[] $transactionGroups
+ * @property-read \Illuminate\Database\Eloquent\Collection|TransactionJournal[] $transactionJournals
+ * @property-read \Illuminate\Database\Eloquent\Collection|Transaction[] $transactions
+ * @method static Builder|User newModelQuery()
+ * @method static Builder|User newQuery()
+ * @method static Builder|User query()
+ * @method static Builder|User whereBlocked($value)
+ * @method static Builder|User whereBlockedCode($value)
+ * @method static Builder|User whereCreatedAt($value)
+ * @method static Builder|User whereEmail($value)
+ * @method static Builder|User whereId($value)
+ * @method static Builder|User wherePassword($value)
+ * @method static Builder|User whereRememberToken($value)
+ * @method static Builder|User whereReset($value)
+ * @method static Builder|User whereUpdatedAt($value)
+ * @mixin Eloquent
*/
class User extends Authenticatable
{
@@ -238,7 +249,7 @@ class User extends Authenticatable
* Generates access token.
*
* @return string
- * @throws \Exception
+ * @throws Exception
*/
public function generateAccessToken(): string
{
@@ -295,7 +306,7 @@ class User extends Authenticatable
* @codeCoverageIgnore
* Link to roles.
*
- * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
+ * @return BelongsToMany
*/
public function roles(): BelongsToMany
{
diff --git a/app/Validation/AccountValidator.php b/app/Validation/AccountValidator.php
index b5f3d42e4c..e9996aa9dc 100644
--- a/app/Validation/AccountValidator.php
+++ b/app/Validation/AccountValidator.php
@@ -63,8 +63,10 @@ class AccountValidator
$this->destError = 'No error yet.';
$this->sourceError = 'No error yet.';
$this->combinations = config('firefly.source_dests');
+
/** @var AccountRepositoryInterface accountRepository */
$this->accountRepository = app(AccountRepositoryInterface::class);
+
if ('testing' === config('app.env')) {
Log::warning(sprintf('%s should not be instantiated in the TEST environment!', get_class($this)));
}
@@ -174,25 +176,12 @@ class AccountValidator
*/
private function canCreateType(string $accountType): bool
{
- $result = false;
- switch ($accountType) {
- default:
- Log::error(sprintf('AccountValidator::validateSource cannot handle "%s".', $this->transactionType));
- break;
- case AccountType::ASSET:
- case AccountType::LOAN:
- case AccountType::MORTGAGE:
- case AccountType::DEBT:
- $result = false;
- break;
- case AccountType::EXPENSE:
- case AccountType::REVENUE:
- case AccountType::INITIAL_BALANCE:
- $result = true;
- break;
+ $canCreate = [AccountType::EXPENSE, AccountType::REVENUE, AccountType::INITIAL_BALANCE];
+ if (in_array($accountType, $canCreate, true)) {
+ return true;
}
- return $result;
+ return false;
}
/**
@@ -225,25 +214,20 @@ class AccountValidator
*/
private function findExistingAccount(array $validTypes, int $accountId, string $accountName): ?Account
{
- $result = null;
-
// find by ID
if ($accountId > 0) {
$first = $this->accountRepository->findNull($accountId);
if ((null !== $first) && in_array($first->accountType->type, $validTypes, true)) {
- $result = $first;
+ return $first;
}
}
// find by name:
- if (null === $result && '' !== $accountName) {
- $second = $this->accountRepository->findByName($accountName, $validTypes);
- if (null !== $second) {
- $result = $second;
- }
+ if ('' !== $accountName) {
+ return $this->accountRepository->findByName($accountName, $validTypes);
}
- return $result;
+ return null;
}
/**
@@ -630,4 +614,4 @@ class AccountValidator
}
-}
\ No newline at end of file
+}
diff --git a/app/Validation/FireflyValidator.php b/app/Validation/FireflyValidator.php
index 0da6a0117d..1f9206d5c1 100644
--- a/app/Validation/FireflyValidator.php
+++ b/app/Validation/FireflyValidator.php
@@ -46,8 +46,6 @@ use Illuminate\Validation\Validator;
class FireflyValidator extends Validator
{
/**
- * @SuppressWarnings(PHPMD.UnusedFormalParameter)
- *
* @param $attribute
* @param $value
*
@@ -65,8 +63,6 @@ class FireflyValidator extends Validator
}
/**
- * @SuppressWarnings(PHPMD.UnusedFormalParameter)
- *
* @param $attribute
* @param $value
* @param $parameters
@@ -86,8 +82,6 @@ class FireflyValidator extends Validator
}
/**
- * @SuppressWarnings(PHPMD.UnusedFormalParameter)
- *
* @param $attribute
* @param $value
*
@@ -108,8 +102,6 @@ class FireflyValidator extends Validator
}
/**
- * @SuppressWarnings(PHPMD.UnusedFormalParameter)
- *
* @param $attribute
* @param $value
*
@@ -191,8 +183,6 @@ class FireflyValidator extends Validator
* @param $attribute
* @param $value
* @param $parameters
- * @SuppressWarnings(PHPMD.UnusedFormalParameter)
- *
* @return bool
*/
public function validateLess($attribute, $value, $parameters): bool
@@ -207,8 +197,6 @@ class FireflyValidator extends Validator
* @param $attribute
* @param $value
* @param $parameters
- * @SuppressWarnings(PHPMD.UnusedFormalParameter)
- *
* @return bool
*/
public function validateMore($attribute, $value, $parameters): bool
@@ -220,8 +208,6 @@ class FireflyValidator extends Validator
}
/**
- * @SuppressWarnings(PHPMD.UnusedFormalParameter)
- *
* @param $attribute
* @param $value
* @param $parameters
@@ -381,8 +367,6 @@ class FireflyValidator extends Validator
}
/**
- * @SuppressWarnings(PHPMD.UnusedFormalParameter)
- *
* @param $attribute
* @param $value
* @param $parameters
@@ -415,8 +399,6 @@ class FireflyValidator extends Validator
}
/**
- * @SuppressWarnings(PHPMD.UnusedFormalParameter)
- *
* @param $attribute
* @param $value
* @param $parameters
@@ -452,7 +434,7 @@ class FireflyValidator extends Validator
}
/**
- * @SuppressWarnings(PHPMD.UnusedFormalParameter)
+ *
* Validate an object and its unicity. Checks for encryption / encrypted values as well.
*
* parameter 0: the table
@@ -496,8 +478,6 @@ class FireflyValidator extends Validator
}
/**
- * @SuppressWarnings(PHPMD.UnusedFormalParameter)
- *
* @param $attribute
* @param $value
* @param $parameters
diff --git a/changelog.md b/changelog.md
index d75b69e2ca..9106b9a96a 100644
--- a/changelog.md
+++ b/changelog.md
@@ -2,6 +2,39 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).
+## [4.8.0.2 (API 0.10.0)] - 2019-08-17
+
+Fixes many other issues in the previous release.
+
+### Changed
+- Make many report boxes multi-currency.
+
+### Fixed
+- [Issue 2203](https://github.com/firefly-iii/firefly-iii/issues/2203) Reconciliation inconsistencies.
+- [Issue 2392](https://github.com/firefly-iii/firefly-iii/issues/2392) Bad namespace leads to installation errors.
+- [Issue 2393](https://github.com/firefly-iii/firefly-iii/issues/2393) Missing budget selector.
+- [Issue 2402](https://github.com/firefly-iii/firefly-iii/issues/2402) bad amounts in default report
+- [Issue 2405](https://github.com/firefly-iii/firefly-iii/issues/2405) Due date can't be edited.
+- [Issue 2404](https://github.com/firefly-iii/firefly-iii/issues/2404) bad page indicator in the "no category" transaction overview.
+- [Issue 2407](https://github.com/firefly-iii/firefly-iii/issues/2407) Fix recurring transaction dates
+- [Issue 2410](https://github.com/firefly-iii/firefly-iii/issues/2410) Transaction links inconsistent
+- [Issue 2414](https://github.com/firefly-iii/firefly-iii/issues/2414) Can't edit recurring transactions
+- [Issue 2415](https://github.com/firefly-iii/firefly-iii/issues/2415) Return here + reset form results in empty transaction form
+- [Issue 2416](https://github.com/firefly-iii/firefly-iii/issues/2416) Some form inconsistencies.
+- [Issue 2418](https://github.com/firefly-iii/firefly-iii/issues/2418) Reports are inaccurate or broken.
+- [Issue 2422](https://github.com/firefly-iii/firefly-iii/issues/2422) PHP error when matching transactions.
+- [Issue 2423](https://github.com/firefly-iii/firefly-iii/issues/2423) Reports are inaccurate or broken.
+- [Issue 2426](https://github.com/firefly-iii/firefly-iii/issues/2426) Inconsistent documentation and instructions.
+- [Issue 2427](https://github.com/firefly-iii/firefly-iii/issues/2427) Deleted account and "initial balance" accounts may appear in dropdowns.
+- [Issue 2428](https://github.com/firefly-iii/firefly-iii/issues/2428) Reports are inaccurate or broken.
+- [Issue 2429](https://github.com/firefly-iii/firefly-iii/issues/2429) Typo leads to SQL errors in available budgets API
+- [Issue 2431](https://github.com/firefly-iii/firefly-iii/issues/2431) Issues creating new recurring transactions.
+- [Issue 2434](https://github.com/firefly-iii/firefly-iii/issues/2434) You can edit the initial balance transaction but it fails to save.
+- ARM build should work now.
+
+### API
+- [Issue 2429](https://github.com/firefly-iii/firefly-iii/issues/2429) Typo leads to SQL errors in available budgets API
+
## [4.8.0.1 (API 0.10.0)] - 2019-08-12
Fixes the most pressing issues found in the previous release.
diff --git a/composer.lock b/composer.lock
index cd14b77aa9..1ca5a0f146 100644
--- a/composer.lock
+++ b/composer.lock
@@ -936,16 +936,16 @@
},
{
"name": "egulias/email-validator",
- "version": "2.1.10",
+ "version": "2.1.11",
"source": {
"type": "git",
"url": "https://github.com/egulias/EmailValidator.git",
- "reference": "a6c8d7101b19a451c1707b1b79bbbc56e4bdb7ec"
+ "reference": "92dd169c32f6f55ba570c309d83f5209cefb5e23"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/a6c8d7101b19a451c1707b1b79bbbc56e4bdb7ec",
- "reference": "a6c8d7101b19a451c1707b1b79bbbc56e4bdb7ec",
+ "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/92dd169c32f6f55ba570c309d83f5209cefb5e23",
+ "reference": "92dd169c32f6f55ba570c309d83f5209cefb5e23",
"shasum": ""
},
"require": {
@@ -964,7 +964,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.0.x-dev"
+ "dev-master": "2.1.x-dev"
}
},
"autoload": {
@@ -990,7 +990,7 @@
"validation",
"validator"
],
- "time": "2019-07-19T20:52:08+00:00"
+ "time": "2019-08-13T17:33:27+00:00"
},
{
"name": "erusev/parsedown",
@@ -1327,16 +1327,16 @@
},
{
"name": "laravel/framework",
- "version": "v5.8.31",
+ "version": "v5.8.32",
"source": {
"type": "git",
"url": "https://github.com/laravel/framework.git",
- "reference": "24cc1786bd55876fa52380306354772355345efd"
+ "reference": "ee16d719516dfd77ed6c9538000bca49ded284e2"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/laravel/framework/zipball/24cc1786bd55876fa52380306354772355345efd",
- "reference": "24cc1786bd55876fa52380306354772355345efd",
+ "url": "https://api.github.com/repos/laravel/framework/zipball/ee16d719516dfd77ed6c9538000bca49ded284e2",
+ "reference": "ee16d719516dfd77ed6c9538000bca49ded284e2",
"shasum": ""
},
"require": {
@@ -1470,7 +1470,7 @@
"framework",
"laravel"
],
- "time": "2019-08-06T15:09:02+00:00"
+ "time": "2019-08-13T14:11:52+00:00"
},
{
"name": "laravel/passport",
@@ -2323,16 +2323,16 @@
},
{
"name": "nesbot/carbon",
- "version": "2.22.3",
+ "version": "2.23.0",
"source": {
"type": "git",
"url": "https://github.com/briannesbitt/Carbon.git",
- "reference": "738fbd8d80b2c5e158fda76c29c2de432fcc6f7e"
+ "reference": "97a08830a22ce0b69549a4966773c0eae900468d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/738fbd8d80b2c5e158fda76c29c2de432fcc6f7e",
- "reference": "738fbd8d80b2c5e158fda76c29c2de432fcc6f7e",
+ "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/97a08830a22ce0b69549a4966773c0eae900468d",
+ "reference": "97a08830a22ce0b69549a4966773c0eae900468d",
"shasum": ""
},
"require": {
@@ -2379,14 +2379,14 @@
"homepage": "http://github.com/kylekatarnls"
}
],
- "description": "A simple API extension for DateTime.",
+ "description": "A API extension for DateTime that supports 281 different languages.",
"homepage": "http://carbon.nesbot.com",
"keywords": [
"date",
"datetime",
"time"
],
- "time": "2019-08-07T12:36:44+00:00"
+ "time": "2019-08-12T17:19:41+00:00"
},
{
"name": "opis/closure",
@@ -4997,7 +4997,7 @@
},
{
"name": "tightenco/collect",
- "version": "v5.8.31",
+ "version": "v5.8.32",
"source": {
"type": "git",
"url": "https://github.com/tightenco/collect.git",
@@ -6716,16 +6716,16 @@
},
{
"name": "phpunit/phpunit",
- "version": "8.3.3",
+ "version": "8.3.4",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
- "reference": "c319d08ebd31e137034c84ad7339054709491485"
+ "reference": "e31cce0cf4499c0ccdbbb211a3280d36ab341e36"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c319d08ebd31e137034c84ad7339054709491485",
- "reference": "c319d08ebd31e137034c84ad7339054709491485",
+ "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/e31cce0cf4499c0ccdbbb211a3280d36ab341e36",
+ "reference": "e31cce0cf4499c0ccdbbb211a3280d36ab341e36",
"shasum": ""
},
"require": {
@@ -6795,7 +6795,7 @@
"testing",
"xunit"
],
- "time": "2019-08-03T15:41:47+00:00"
+ "time": "2019-08-11T06:56:55+00:00"
},
{
"name": "roave/security-advisories",
@@ -7232,16 +7232,16 @@
},
{
"name": "sebastian/exporter",
- "version": "3.1.0",
+ "version": "3.1.1",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/exporter.git",
- "reference": "234199f4528de6d12aaa58b612e98f7d36adb937"
+ "reference": "06a9a5947f47b3029d76118eb5c22802e5869687"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/234199f4528de6d12aaa58b612e98f7d36adb937",
- "reference": "234199f4528de6d12aaa58b612e98f7d36adb937",
+ "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/06a9a5947f47b3029d76118eb5c22802e5869687",
+ "reference": "06a9a5947f47b3029d76118eb5c22802e5869687",
"shasum": ""
},
"require": {
@@ -7268,6 +7268,10 @@
"BSD-3-Clause"
],
"authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ },
{
"name": "Jeff Welch",
"email": "whatthejeff@gmail.com"
@@ -7276,17 +7280,13 @@
"name": "Volker Dusch",
"email": "github@wallbash.com"
},
- {
- "name": "Bernhard Schussek",
- "email": "bschussek@2bepublished.at"
- },
- {
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de"
- },
{
"name": "Adam Harvey",
"email": "aharvey@php.net"
+ },
+ {
+ "name": "Bernhard Schussek",
+ "email": "bschussek@gmail.com"
}
],
"description": "Provides the functionality to export PHP variables for visualization",
@@ -7295,7 +7295,7 @@
"export",
"exporter"
],
- "time": "2017-04-03T13:19:02+00:00"
+ "time": "2019-08-11T12:43:14+00:00"
},
{
"name": "sebastian/global-state",
diff --git a/config/firefly.php b/config/firefly.php
index 4e791b27f3..32736e5f9b 100644
--- a/config/firefly.php
+++ b/config/firefly.php
@@ -125,7 +125,7 @@ return [
'is_demo_site' => false,
],
'encryption' => null === env('USE_ENCRYPTION') || env('USE_ENCRYPTION') === true,
- 'version' => '4.8.0.1',
+ 'version' => '4.8.0.2',
'api_version' => '0.10.0',
'db_version' => 11,
'maxUploadSize' => 15242880,
diff --git a/config/google2fa.php b/config/google2fa.php
index c14832b761..1fb2eb584f 100644
--- a/config/google2fa.php
+++ b/config/google2fa.php
@@ -1,4 +1,5 @@
define(
FireflyIII\Models\Account::class,
function (Faker\Generator $faker) {
diff --git a/database/factories/ModelFactory.php b/database/factories/ModelFactory.php
index 936dc2d38e..97018e321b 100644
--- a/database/factories/ModelFactory.php
+++ b/database/factories/ModelFactory.php
@@ -21,6 +21,7 @@
declare(strict_types=1);
use Carbon\Carbon;
+use FireflyIII\Models\TransactionJournal;
$factory->define(
@@ -29,7 +30,7 @@ $factory->define(
return [
'user_id' => 1,
'attachable_id' => 1,
- 'attachable_type' => \FireflyIII\Models\TransactionJournal::class,
+ 'attachable_type' => TransactionJournal::class,
'md5' => md5($faker->words(6, true)),
'mime' => 'text/plain',
'size' => 1,
diff --git a/database/factories/UserFactory.php b/database/factories/UserFactory.php
index ad3dc9dc58..6b0f9fcbe8 100644
--- a/database/factories/UserFactory.php
+++ b/database/factories/UserFactory.php
@@ -21,6 +21,7 @@
*/
declare(strict_types=1);
+
/**
* UserFactory.php
* Copyright (c) 2018 thegrumpydictator@gmail.com
diff --git a/database/migrations/2016_12_28_203205_changes_for_v431.php b/database/migrations/2016_12_28_203205_changes_for_v431.php
index 1d276d6cee..c2e38429da 100644
--- a/database/migrations/2016_12_28_203205_changes_for_v431.php
+++ b/database/migrations/2016_12_28_203205_changes_for_v431.php
@@ -75,13 +75,14 @@ class ChangesForV431 extends Migration
* Run the migrations.
*
* @SuppressWarnings(PHPMD.ShortMethodName)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*/
public function up(): void
{
// add decimal places to "transaction currencies".
Schema::table(
'transaction_currencies',
- function (Blueprint $table) {
+ static function (Blueprint $table) {
$table->smallInteger('decimal_places', false, true)->default(2);
}
);
@@ -89,7 +90,7 @@ class ChangesForV431 extends Migration
// change field "startdate" to "start_date"
Schema::table(
'budget_limits',
- function (Blueprint $table) {
+ static function (Blueprint $table) {
$table->renameColumn('startdate', 'start_date');
}
);
@@ -97,7 +98,7 @@ class ChangesForV431 extends Migration
// add date field "end_date" after "start_date"
Schema::table(
'budget_limits',
- function (Blueprint $table) {
+ static function (Blueprint $table) {
$table->date('end_date')->nullable()->after('start_date');
}
);
@@ -105,13 +106,13 @@ class ChangesForV431 extends Migration
// drop "repeats" and "repeat_freq".
Schema::table(
'budget_limits',
- function (Blueprint $table) {
+ static function (Blueprint $table) {
$table->dropColumn('repeats');
}
);
Schema::table(
'budget_limits',
- function (Blueprint $table) {
+ static function (Blueprint $table) {
$table->dropColumn('repeat_freq');
}
);
diff --git a/database/migrations/2018_01_01_000001_create_oauth_auth_codes_table.php b/database/migrations/2018_01_01_000001_create_oauth_auth_codes_table.php
index 4d88023dc6..267a06ad60 100644
--- a/database/migrations/2018_01_01_000001_create_oauth_auth_codes_table.php
+++ b/database/migrations/2018_01_01_000001_create_oauth_auth_codes_table.php
@@ -41,6 +41,7 @@ class CreateOauthAuthCodesTable extends Migration
/**
* Run the migrations.
+ * @SuppressWarnings(PHPMD.ShortMethodName)
*/
public function up(): void
{
diff --git a/database/migrations/2018_01_01_000002_create_oauth_access_tokens_table.php b/database/migrations/2018_01_01_000002_create_oauth_access_tokens_table.php
index 47101b5a2e..4053b05755 100644
--- a/database/migrations/2018_01_01_000002_create_oauth_access_tokens_table.php
+++ b/database/migrations/2018_01_01_000002_create_oauth_access_tokens_table.php
@@ -41,6 +41,7 @@ class CreateOauthAccessTokensTable extends Migration
/**
* Run the migrations.
+ * @SuppressWarnings(PHPMD.ShortMethodName)
*/
public function up(): void
{
diff --git a/database/migrations/2018_01_01_000003_create_oauth_refresh_tokens_table.php b/database/migrations/2018_01_01_000003_create_oauth_refresh_tokens_table.php
index b154666881..3c4d530283 100644
--- a/database/migrations/2018_01_01_000003_create_oauth_refresh_tokens_table.php
+++ b/database/migrations/2018_01_01_000003_create_oauth_refresh_tokens_table.php
@@ -41,6 +41,7 @@ class CreateOauthRefreshTokensTable extends Migration
/**
* Run the migrations.
+ * @SuppressWarnings(PHPMD.ShortMethodName)
*/
public function up(): void
{
diff --git a/database/migrations/2018_01_01_000004_create_oauth_clients_table.php b/database/migrations/2018_01_01_000004_create_oauth_clients_table.php
index 16c5bc6c87..1a6ceec6b8 100644
--- a/database/migrations/2018_01_01_000004_create_oauth_clients_table.php
+++ b/database/migrations/2018_01_01_000004_create_oauth_clients_table.php
@@ -41,6 +41,7 @@ class CreateOauthClientsTable extends Migration
/**
* Run the migrations.
+ * @SuppressWarnings(PHPMD.ShortMethodName)
*/
public function up(): void
{
diff --git a/database/migrations/2018_01_01_000005_create_oauth_personal_access_clients_table.php b/database/migrations/2018_01_01_000005_create_oauth_personal_access_clients_table.php
index 73e26aff39..2e3db54ff2 100644
--- a/database/migrations/2018_01_01_000005_create_oauth_personal_access_clients_table.php
+++ b/database/migrations/2018_01_01_000005_create_oauth_personal_access_clients_table.php
@@ -42,6 +42,7 @@ class CreateOauthPersonalAccessClientsTable extends Migration
/**
* Run the migrations.
+ * @SuppressWarnings(PHPMD.ShortMethodName)
*/
public function up(): void
{
diff --git a/database/migrations/2018_03_19_141348_changes_for_v472.php b/database/migrations/2018_03_19_141348_changes_for_v472.php
index abb3afe3ed..c116a65207 100644
--- a/database/migrations/2018_03_19_141348_changes_for_v472.php
+++ b/database/migrations/2018_03_19_141348_changes_for_v472.php
@@ -53,6 +53,7 @@ class ChangesForV472 extends Migration
/**
* Run the migrations.
+ * @SuppressWarnings(PHPMD.ShortMethodName)
*
* @return void
*/
diff --git a/database/migrations/2018_04_07_210913_changes_for_v473.php b/database/migrations/2018_04_07_210913_changes_for_v473.php
index 3ebbb5fe6c..a9813b2da0 100644
--- a/database/migrations/2018_04_07_210913_changes_for_v473.php
+++ b/database/migrations/2018_04_07_210913_changes_for_v473.php
@@ -61,6 +61,7 @@ class ChangesForV473 extends Migration
/**
* Run the migrations.
+ * @SuppressWarnings(PHPMD.ShortMethodName)
*
* @return void
*/
diff --git a/database/migrations/2018_04_29_174524_changes_for_v474.php b/database/migrations/2018_04_29_174524_changes_for_v474.php
index d9c2598cd7..d68542d6f8 100644
--- a/database/migrations/2018_04_29_174524_changes_for_v474.php
+++ b/database/migrations/2018_04_29_174524_changes_for_v474.php
@@ -32,6 +32,7 @@ class ChangesForV474 extends Migration
{
/**
* Reverse the migrations.
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*
* @return void
*/
@@ -92,6 +93,7 @@ class ChangesForV474 extends Migration
/**
* Run the migrations.
+ * @SuppressWarnings(PHPMD.ShortMethodName)
*
* @return void
*/
diff --git a/database/migrations/2018_06_08_200526_changes_for_v475.php b/database/migrations/2018_06_08_200526_changes_for_v475.php
index 003c556ea4..5a5e1a0acc 100644
--- a/database/migrations/2018_06_08_200526_changes_for_v475.php
+++ b/database/migrations/2018_06_08_200526_changes_for_v475.php
@@ -47,6 +47,8 @@ class ChangesForV475 extends Migration
/**
* Run the migrations.
+ * @SuppressWarnings(PHPMD.ShortMethodName)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*
* @return void
*/
diff --git a/database/migrations/2018_09_05_195147_changes_for_v477.php b/database/migrations/2018_09_05_195147_changes_for_v477.php
index 6aae743150..67777c6733 100644
--- a/database/migrations/2018_09_05_195147_changes_for_v477.php
+++ b/database/migrations/2018_09_05_195147_changes_for_v477.php
@@ -41,7 +41,7 @@ class ChangesForV477 extends Migration
Schema::table(
'budget_limits', function (Blueprint $table) {
- // cannot drop foreign keys in SQLite:
+ // cannot drop foreign keys in SQLite:
if ('sqlite' !== config('database.default')) {
$table->dropForeign('budget_limits_transaction_currency_id_foreign');
}
@@ -53,6 +53,7 @@ class ChangesForV477 extends Migration
/**
* Run the migrations.
+ * @SuppressWarnings(PHPMD.ShortMethodName)
*
* @return void
*/
diff --git a/database/migrations/2018_11_06_172532_changes_for_v479.php b/database/migrations/2018_11_06_172532_changes_for_v479.php
index 9846f38f0a..a0498d5b36 100644
--- a/database/migrations/2018_11_06_172532_changes_for_v479.php
+++ b/database/migrations/2018_11_06_172532_changes_for_v479.php
@@ -21,6 +21,7 @@
*/
declare(strict_types=1);
+
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
@@ -45,6 +46,7 @@ class ChangesForV479 extends Migration
/**
* Run the migrations.
+ * @SuppressWarnings(PHPMD.ShortMethodName)
*
* @return void
*/
diff --git a/database/migrations/2019_01_28_193833_changes_for_v4710.php b/database/migrations/2019_01_28_193833_changes_for_v4710.php
index cce324b8c1..35326ec98d 100644
--- a/database/migrations/2019_01_28_193833_changes_for_v4710.php
+++ b/database/migrations/2019_01_28_193833_changes_for_v4710.php
@@ -41,6 +41,7 @@ class ChangesForV4710 extends Migration
/**
* Run the migrations.
+ * @SuppressWarnings(PHPMD.ShortMethodName)
*
* @return void
*/
@@ -73,7 +74,7 @@ class ChangesForV4710 extends Migration
$table->foreign('transaction_journal_id')->references('id')->on('transaction_journals')->onDelete('cascade');
// unique combi:
- $table->unique(['transaction_group_id', 'transaction_journal_id'],'unique_in_group');
+ $table->unique(['transaction_group_id', 'transaction_journal_id'], 'unique_in_group');
}
);
}
diff --git a/database/migrations/2019_02_05_055516_changes_for_v4711.php b/database/migrations/2019_02_05_055516_changes_for_v4711.php
index c05b293ac2..3a9f3a385a 100644
--- a/database/migrations/2019_02_05_055516_changes_for_v4711.php
+++ b/database/migrations/2019_02_05_055516_changes_for_v4711.php
@@ -40,6 +40,7 @@ class ChangesForV4711 extends Migration
/**
* Run the migrations.
+ * @SuppressWarnings(PHPMD.ShortMethodName)
*
* @return void
*/
@@ -59,7 +60,8 @@ class ChangesForV4711 extends Migration
}
);
- Schema::table('preferences', function (Blueprint $table) {
+ Schema::table(
+ 'preferences', function (Blueprint $table) {
$table->text('data')->nullable()->change();
}
);
diff --git a/database/migrations/2019_02_11_170529_changes_for_v4712.php b/database/migrations/2019_02_11_170529_changes_for_v4712.php
index ad4371e711..fc50fedf0b 100644
--- a/database/migrations/2019_02_11_170529_changes_for_v4712.php
+++ b/database/migrations/2019_02_11_170529_changes_for_v4712.php
@@ -1,4 +1,5 @@
dropColumn('transaction_group_id');
}
);
- Schema::table('rule_groups', static function (Blueprint $table) {
+ Schema::table(
+ 'rule_groups', static function (Blueprint $table) {
$table->dropColumn('stop_processing');
- });
+ }
+ );
Schema::table(
'users', static function (Blueprint $table) {
@@ -60,6 +63,7 @@ class ChangesForV480 extends Migration
/**
* Run the migrations.
+ * @SuppressWarnings(PHPMD.ShortMethodName)
*
* @return void
*/
@@ -80,9 +84,11 @@ class ChangesForV480 extends Migration
$table->foreign('transaction_group_id')->references('id')->on('transaction_groups')->onDelete('cascade');
}
);
- Schema::table('rule_groups', static function (Blueprint $table) {
+ Schema::table(
+ 'rule_groups', static function (Blueprint $table) {
$table->boolean('stop_processing')->default(false);
- });
+ }
+ );
Schema::table(
'users', static function (Blueprint $table) {
$table->string('mfa_secret', 50)->nullable();
diff --git a/database/seeds/AccountTypeSeeder.php b/database/seeds/AccountTypeSeeder.php
index 2231fce92d..8755f50bd1 100644
--- a/database/seeds/AccountTypeSeeder.php
+++ b/database/seeds/AccountTypeSeeder.php
@@ -42,7 +42,7 @@ class AccountTypeSeeder extends Seeder
AccountType::LOAN,
AccountType::RECONCILIATION,
AccountType::DEBT,
- AccountType::MORTGAGE
+ AccountType::MORTGAGE,
];
foreach ($types as $type) {
try {
diff --git a/database/seeds/TransactionCurrencySeeder.php b/database/seeds/TransactionCurrencySeeder.php
index 0a49b642ab..cd5a57ad3c 100644
--- a/database/seeds/TransactionCurrencySeeder.php
+++ b/database/seeds/TransactionCurrencySeeder.php
@@ -28,11 +28,15 @@ use Illuminate\Database\Seeder;
*/
class TransactionCurrencySeeder extends Seeder
{
+ /**
+ * @SuppressWarnings(PHPMD.ShortMethodName)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ */
public function run()
{
$currencies = [];
// european currencies
- $currencies[] = ['code' => 'EUR', 'name' => 'Euro', 'symbol' => '€', 'decimal_places' => 2,'enabled' => 1];
+ $currencies[] = ['code' => 'EUR', 'name' => 'Euro', 'symbol' => '€', 'decimal_places' => 2, 'enabled' => 1];
$currencies[] = ['code' => 'HUF', 'name' => 'Hungarian forint', 'symbol' => 'Ft', 'decimal_places' => 2];
$currencies[] = ['code' => 'GBP', 'name' => 'British Pound', 'symbol' => '£', 'decimal_places' => 2];
$currencies[] = ['code' => 'UAH', 'name' => 'Ukrainian hryvnia', 'symbol' => '₴', 'decimal_places' => 2];
diff --git a/docker-variables.txt b/docker-variables.txt
deleted file mode 100644
index 443fb6d41d..0000000000
--- a/docker-variables.txt
+++ /dev/null
@@ -1,184 +0,0 @@
-# You can leave this on "local". If you change it to production most console commands will ask for extra confirmation.
-# Never set it to "testing".
-APP_ENV=local
-
-# Set to true if you want to see debug information in error screens.
-APP_DEBUG=false
-
-# This should be your email address
-SITE_OWNER=mail@example.com
-
-# The encryption key for your sessions. Keep this very secure.
-# If you generate a new one existing data must be considered LOST.
-# Change it to a string of exactly 32 chars or use command `php artisan key:generate` to generate it
-APP_KEY=SomeRandomStringOf32CharsExactly
-
-# Change this value to your preferred time zone.
-# Example: Europe/Amsterdam
-TZ=Europe/Amsterdam
-
-# This variable must match your installation's external address but keep in mind that
-# it's only used on the command line as a fallback value.
-APP_URL=http://localhost
-
-# TRUSTED_PROXIES is a useful variable when using Docker and/or a reverse proxy.
-# Set it to ** and reverse proxies work just fine.
-TRUSTED_PROXIES=
-
-# The log channel defines where your log entries go to.
-# 'daily' is the default logging mode giving you 5 daily rotated log files in /storage/logs/.
-# Several other options exist. You can use 'single' for one big fat error log (not recommended).
-# Also available are 'syslog', 'errorlog' and 'stdout' which will log to the system itself.
-LOG_CHANNEL=daily
-
-# Log level. You can set this from least severe to most severe:
-# debug, info, notice, warning, error, critical, alert, emergency
-# If you set it to debug your logs will grow large, and fast. If you set it to emergency probably
-# nothing will get logged, ever.
-APP_LOG_LEVEL=notice
-
-# Database credentials. Make sure the database exists. I recommend a dedicated user for Firefly III
-# For other database types, please see the FAQ: http://firefly-iii.readthedocs.io/en/latest/support/faq.html
-DB_CONNECTION=pgsql
-DB_HOST=127.0.0.1
-DB_PORT=5432
-DB_DATABASE=firefly
-DB_USERNAME=firefly
-DB_PASSWORD=secret_firefly_password
-
-# PostgreSQL supports SSL. You can configure it here.
-PGSQL_SSL_MODE=prefer
-PGSQL_SSL_ROOT_CERT=null
-PGSQL_SSL_CERT=null
-PGSQL_SSL_KEY=null
-PGSQL_SSL_CRL_FILE=null
-
-# If you're looking for performance improvements, you could install memcached.
-CACHE_DRIVER=file
-SESSION_DRIVER=file
-
-# You can configure another file storage backend if you cannot use the local storage option.
-# To set this up, fill in the following variables. The upload path is used to store uploaded
-# files and the export path is to store exported data (before download).
-SFTP_HOST=
-SFTP_PORT=
-SFTP_UPLOAD_PATH=
-SFTP_EXPORT_PATH=
-
-# SFTP uses either the username/password combination or the private key to authenticate.
-SFTP_USERNAME=
-SFTP_PASSWORD=
-SFTP_PRIV_KEY=
-
-# Cookie settings. Should not be necessary to change these.
-COOKIE_PATH="/"
-COOKIE_DOMAIN=
-COOKIE_SECURE=false
-
-# If you want Firefly III to mail you, update these settings
-# For instructions, see: https://firefly-iii.readthedocs.io/en/latest/installation/mail.html
-MAIL_DRIVER=log
-MAIL_HOST=smtp.mailtrap.io
-MAIL_PORT=2525
-MAIL_FROM=changeme@example.com
-MAIL_USERNAME=null
-MAIL_PASSWORD=null
-MAIL_ENCRYPTION=null
-
-# Other mail drivers:
-MAILGUN_DOMAIN=
-MAILGUN_SECRET=
-MANDRILL_SECRET=
-SPARKPOST_SECRET=
-
-# Firefly III can send you the following messages
-SEND_REGISTRATION_MAIL=true
-SEND_ERROR_MESSAGE=true
-
-# These messages contain (sensitive) transaction information:
-SEND_REPORT_JOURNALS=true
-
-# Set a Mapbox API key here (see mapbox.com) so there might be a map available at various places.
-MAPBOX_API_KEY=
-
-# Firefly III currently supports two provider for live Currency Exchange Rates:
-# "fixer" is the default (for backward compatibility), and "ratesapi" is the new one.
-# RatesApi.IO (see https://ratesapi.io) is a FREE and OPEN SOURCE live currency exchange rates,
-# built compatible with Fixer.IO, based on data published by European Central Bank, and doesn't require API key.
-CER_PROVIDER=ratesapi
-
-# If you have select "fixer" as default currency exchange rates,
-# set a Fixer IO API key here (see https://fixer.io) to enable live currency exchange rates.
-# Please note that this WILL ONLY WORK FOR PAID fixer.io accounts because they severely limited
-# the free API up to the point where you might as well offer nothing.
-FIXER_API_KEY=
-
-# If you wish to track your own behavior over Firefly III, set a valid analytics tracker ID here.
-ANALYTICS_ID=
-
-# Firefly III has two options for user authentication. "eloquent" is the default,
-# and "ldap" for LDAP servers.
-# For full instructions on these settings please visit:
-# https://firefly-iii.readthedocs.io/en/latest/installation/authentication.html
-LOGIN_PROVIDER=eloquent
-
-# LDAP connection configuration
-# OpenLDAP, FreeIPA or ActiveDirectory
-ADLDAP_CONNECTION_SCHEME=OpenLDAP
-ADLDAP_AUTO_CONNECT=true
-
-# LDAP connection settings
-ADLDAP_CONTROLLERS=
-ADLDAP_PORT=389
-ADLDAP_TIMEOUT=5
-ADLDAP_BASEDN=""
-ADLDAP_FOLLOW_REFFERALS=false
-ADLDAP_USE_SSL=false
-ADLDAP_USE_TLS=false
-
-ADLDAP_ADMIN_USERNAME=
-ADLDAP_ADMIN_PASSWORD=
-
-ADLDAP_ACCOUNT_PREFIX=
-ADLDAP_ACCOUNT_SUFFIX=
-
-# LDAP authentication settings.
-ADLDAP_PASSWORD_SYNC=false
-ADLDAP_LOGIN_FALLBACK=false
-
-ADLDAP_DISCOVER_FIELD=distinguishedname
-ADLDAP_AUTH_FIELD=distinguishedname
-
-# Will allow SSO if your server provides an AUTH_USER field.
-WINDOWS_SSO_DISCOVER=samaccountname
-WINDOWS_SSO_KEY=AUTH_USER
-
-# field to sync as local username.
-ADLDAP_SYNC_FIELD=userprincipalname
-
-# You can disable the X-Frame-Options header if it interfears with tools like
-# Organizr. This is at your own risk.
-DISABLE_FRAME_HEADER=false
-
-# Leave the following configuration vars as is.
-# Unless you like to tinker and know what you're doing.
-APP_NAME=FireflyIII
-ADLDAP_CONNECTION=default
-BROADCAST_DRIVER=log
-QUEUE_DRIVER=sync
-REDIS_HOST=127.0.0.1
-REDIS_PASSWORD=null
-REDIS_PORT=6379
-CACHE_PREFIX=firefly
-SEARCH_RESULT_LIMIT=50
-PUSHER_KEY=
-PUSHER_SECRET=
-PUSHER_ID=
-DEMO_USERNAME=
-DEMO_PASSWORD=
-IS_DOCKER=false
-USE_ENCRYPTION=false
-IS_SANDSTORM=false
-IS_HEROKU=false
-BUNQ_USE_SANDBOX=false
-FFIII_LAYOUT=v1
diff --git a/public/v1/js/app.js b/public/v1/js/app.js
index 8fd9c3f20a..03820d2dd3 100644
--- a/public/v1/js/app.js
+++ b/public/v1/js/app.js
@@ -1 +1 @@
-!function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/",n(n.s=17)}([function(t,e,n){"use strict";var r=n(10),i=n(24),o=Object.prototype.toString;function a(t){return"[object Array]"===o.call(t)}function s(t){return null!==t&&"object"==typeof t}function c(t){return"[object Function]"===o.call(t)}function u(t,e){if(null!=t)if("object"!=typeof t&&(t=[t]),a(t))for(var n=0,r=t.length;n=200&&t<300}};c.headers={common:{Accept:"application/json, text/plain, */*"}},r.forEach(["delete","get","head"],function(t){c.headers[t]={}}),r.forEach(["post","put","patch"],function(t){c.headers[t]=r.merge(o)}),t.exports=c}).call(this,n(11))},function(t,e){t.exports=function(t){var e=[];return e.toString=function(){return this.map(function(e){var n=function(t,e){var n=t[1]||"",r=t[3];if(!r)return n;if(e&&"function"==typeof btoa){var i=(a=r,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(a))))+" */"),o=r.sources.map(function(t){return"/*# sourceURL="+r.sourceRoot+t+" */"});return[n].concat(o).concat([i]).join("\n")}var a;return[n].join("\n")}(e,t);return e[2]?"@media "+e[2]+"{"+n+"}":n}).join("")},e.i=function(t,n){"string"==typeof t&&(t=[[null,t,""]]);for(var r={},i=0;i=0&&l.splice(e,1)}function m(t){var e=document.createElement("style");if(void 0===t.attrs.type&&(t.attrs.type="text/css"),void 0===t.attrs.nonce){var r=function(){0;return n.nc}();r&&(t.attrs.nonce=r)}return g(e,t.attrs),h(t,e),e}function g(t,e){Object.keys(e).forEach(function(n){t.setAttribute(n,e[n])})}function y(t,e){var n,r,i,o;if(e.transform&&t.css){if(!(o="function"==typeof e.transform?e.transform(t.css):e.transform.default(t.css)))return function(){};t.css=o}if(e.singleton){var a=u++;n=c||(c=m(e)),r=b.bind(null,n,a,!1),i=b.bind(null,n,a,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(t){var e=document.createElement("link");return void 0===t.attrs.type&&(t.attrs.type="text/css"),t.attrs.rel="stylesheet",g(e,t.attrs),h(t,e),e}(e),r=function(t,e,n){var r=n.css,i=n.sourceMap,o=void 0===e.convertToAbsoluteUrls&&i;(e.convertToAbsoluteUrls||o)&&(r=f(r));i&&(r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */");var a=new Blob([r],{type:"text/css"}),s=t.href;t.href=URL.createObjectURL(a),s&&URL.revokeObjectURL(s)}.bind(null,n,e),i=function(){v(n),n.href&&URL.revokeObjectURL(n.href)}):(n=m(e),r=function(t,e){var n=e.css,r=e.media;r&&t.setAttribute("media",r);if(t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}.bind(null,n),i=function(){v(n)});return r(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;r(t=e)}else i()}}t.exports=function(t,e){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(e=e||{}).attrs="object"==typeof e.attrs?e.attrs:{},e.singleton||"boolean"==typeof e.singleton||(e.singleton=a()),e.insertInto||(e.insertInto="head"),e.insertAt||(e.insertAt="bottom");var n=p(t,e);return d(n,e),function(t){for(var r=[],i=0;i1)for(var n=1;nn.parts.length&&(r.parts.length=n.parts.length)}else{var a=[];for(i=0;i div[data-v-61d92e31] {\n cursor: pointer;\n padding: 3px 6px;\n width: 100%;\n}\n.ti-selected-item[data-v-61d92e31] {\n background-color: #5C6BC0;\n color: #fff;\n}\n',"",{version:3,sources:["C:/Users/johan/dev/vue-tags-input/vue-tags-input/C:/Users/johan/dev/vue-tags-input/vue-tags-input/vue-tags-input.scss"],names:[],mappings:"AAAA;EACE,uBAAuB;EACvB,mCAA8C;EAC9C,+JAAuM;EACvM,oBAAoB;EACpB,mBAAmB;CAAE;AAEvB;EACE,kCAAkC;EAClC,YAAY;EACZ,mBAAmB;EACnB,oBAAoB;EACpB,qBAAqB;EACrB,qBAAqB;EACrB,eAAe;EACf,oCAAoC;EACpC,mCAAmC;CAAE;AAEvC;EACE,iBAAiB;CAAE;AAErB;EACE,iBAAiB;CAAE;AAErB;EACE,iBAAiB;CAAE;AAErB;EACE,YAAY;EACZ,aAAa;EACb,sBAAsB;CAAE;AAE1B;EACE,uBAAuB;CAAE;AAE3B;EACE,cAAc;CAAE;AAElB;EACE,8BAA8B;CAAE;AAElC;EACE,iBAAiB;EACjB,mBAAmB;EACnB,uBAAuB;CAAE;AAE3B;EACE,aAAa;CAAE;AACf;IACE,gBAAgB;CAAE;AAEtB;EACE,uBAAuB;EACvB,cAAc;EACd,aAAa;EACb,gBAAgB;CAAE;AAEpB;EACE,cAAc;EACd,gBAAgB;EAChB,YAAY;EACZ,iBAAiB;CAAE;AAErB;EACE,0BAA0B;EAC1B,YAAY;EACZ,mBAAmB;EACnB,cAAc;EACd,iBAAiB;EACjB,YAAY;EACZ,iBAAiB;CAAE;AACnB;IACE,cAAc;CAAE;AAClB;IACE,cAAc;IACd,oBAAoB;CAAE;AACxB;IACE,mBAAmB;CAAE;AACvB;IACE,mBAAmB;CAAE;AACvB;IACE,mBAAmB;IACnB,mBAAmB;IACnB,YAAY;IACZ,iBAAiB;CAAE;AACrB;IACE,iBAAiB;IACjB,cAAc;IACd,oBAAoB;IACpB,kBAAkB;CAAE;AACpB;MACE,gBAAgB;CAAE;AACtB;IACE,kBAAkB;CAAE;AACtB;IACE,0BAA0B;CAAE;AAEhC;EACE,cAAc;EACd,eAAe;EACf,iBAAiB;EACjB,YAAY;EACZ,iBAAiB;CAAE;AACnB;IACE,eAAe;IACf,iBAAiB;IACjB,aAAa;IACb,aAAa;IACb,YAAY;CAAE;AAElB;EACE,qBAAqB;CAAE;AAEzB;EACE,uBAAuB;EACvB,iBAAiB;EACjB,mBAAmB;EACnB,YAAY;EACZ,uBAAuB;EACvB,YAAY;CAAE;AAEhB;EACE,gBAAgB;EAChB,iBAAiB;EACjB,YAAY;CAAE;AAEhB;EACE,0BAA0B;EAC1B,YAAY;CAAE",file:"vue-tags-input.scss?vue&type=style&index=0&id=61d92e31&lang=scss&scoped=true&",sourcesContent:['@font-face {\n font-family: \'icomoon\';\n src: url("./assets/fonts/icomoon.eot?7grlse");\n src: url("./assets/fonts/icomoon.eot?7grlse#iefix") format("embedded-opentype"), url("./assets/fonts/icomoon.ttf?7grlse") format("truetype"), url("./assets/fonts/icomoon.woff?7grlse") format("woff");\n font-weight: normal;\n font-style: normal; }\n\n[class^="ti-icon-"], [class*=" ti-icon-"] {\n font-family: \'icomoon\' !important;\n speak: none;\n font-style: normal;\n font-weight: normal;\n font-variant: normal;\n text-transform: none;\n line-height: 1;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale; }\n\n.ti-icon-check:before {\n content: "\\e902"; }\n\n.ti-icon-close:before {\n content: "\\e901"; }\n\n.ti-icon-undo:before {\n content: "\\e900"; }\n\nul {\n margin: 0px;\n padding: 0px;\n list-style-type: none; }\n\n*, *:before, *:after {\n box-sizing: border-box; }\n\ninput:focus {\n outline: none; }\n\ninput[disabled] {\n background-color: transparent; }\n\n.vue-tags-input {\n max-width: 450px;\n position: relative;\n background-color: #fff; }\n\ndiv.vue-tags-input.disabled {\n opacity: 0.5; }\n div.vue-tags-input.disabled * {\n cursor: default; }\n\n.ti-input {\n border: 1px solid #ccc;\n display: flex;\n padding: 4px;\n flex-wrap: wrap; }\n\n.ti-tags {\n display: flex;\n flex-wrap: wrap;\n width: 100%;\n line-height: 1em; }\n\n.ti-tag {\n background-color: #5C6BC0;\n color: #fff;\n border-radius: 2px;\n display: flex;\n padding: 3px 5px;\n margin: 2px;\n font-size: .85em; }\n .ti-tag:focus {\n outline: none; }\n .ti-tag .ti-content {\n display: flex;\n align-items: center; }\n .ti-tag .ti-tag-center {\n position: relative; }\n .ti-tag span {\n line-height: .85em; }\n .ti-tag span.ti-hidden {\n padding-left: 14px;\n visibility: hidden;\n height: 0px;\n white-space: pre; }\n .ti-tag .ti-actions {\n margin-left: 2px;\n display: flex;\n align-items: center;\n font-size: 1.15em; }\n .ti-tag .ti-actions i {\n cursor: pointer; }\n .ti-tag:last-child {\n margin-right: 4px; }\n .ti-tag.ti-invalid, .ti-tag.ti-tag.ti-deletion-mark {\n background-color: #e54d42; }\n\n.ti-new-tag-input-wrapper {\n display: flex;\n flex: 1 0 auto;\n padding: 3px 5px;\n margin: 2px;\n font-size: .85em; }\n .ti-new-tag-input-wrapper input {\n flex: 1 0 auto;\n min-width: 100px;\n border: none;\n padding: 0px;\n margin: 0px; }\n\n.ti-new-tag-input {\n line-height: initial; }\n\n.ti-autocomplete {\n border: 1px solid #ccc;\n border-top: none;\n position: absolute;\n width: 100%;\n background-color: #fff;\n z-index: 20; }\n\n.ti-item > div {\n cursor: pointer;\n padding: 3px 6px;\n width: 100%; }\n\n.ti-selected-item {\n background-color: #5C6BC0;\n color: #fff; }\n'],sourceRoot:""}])},function(t,e,n){"use strict";t.exports=function(t){return"string"!=typeof t?t:(/^['"].*['"]$/.test(t)&&(t=t.slice(1,-1)),/["'() \t\n]/.test(t)?'"'+t.replace(/"/g,'\\"').replace(/\n/g,"\\n")+'"':t)}},function(t,e){t.exports="data:font/ttf;base64,AAEAAAALAIAAAwAwT1MvMg8SBawAAAC8AAAAYGNtYXAXVtKJAAABHAAAAFRnYXNwAAAAEAAAAXAAAAAIZ2x5ZqWfozAAAAF4AAAA/GhlYWQPxZgIAAACdAAAADZoaGVhB4ADyAAAAqwAAAAkaG10eBIAAb4AAALQAAAAHGxvY2EAkgDiAAAC7AAAABBtYXhwAAkAHwAAAvwAAAAgbmFtZZlKCfsAAAMcAAABhnBvc3QAAwAAAAAEpAAAACAAAwOAAZAABQAAApkCzAAAAI8CmQLMAAAB6wAzAQkAAAAAAAAAAAAAAAAAAAABEAAAAAAAAAAAAAAAAAAAAABAAADpAgPA/8AAQAPAAEAAAAABAAAAAAAAAAAAAAAgAAAAAAADAAAAAwAAABwAAQADAAAAHAADAAEAAAAcAAQAOAAAAAoACAACAAIAAQAg6QL//f//AAAAAAAg6QD//f//AAH/4xcEAAMAAQAAAAAAAAAAAAAAAQAB//8ADwABAAAAAAAAAAAAAgAANzkBAAAAAAEAAAAAAAAAAAACAAA3OQEAAAAAAQAAAAAAAAAAAAIAADc5AQAAAAABAFYBAQO+AoEAHAAAATIXHgEXFhcHJicuAScmIyIGBxchERc2Nz4BNzYCFkpDQ28pKRdkECAfVTM0OT9wLZz+gJgdIiJLKSgCVRcYUjg5QiAzKys+ERIrJZoBgJoZFRQcCAgAAQDWAIEDKgLVAAsAAAEHFwcnByc3JzcXNwMq7u487u487u487u4Cme7uPO7uPO7uPO7uAAEAkgCBA4ACvQAFAAAlARcBJzcBgAHEPP4A7jz5AcQ8/gDuPAAAAAABAAAAAAAAH8nTUV8PPPUACwQAAAAAANZ1KhsAAAAA1nUqGwAAAAADvgLVAAAACAACAAAAAAAAAAEAAAPA/8AAAAQAAAAAAAO+AAEAAAAAAAAAAAAAAAAAAAAHBAAAAAAAAAAAAAAAAgAAAAQAAFYEAADWBAAAkgAAAAAACgAUAB4AUABqAH4AAQAAAAcAHQABAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAA4ArgABAAAAAAABAAcAAAABAAAAAAACAAcAYAABAAAAAAADAAcANgABAAAAAAAEAAcAdQABAAAAAAAFAAsAFQABAAAAAAAGAAcASwABAAAAAAAKABoAigADAAEECQABAA4ABwADAAEECQACAA4AZwADAAEECQADAA4APQADAAEECQAEAA4AfAADAAEECQAFABYAIAADAAEECQAGAA4AUgADAAEECQAKADQApGljb21vb24AaQBjAG8AbQBvAG8AblZlcnNpb24gMS4wAFYAZQByAHMAaQBvAG4AIAAxAC4AMGljb21vb24AaQBjAG8AbQBvAG8Abmljb21vb24AaQBjAG8AbQBvAG8AblJlZ3VsYXIAUgBlAGcAdQBsAGEAcmljb21vb24AaQBjAG8AbQBvAG8AbkZvbnQgZ2VuZXJhdGVkIGJ5IEljb01vb24uAEYAbwBuAHQAIABnAGUAbgBlAHIAYQB0AGUAZAAgAGIAeQAgAEkAYwBvAE0AbwBvAG4ALgAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="},function(t,e){t.exports="data:font/woff;base64,d09GRgABAAAAAAUQAAsAAAAABMQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABPUy8yAAABCAAAAGAAAABgDxIFrGNtYXAAAAFoAAAAVAAAAFQXVtKJZ2FzcAAAAbwAAAAIAAAACAAAABBnbHlmAAABxAAAAPwAAAD8pZ+jMGhlYWQAAALAAAAANgAAADYPxZgIaGhlYQAAAvgAAAAkAAAAJAeAA8hobXR4AAADHAAAABwAAAAcEgABvmxvY2EAAAM4AAAAEAAAABAAkgDibWF4cAAAA0gAAAAgAAAAIAAJAB9uYW1lAAADaAAAAYYAAAGGmUoJ+3Bvc3QAAATwAAAAIAAAACAAAwAAAAMDgAGQAAUAAAKZAswAAACPApkCzAAAAesAMwEJAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAQAAA6QIDwP/AAEADwABAAAAAAQAAAAAAAAAAAAAAIAAAAAAAAwAAAAMAAAAcAAEAAwAAABwAAwABAAAAHAAEADgAAAAKAAgAAgACAAEAIOkC//3//wAAAAAAIOkA//3//wAB/+MXBAADAAEAAAAAAAAAAAAAAAEAAf//AA8AAQAAAAAAAAAAAAIAADc5AQAAAAABAAAAAAAAAAAAAgAANzkBAAAAAAEAAAAAAAAAAAACAAA3OQEAAAAAAQBWAQEDvgKBABwAAAEyFx4BFxYXByYnLgEnJiMiBgcXIREXNjc+ATc2AhZKQ0NvKSkXZBAgH1UzNDk/cC2c/oCYHSIiSykoAlUXGFI4OUIgMysrPhESKyWaAYCaGRUUHAgIAAEA1gCBAyoC1QALAAABBxcHJwcnNyc3FzcDKu7uPO7uPO7uPO7uApnu7jzu7jzu7jzu7gABAJIAgQOAAr0ABQAAJQEXASc3AYABxDz+AO48+QHEPP4A7jwAAAAAAQAAAAAAAB/J01FfDzz1AAsEAAAAAADWdSobAAAAANZ1KhsAAAAAA74C1QAAAAgAAgAAAAAAAAABAAADwP/AAAAEAAAAAAADvgABAAAAAAAAAAAAAAAAAAAABwQAAAAAAAAAAAAAAAIAAAAEAABWBAAA1gQAAJIAAAAAAAoAFAAeAFAAagB+AAEAAAAHAB0AAQAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAOAK4AAQAAAAAAAQAHAAAAAQAAAAAAAgAHAGAAAQAAAAAAAwAHADYAAQAAAAAABAAHAHUAAQAAAAAABQALABUAAQAAAAAABgAHAEsAAQAAAAAACgAaAIoAAwABBAkAAQAOAAcAAwABBAkAAgAOAGcAAwABBAkAAwAOAD0AAwABBAkABAAOAHwAAwABBAkABQAWACAAAwABBAkABgAOAFIAAwABBAkACgA0AKRpY29tb29uAGkAYwBvAG0AbwBvAG5WZXJzaW9uIDEuMABWAGUAcgBzAGkAbwBuACAAMQAuADBpY29tb29uAGkAYwBvAG0AbwBvAG5pY29tb29uAGkAYwBvAG0AbwBvAG5SZWd1bGFyAFIAZQBnAHUAbABhAHJpY29tb29uAGkAYwBvAG0AbwBvAG5Gb250IGdlbmVyYXRlZCBieSBJY29Nb29uLgBGAG8AbgB0ACAAZwBlAG4AZQByAGEAdABlAGQAIABiAHkAIABJAGMAbwBNAG8AbwBuAC4AAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},function(t,e,n){"use strict";n.r(e);var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"vue-tags-input",class:[{"ti-disabled":t.disabled},{"ti-focus":t.focused}]},[n("div",{staticClass:"ti-input"},[t.tagsCopy?n("ul",{staticClass:"ti-tags"},[t._l(t.tagsCopy,function(e,r){return n("li",{key:r,staticClass:"ti-tag",class:[{"ti-editing":t.tagsEditStatus[r]},e.tiClasses,e.classes,{"ti-deletion-mark":t.isMarked(r)}],style:e.style,attrs:{tabindex:"0"},on:{click:function(n){return t.$emit("tag-clicked",{tag:e,index:r})}}},[n("div",{staticClass:"ti-content"},[t.$scopedSlots["tag-left"]?n("div",{staticClass:"ti-tag-left"},[t._t("tag-left",null,{tag:e,index:r,edit:t.tagsEditStatus[r],performSaveEdit:t.performSaveTag,performDelete:t.performDeleteTag,performCancelEdit:t.cancelEdit,performOpenEdit:t.performEditTag,deletionMark:t.isMarked(r)})],2):t._e(),t._v(" "),n("div",{ref:"tagCenter",refInFor:!0,staticClass:"ti-tag-center"},[t.$scopedSlots["tag-center"]?t._e():n("span",{class:{"ti-hidden":t.tagsEditStatus[r]},on:{click:function(e){return t.performEditTag(r)}}},[t._v(t._s(e.text))]),t._v(" "),t.$scopedSlots["tag-center"]?t._e():n("tag-input",{attrs:{scope:{edit:t.tagsEditStatus[r],maxlength:t.maxlength,tag:e,index:r,validateTag:t.createChangedTag,performCancelEdit:t.cancelEdit,performSaveEdit:t.performSaveTag}}}),t._v(" "),t._t("tag-center",null,{tag:e,index:r,maxlength:t.maxlength,edit:t.tagsEditStatus[r],performSaveEdit:t.performSaveTag,performDelete:t.performDeleteTag,performCancelEdit:t.cancelEdit,validateTag:t.createChangedTag,performOpenEdit:t.performEditTag,deletionMark:t.isMarked(r)})],2),t._v(" "),t.$scopedSlots["tag-right"]?n("div",{staticClass:"ti-tag-right"},[t._t("tag-right",null,{tag:e,index:r,edit:t.tagsEditStatus[r],performSaveEdit:t.performSaveTag,performDelete:t.performDeleteTag,performCancelEdit:t.cancelEdit,performOpenEdit:t.performEditTag,deletionMark:t.isMarked(r)})],2):t._e()]),t._v(" "),n("div",{staticClass:"ti-actions"},[t.$scopedSlots["tag-actions"]?t._e():n("i",{directives:[{name:"show",rawName:"v-show",value:t.tagsEditStatus[r],expression:"tagsEditStatus[index]"}],staticClass:"ti-icon-undo",on:{click:function(e){return t.cancelEdit(r)}}}),t._v(" "),t.$scopedSlots["tag-actions"]?t._e():n("i",{directives:[{name:"show",rawName:"v-show",value:!t.tagsEditStatus[r],expression:"!tagsEditStatus[index]"}],staticClass:"ti-icon-close",on:{click:function(e){return t.performDeleteTag(r)}}}),t._v(" "),t.$scopedSlots["tag-actions"]?t._t("tag-actions",null,{tag:e,index:r,edit:t.tagsEditStatus[r],performSaveEdit:t.performSaveTag,performDelete:t.performDeleteTag,performCancelEdit:t.cancelEdit,performOpenEdit:t.performEditTag,deletionMark:t.isMarked(r)}):t._e()],2)])}),t._v(" "),n("li",{staticClass:"ti-new-tag-input-wrapper"},[n("input",t._b({ref:"newTagInput",staticClass:"ti-new-tag-input",class:[t.createClasses(t.newTag,t.tags,t.validation,t.isDuplicate)],attrs:{placeholder:t.placeholder,maxlength:t.maxlength,disabled:t.disabled,type:"text",size:"1"},domProps:{value:t.newTag},on:{keydown:[function(e){return t.performAddTags(t.filteredAutocompleteItems[t.selectedItem]||t.newTag,e)},function(e){return e.type.indexOf("key")||8===e.keyCode?t.invokeDelete(e):null},function(e){return e.type.indexOf("key")||9===e.keyCode?t.performBlur(e):null},function(e){return e.type.indexOf("key")||38===e.keyCode?t.selectItem(e,"before"):null},function(e){return e.type.indexOf("key")||40===e.keyCode?t.selectItem(e,"after"):null}],paste:t.addTagsFromPaste,input:t.updateNewTag,blur:function(e){return t.$emit("blur",e)},focus:function(e){t.focused=!0,t.$emit("focus",e)},click:function(e){!t.addOnlyFromAutocomplete&&(t.selectedItem=null)}}},"input",t.$attrs,!1))])],2):t._e()]),t._v(" "),t._t("between-elements"),t._v(" "),t.autocompleteOpen?n("div",{staticClass:"ti-autocomplete",on:{mouseout:function(e){t.selectedItem=null}}},[t._t("autocomplete-header"),t._v(" "),n("ul",t._l(t.filteredAutocompleteItems,function(e,r){return n("li",{key:r,staticClass:"ti-item",class:[e.tiClasses,e.classes,{"ti-selected-item":t.isSelected(r)}],style:e.style,on:{mouseover:function(e){!t.disabled&&(t.selectedItem=r)}}},[t.$scopedSlots["autocomplete-item"]?t._t("autocomplete-item",null,{item:e,index:r,performAdd:function(e){return t.performAddTags(e,void 0,"autocomplete")},selected:t.isSelected(r)}):n("div",{on:{click:function(n){return t.performAddTags(e,void 0,"autocomplete")}}},[t._v("\n "+t._s(e.text)+"\n ")])],2)}),0),t._v(" "),t._t("autocomplete-footer")],2):t._e()],2)};r._withStripped=!0;var i=n(5),o=n.n(i),a=function(t){return JSON.parse(JSON.stringify(t))},s=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=arguments.length>3?arguments[3]:void 0;void 0===t.text&&(t={text:t});var i=function(t,e){return n.filter(function(e){var n=t.text;return"string"==typeof e.rule?!new RegExp(e.rule).test(n):e.rule instanceof RegExp?!e.rule.test(n):"[object Function]"==={}.toString.call(e.rule)?e.rule(t):void 0}).map(function(t){return t.classes})}(t),o=function(t,e){for(var n=0;n1?n-1:0),i=1;i1?e-1:0),r=1;r=this.autocompleteMinLength&&this.filteredAutocompleteItems.length>0&&this.focused},filteredAutocompleteItems:function(){var t=this,e=this.autocompleteItems.map(function(e){return c(e,t.tags,t.validation,t.isDuplicate)});return this.autocompleteFilterDuplicates?e.filter(this.duplicateFilter):e}},methods:{createClasses:s,getSelectedIndex:function(t){var e=this.filteredAutocompleteItems,n=this.selectedItem,r=e.length-1;if(0!==e.length)return null===n?0:"before"===t&&0===n?r:"after"===t&&n===r?0:"after"===t?n+1:n-1},selectDefaultItem:function(){this.addOnlyFromAutocomplete&&this.filteredAutocompleteItems.length>0?this.selectedItem=0:this.selectedItem=null},selectItem:function(t,e){t.preventDefault(),this.selectedItem=this.getSelectedIndex(e)},isSelected:function(t){return this.selectedItem===t},isMarked:function(t){return this.deletionMark===t},invokeDelete:function(){var t=this;if(this.deleteOnBackspace&&!(this.newTag.length>0)){var e=this.tagsCopy.length-1;null===this.deletionMark?(this.deletionMarkTime=setTimeout(function(){return t.deletionMark=null},1e3),this.deletionMark=e):this.performDeleteTag(e)}},addTagsFromPaste:function(){var t=this;this.addFromPaste&&setTimeout(function(){return t.performAddTags(t.newTag)},10)},performEditTag:function(t){var e=this;this.allowEditTags&&(this._events["before-editing-tag"]||this.editTag(t),this.$emit("before-editing-tag",{index:t,tag:this.tagsCopy[t],editTag:function(){return e.editTag(t)}}))},editTag:function(t){this.allowEditTags&&(this.toggleEditMode(t),this.focus(t))},toggleEditMode:function(t){this.allowEditTags&&!this.disabled&&this.$set(this.tagsEditStatus,t,!this.tagsEditStatus[t])},createChangedTag:function(t,e){var n=this.tagsCopy[t];n.text=e?e.target.value:this.tagsCopy[t].text,this.$set(this.tagsCopy,t,c(n,this.tagsCopy,this.validation,this.isDuplicate))},focus:function(t){var e=this;this.$nextTick(function(){var n=e.$refs.tagCenter[t].querySelector("input.ti-tag-input");n&&n.focus()})},quote:function(t){return t.replace(/([()[{*+.$^\\|?])/g,"\\$1")},cancelEdit:function(t){this.tags[t]&&(this.tagsCopy[t]=a(c(this.tags[t],this.tags,this.validation,this.isDuplicate)),this.$set(this.tagsEditStatus,t,!1))},hasForbiddingAddRule:function(t){var e=this;return t.some(function(t){var n=e.validation.find(function(e){return t===e.classes});return!!n&&n.disableAdd})},createTagTexts:function(t){var e=this,n=new RegExp(this.separators.map(function(t){return e.quote(t)}).join("|"));return t.split(n).map(function(t){return{text:t}})},performDeleteTag:function(t){var e=this;this._events["before-deleting-tag"]||this.deleteTag(t),this.$emit("before-deleting-tag",{index:t,tag:this.tagsCopy[t],deleteTag:function(){return e.deleteTag(t)}})},deleteTag:function(t){this.disabled||(this.deletionMark=null,clearTimeout(this.deletionMarkTime),this.tagsCopy.splice(t,1),this._events["update:tags"]&&this.$emit("update:tags",this.tagsCopy),this.$emit("tags-changed",this.tagsCopy))},noTriggerKey:function(t,e){var n=-1!==this[e].indexOf(t.keyCode)||-1!==this[e].indexOf(t.key);return n&&t.preventDefault(),!n},performAddTags:function(t,e,n){var r=this;if(!(this.disabled||e&&this.noTriggerKey(e,"addOnKey"))){var i=[];"object"===y(t)&&(i=[t]),"string"==typeof t&&(i=this.createTagTexts(t)),(i=i.filter(function(t){return t.text.trim().length>0})).forEach(function(t){t=c(t,r.tags,r.validation,r.isDuplicate),r._events["before-adding-tag"]||r.addTag(t,n),r.$emit("before-adding-tag",{tag:t,addTag:function(){return r.addTag(t,n)}})})}},duplicateFilter:function(t){return this.isDuplicate?!this.isDuplicate(this.tagsCopy,t):!this.tagsCopy.find(function(e){return e.text===t.text})},addTag:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"new-tag-input",r=this.filteredAutocompleteItems.map(function(t){return t.text});this.addOnlyFromAutocomplete&&-1===r.indexOf(t.text)||this.$nextTick(function(){return e.maxTags&&e.maxTags<=e.tagsCopy.length?e.$emit("max-tags-reached",t):e.avoidAddingDuplicates&&!e.duplicateFilter(t)?e.$emit("adding-duplicate",t):void(e.hasForbiddingAddRule(t.tiClasses)||(e.$emit("input",""),e.tagsCopy.push(t),e._events["update:tags"]&&e.$emit("update:tags",e.tagsCopy),"autocomplete"===n&&e.$refs.newTagInput.focus(),e.$emit("tags-changed",e.tagsCopy)))})},performSaveTag:function(t,e){var n=this,r=this.tagsCopy[t];this.disabled||e&&this.noTriggerKey(e,"addOnKey")||0!==r.text.trim().length&&(this._events["before-saving-tag"]||this.saveTag(t,r),this.$emit("before-saving-tag",{index:t,tag:r,saveTag:function(){return n.saveTag(t,r)}}))},saveTag:function(t,e){if(this.avoidAddingDuplicates){var n=a(this.tagsCopy),r=n.splice(t,1)[0];if(this.isDuplicate?this.isDuplicate(n,r):-1!==n.map(function(t){return t.text}).indexOf(r.text))return this.$emit("saving-duplicate",e)}this.hasForbiddingAddRule(e.tiClasses)||(this.$set(this.tagsCopy,t,e),this.toggleEditMode(t),this._events["update:tags"]&&this.$emit("update:tags",this.tagsCopy),this.$emit("tags-changed",this.tagsCopy))},tagsEqual:function(){var t=this;return!this.tagsCopy.some(function(e,n){return!o()(e,t.tags[n])})},updateNewTag:function(t){var e=t.target.value;this.newTag=e,this.$emit("input",e)},initTags:function(){this.tagsCopy=u(this.tags,this.validation,this.isDuplicate),this.tagsEditStatus=a(this.tags).map(function(){return!1}),this._events["update:tags"]&&!this.tagsEqual()&&this.$emit("update:tags",this.tagsCopy)},blurredOnClick:function(t){this.$el.contains(t.target)||this.$el.contains(document.activeElement)||this.performBlur(t)},performBlur:function(){this.addOnBlur&&this.focused&&this.performAddTags(this.newTag),this.focused=!1}},watch:{value:function(t){this.addOnlyFromAutocomplete||(this.selectedItem=null),this.newTag=t},tags:{handler:function(){this.initTags()},deep:!0},autocompleteOpen:"selectDefaultItem"},created:function(){this.newTag=this.value,this.initTags()},mounted:function(){this.selectDefaultItem(),document.addEventListener("click",this.blurredOnClick)},destroyed:function(){document.removeEventListener("click",this.blurredOnClick)}},_=(n(9),d(A,r,[],!1,null,"61d92e31",null));_.options.__file="vue-tags-input/vue-tags-input.vue";var b=_.exports;n.d(e,"VueTagsInput",function(){return b}),n.d(e,"createClasses",function(){return s}),n.d(e,"createTag",function(){return c}),n.d(e,"createTags",function(){return u}),n.d(e,"TagInput",function(){return h}),b.install=function(t){return t.component(b.name,b)},"undefined"!=typeof window&&window.Vue&&window.Vue.use(b),e.default=b}])},function(t,e,n){t.exports=n(50)},function(t,e,n){window._=n(19);try{window.$=window.jQuery=n(21),n(22)}catch(t){}window.axios=n(9),window.axios.defaults.headers.common["X-Requested-With"]="XMLHttpRequest";var r=document.head.querySelector('meta[name="csrf-token"]');r?window.axios.defaults.headers.common["X-CSRF-TOKEN"]=r.content:console.error("CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token")},function(t,e,n){(function(t,r){var i;(function(){var o,a=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",c="Expected a function",u="__lodash_hash_undefined__",l=500,f="__lodash_placeholder__",d=1,p=2,h=4,v=1,m=2,g=1,y=2,A=4,_=8,b=16,w=32,x=64,C=128,T=256,k=512,E=30,$="...",S=800,B=16,D=1,O=2,I=1/0,N=9007199254740991,j=17976931348623157e292,P=NaN,R=4294967295,L=R-1,M=R>>>1,F=[["ary",C],["bind",g],["bindKey",y],["curry",_],["curryRight",b],["flip",k],["partial",w],["partialRight",x],["rearg",T]],U="[object Arguments]",H="[object Array]",z="[object AsyncFunction]",q="[object Boolean]",W="[object Date]",V="[object DOMException]",Q="[object Error]",Y="[object Function]",G="[object GeneratorFunction]",K="[object Map]",J="[object Number]",Z="[object Null]",X="[object Object]",tt="[object Proxy]",et="[object RegExp]",nt="[object Set]",rt="[object String]",it="[object Symbol]",ot="[object Undefined]",at="[object WeakMap]",st="[object WeakSet]",ct="[object ArrayBuffer]",ut="[object DataView]",lt="[object Float32Array]",ft="[object Float64Array]",dt="[object Int8Array]",pt="[object Int16Array]",ht="[object Int32Array]",vt="[object Uint8Array]",mt="[object Uint8ClampedArray]",gt="[object Uint16Array]",yt="[object Uint32Array]",At=/\b__p \+= '';/g,_t=/\b(__p \+=) '' \+/g,bt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,wt=/&(?:amp|lt|gt|quot|#39);/g,xt=/[&<>"']/g,Ct=RegExp(wt.source),Tt=RegExp(xt.source),kt=/<%-([\s\S]+?)%>/g,Et=/<%([\s\S]+?)%>/g,$t=/<%=([\s\S]+?)%>/g,St=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Bt=/^\w*$/,Dt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ot=/[\\^$.*+?()[\]{}|]/g,It=RegExp(Ot.source),Nt=/^\s+|\s+$/g,jt=/^\s+/,Pt=/\s+$/,Rt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Lt=/\{\n\/\* \[wrapped with (.+)\] \*/,Mt=/,? & /,Ft=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Ut=/\\(\\)?/g,Ht=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,zt=/\w*$/,qt=/^[-+]0x[0-9a-f]+$/i,Wt=/^0b[01]+$/i,Vt=/^\[object .+?Constructor\]$/,Qt=/^0o[0-7]+$/i,Yt=/^(?:0|[1-9]\d*)$/,Gt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Kt=/($^)/,Jt=/['\n\r\u2028\u2029\\]/g,Zt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Xt="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",te="[\\ud800-\\udfff]",ee="["+Xt+"]",ne="["+Zt+"]",re="\\d+",ie="[\\u2700-\\u27bf]",oe="[a-z\\xdf-\\xf6\\xf8-\\xff]",ae="[^\\ud800-\\udfff"+Xt+re+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",se="\\ud83c[\\udffb-\\udfff]",ce="[^\\ud800-\\udfff]",ue="(?:\\ud83c[\\udde6-\\uddff]){2}",le="[\\ud800-\\udbff][\\udc00-\\udfff]",fe="[A-Z\\xc0-\\xd6\\xd8-\\xde]",de="(?:"+oe+"|"+ae+")",pe="(?:"+fe+"|"+ae+")",he="(?:"+ne+"|"+se+")"+"?",ve="[\\ufe0e\\ufe0f]?"+he+("(?:\\u200d(?:"+[ce,ue,le].join("|")+")[\\ufe0e\\ufe0f]?"+he+")*"),me="(?:"+[ie,ue,le].join("|")+")"+ve,ge="(?:"+[ce+ne+"?",ne,ue,le,te].join("|")+")",ye=RegExp("['’]","g"),Ae=RegExp(ne,"g"),_e=RegExp(se+"(?="+se+")|"+ge+ve,"g"),be=RegExp([fe+"?"+oe+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[ee,fe,"$"].join("|")+")",pe+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[ee,fe+de,"$"].join("|")+")",fe+"?"+de+"+(?:['’](?:d|ll|m|re|s|t|ve))?",fe+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",re,me].join("|"),"g"),we=RegExp("[\\u200d\\ud800-\\udfff"+Zt+"\\ufe0e\\ufe0f]"),xe=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Ce=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Te=-1,ke={};ke[lt]=ke[ft]=ke[dt]=ke[pt]=ke[ht]=ke[vt]=ke[mt]=ke[gt]=ke[yt]=!0,ke[U]=ke[H]=ke[ct]=ke[q]=ke[ut]=ke[W]=ke[Q]=ke[Y]=ke[K]=ke[J]=ke[X]=ke[et]=ke[nt]=ke[rt]=ke[at]=!1;var Ee={};Ee[U]=Ee[H]=Ee[ct]=Ee[ut]=Ee[q]=Ee[W]=Ee[lt]=Ee[ft]=Ee[dt]=Ee[pt]=Ee[ht]=Ee[K]=Ee[J]=Ee[X]=Ee[et]=Ee[nt]=Ee[rt]=Ee[it]=Ee[vt]=Ee[mt]=Ee[gt]=Ee[yt]=!0,Ee[Q]=Ee[Y]=Ee[at]=!1;var $e={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Se=parseFloat,Be=parseInt,De="object"==typeof t&&t&&t.Object===Object&&t,Oe="object"==typeof self&&self&&self.Object===Object&&self,Ie=De||Oe||Function("return this")(),Ne=e&&!e.nodeType&&e,je=Ne&&"object"==typeof r&&r&&!r.nodeType&&r,Pe=je&&je.exports===Ne,Re=Pe&&De.process,Le=function(){try{var t=je&&je.require&&je.require("util").types;return t||Re&&Re.binding&&Re.binding("util")}catch(t){}}(),Me=Le&&Le.isArrayBuffer,Fe=Le&&Le.isDate,Ue=Le&&Le.isMap,He=Le&&Le.isRegExp,ze=Le&&Le.isSet,qe=Le&&Le.isTypedArray;function We(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function Ve(t,e,n,r){for(var i=-1,o=null==t?0:t.length;++i-1}function Ze(t,e,n){for(var r=-1,i=null==t?0:t.length;++r-1;);return n}function bn(t,e){for(var n=t.length;n--&&cn(e,t[n],0)>-1;);return n}var wn=pn({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n",ſ:"s"}),xn=pn({"&":"&","<":"<",">":">",'"':""","'":"'"});function Cn(t){return"\\"+$e[t]}function Tn(t){return we.test(t)}function kn(t){var e=-1,n=Array(t.size);return t.forEach(function(t,r){n[++e]=[r,t]}),n}function En(t,e){return function(n){return t(e(n))}}function $n(t,e){for(var n=-1,r=t.length,i=0,o=[];++n",""":'"',"'":"'"});var Nn=function t(e){var n,r=(e=null==e?Ie:Nn.defaults(Ie.Object(),e,Nn.pick(Ie,Ce))).Array,i=e.Date,Zt=e.Error,Xt=e.Function,te=e.Math,ee=e.Object,ne=e.RegExp,re=e.String,ie=e.TypeError,oe=r.prototype,ae=Xt.prototype,se=ee.prototype,ce=e["__core-js_shared__"],ue=ae.toString,le=se.hasOwnProperty,fe=0,de=(n=/[^.]+$/.exec(ce&&ce.keys&&ce.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",pe=se.toString,he=ue.call(ee),ve=Ie._,me=ne("^"+ue.call(le).replace(Ot,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ge=Pe?e.Buffer:o,_e=e.Symbol,we=e.Uint8Array,$e=ge?ge.allocUnsafe:o,De=En(ee.getPrototypeOf,ee),Oe=ee.create,Ne=se.propertyIsEnumerable,je=oe.splice,Re=_e?_e.isConcatSpreadable:o,Le=_e?_e.iterator:o,on=_e?_e.toStringTag:o,pn=function(){try{var t=Mo(ee,"defineProperty");return t({},"",{}),t}catch(t){}}(),jn=e.clearTimeout!==Ie.clearTimeout&&e.clearTimeout,Pn=i&&i.now!==Ie.Date.now&&i.now,Rn=e.setTimeout!==Ie.setTimeout&&e.setTimeout,Ln=te.ceil,Mn=te.floor,Fn=ee.getOwnPropertySymbols,Un=ge?ge.isBuffer:o,Hn=e.isFinite,zn=oe.join,qn=En(ee.keys,ee),Wn=te.max,Vn=te.min,Qn=i.now,Yn=e.parseInt,Gn=te.random,Kn=oe.reverse,Jn=Mo(e,"DataView"),Zn=Mo(e,"Map"),Xn=Mo(e,"Promise"),tr=Mo(e,"Set"),er=Mo(e,"WeakMap"),nr=Mo(ee,"create"),rr=er&&new er,ir={},or=fa(Jn),ar=fa(Zn),sr=fa(Xn),cr=fa(tr),ur=fa(er),lr=_e?_e.prototype:o,fr=lr?lr.valueOf:o,dr=lr?lr.toString:o;function pr(t){if($s(t)&&!gs(t)&&!(t instanceof gr)){if(t instanceof mr)return t;if(le.call(t,"__wrapped__"))return da(t)}return new mr(t)}var hr=function(){function t(){}return function(e){if(!Es(e))return{};if(Oe)return Oe(e);t.prototype=e;var n=new t;return t.prototype=o,n}}();function vr(){}function mr(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=o}function gr(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=R,this.__views__=[]}function yr(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e=e?t:e)),t}function jr(t,e,n,r,i,a){var s,c=e&d,u=e&p,l=e&h;if(n&&(s=i?n(t,r,i,a):n(t)),s!==o)return s;if(!Es(t))return t;var f=gs(t);if(f){if(s=function(t){var e=t.length,n=new t.constructor(e);e&&"string"==typeof t[0]&&le.call(t,"index")&&(n.index=t.index,n.input=t.input);return n}(t),!c)return no(t,s)}else{var v=Ho(t),m=v==Y||v==G;if(bs(t))return Ki(t,c);if(v==X||v==U||m&&!i){if(s=u||m?{}:qo(t),!c)return u?function(t,e){return ro(t,Uo(t),e)}(t,function(t,e){return t&&ro(e,oc(e),t)}(s,t)):function(t,e){return ro(t,Fo(t),e)}(t,Dr(s,t))}else{if(!Ee[v])return i?t:{};s=function(t,e,n){var r=t.constructor;switch(e){case ct:return Ji(t);case q:case W:return new r(+t);case ut:return function(t,e){var n=e?Ji(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case lt:case ft:case dt:case pt:case ht:case vt:case mt:case gt:case yt:return Zi(t,n);case K:return new r;case J:case rt:return new r(t);case et:return function(t){var e=new t.constructor(t.source,zt.exec(t));return e.lastIndex=t.lastIndex,e}(t);case nt:return new r;case it:return i=t,fr?ee(fr.call(i)):{}}var i}(t,v,c)}}a||(a=new wr);var g=a.get(t);if(g)return g;a.set(t,s),Is(t)?t.forEach(function(r){s.add(jr(r,e,n,r,t,a))}):Ss(t)&&t.forEach(function(r,i){s.set(i,jr(r,e,n,i,t,a))});var y=f?o:(l?u?Oo:Do:u?oc:ic)(t);return Qe(y||t,function(r,i){y&&(r=t[i=r]),$r(s,i,jr(r,e,n,i,t,a))}),s}function Pr(t,e,n){var r=n.length;if(null==t)return!r;for(t=ee(t);r--;){var i=n[r],a=e[i],s=t[i];if(s===o&&!(i in t)||!a(s))return!1}return!0}function Rr(t,e,n){if("function"!=typeof t)throw new ie(c);return ia(function(){t.apply(o,n)},e)}function Lr(t,e,n,r){var i=-1,o=Je,s=!0,c=t.length,u=[],l=e.length;if(!c)return u;n&&(e=Xe(e,gn(n))),r?(o=Ze,s=!1):e.length>=a&&(o=An,s=!1,e=new br(e));t:for(;++i-1},Ar.prototype.set=function(t,e){var n=this.__data__,r=Sr(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},_r.prototype.clear=function(){this.size=0,this.__data__={hash:new yr,map:new(Zn||Ar),string:new yr}},_r.prototype.delete=function(t){var e=Ro(this,t).delete(t);return this.size-=e?1:0,e},_r.prototype.get=function(t){return Ro(this,t).get(t)},_r.prototype.has=function(t){return Ro(this,t).has(t)},_r.prototype.set=function(t,e){var n=Ro(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},br.prototype.add=br.prototype.push=function(t){return this.__data__.set(t,u),this},br.prototype.has=function(t){return this.__data__.has(t)},wr.prototype.clear=function(){this.__data__=new Ar,this.size=0},wr.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},wr.prototype.get=function(t){return this.__data__.get(t)},wr.prototype.has=function(t){return this.__data__.has(t)},wr.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Ar){var r=n.__data__;if(!Zn||r.length0&&n(s)?e>1?qr(s,e-1,n,r,i):tn(i,s):r||(i[i.length]=s)}return i}var Wr=so(),Vr=so(!0);function Qr(t,e){return t&&Wr(t,e,ic)}function Yr(t,e){return t&&Vr(t,e,ic)}function Gr(t,e){return Ke(e,function(e){return Cs(t[e])})}function Kr(t,e){for(var n=0,r=(e=Vi(e,t)).length;null!=t&&ne}function ti(t,e){return null!=t&&le.call(t,e)}function ei(t,e){return null!=t&&e in ee(t)}function ni(t,e,n){for(var i=n?Ze:Je,a=t[0].length,s=t.length,c=s,u=r(s),l=1/0,f=[];c--;){var d=t[c];c&&e&&(d=Xe(d,gn(e))),l=Vn(d.length,l),u[c]=!n&&(e||a>=120&&d.length>=120)?new br(c&&d):o}d=t[0];var p=-1,h=u[0];t:for(;++p=s)return c;var u=n[r];return c*("desc"==u?-1:1)}}return t.index-e.index}(t,e,n)})}function yi(t,e,n){for(var r=-1,i=e.length,o={};++r-1;)s!==t&&je.call(s,c,1),je.call(t,c,1);return t}function _i(t,e){for(var n=t?e.length:0,r=n-1;n--;){var i=e[n];if(n==r||i!==o){var o=i;Vo(i)?je.call(t,i,1):Li(t,i)}}return t}function bi(t,e){return t+Mn(Gn()*(e-t+1))}function wi(t,e){var n="";if(!t||e<1||e>N)return n;do{e%2&&(n+=t),(e=Mn(e/2))&&(t+=t)}while(e);return n}function xi(t,e){return oa(ta(t,e,Bc),t+"")}function Ci(t){return Cr(pc(t))}function Ti(t,e){var n=pc(t);return ca(n,Nr(e,0,n.length))}function ki(t,e,n,r){if(!Es(t))return t;for(var i=-1,a=(e=Vi(e,t)).length,s=a-1,c=t;null!=c&&++io?0:o+e),(n=n>o?o:n)<0&&(n+=o),o=e>n?0:n-e>>>0,e>>>=0;for(var a=r(o);++i>>1,a=t[o];null!==a&&!js(a)&&(n?a<=e:a=a){var l=e?null:xo(t);if(l)return Sn(l);s=!1,i=An,u=new br}else u=e?[]:c;t:for(;++r=r?t:Bi(t,e,n)}var Gi=jn||function(t){return Ie.clearTimeout(t)};function Ki(t,e){if(e)return t.slice();var n=t.length,r=$e?$e(n):new t.constructor(n);return t.copy(r),r}function Ji(t){var e=new t.constructor(t.byteLength);return new we(e).set(new we(t)),e}function Zi(t,e){var n=e?Ji(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function Xi(t,e){if(t!==e){var n=t!==o,r=null===t,i=t==t,a=js(t),s=e!==o,c=null===e,u=e==e,l=js(e);if(!c&&!l&&!a&&t>e||a&&s&&u&&!c&&!l||r&&s&&u||!n&&u||!i)return 1;if(!r&&!a&&!l&&t1?n[i-1]:o,s=i>2?n[2]:o;for(a=t.length>3&&"function"==typeof a?(i--,a):o,s&&Qo(n[0],n[1],s)&&(a=i<3?o:a,i=1),e=ee(e);++r-1?i[a?e[s]:s]:o}}function po(t){return Bo(function(e){var n=e.length,r=n,i=mr.prototype.thru;for(t&&e.reverse();r--;){var a=e[r];if("function"!=typeof a)throw new ie(c);if(i&&!s&&"wrapper"==No(a))var s=new mr([],!0)}for(r=s?r:n;++r1&&_.reverse(),d&&lc))return!1;var l=a.get(t);if(l&&a.get(e))return l==e;var f=-1,d=!0,p=n&m?new br:o;for(a.set(t,e),a.set(e,t);++f-1&&t%1==0&&t1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(Rt,"{\n/* [wrapped with "+e+"] */\n")}(r,function(t,e){return Qe(F,function(n){var r="_."+n[0];e&n[1]&&!Je(t,r)&&t.push(r)}),t.sort()}(function(t){var e=t.match(Lt);return e?e[1].split(Mt):[]}(r),n)))}function sa(t){var e=0,n=0;return function(){var r=Qn(),i=B-(r-n);if(n=r,i>0){if(++e>=S)return arguments[0]}else e=0;return t.apply(o,arguments)}}function ca(t,e){var n=-1,r=t.length,i=r-1;for(e=e===o?r:e;++n1?t[e-1]:o;return n="function"==typeof n?(t.pop(),n):o,Oa(t,n)});function Ma(t){var e=pr(t);return e.__chain__=!0,e}function Fa(t,e){return e(t)}var Ua=Bo(function(t){var e=t.length,n=e?t[0]:0,r=this.__wrapped__,i=function(e){return Ir(e,t)};return!(e>1||this.__actions__.length)&&r instanceof gr&&Vo(n)?((r=r.slice(n,+n+(e?1:0))).__actions__.push({func:Fa,args:[i],thisArg:o}),new mr(r,this.__chain__).thru(function(t){return e&&!t.length&&t.push(o),t})):this.thru(i)});var Ha=io(function(t,e,n){le.call(t,n)?++t[n]:Or(t,n,1)});var za=fo(ma),qa=fo(ga);function Wa(t,e){return(gs(t)?Qe:Mr)(t,Po(e,3))}function Va(t,e){return(gs(t)?Ye:Fr)(t,Po(e,3))}var Qa=io(function(t,e,n){le.call(t,n)?t[n].push(e):Or(t,n,[e])});var Ya=xi(function(t,e,n){var i=-1,o="function"==typeof e,a=As(t)?r(t.length):[];return Mr(t,function(t){a[++i]=o?We(e,t,n):ri(t,e,n)}),a}),Ga=io(function(t,e,n){Or(t,n,e)});function Ka(t,e){return(gs(t)?Xe:di)(t,Po(e,3))}var Ja=io(function(t,e,n){t[n?0:1].push(e)},function(){return[[],[]]});var Za=xi(function(t,e){if(null==t)return[];var n=e.length;return n>1&&Qo(t,e[0],e[1])?e=[]:n>2&&Qo(e[0],e[1],e[2])&&(e=[e[0]]),gi(t,qr(e,1),[])}),Xa=Pn||function(){return Ie.Date.now()};function ts(t,e,n){return e=n?o:e,e=t&&null==e?t.length:e,To(t,C,o,o,o,o,e)}function es(t,e){var n;if("function"!=typeof e)throw new ie(c);return t=Us(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=o),n}}var ns=xi(function(t,e,n){var r=g;if(n.length){var i=$n(n,jo(ns));r|=w}return To(t,r,e,n,i)}),rs=xi(function(t,e,n){var r=g|y;if(n.length){var i=$n(n,jo(rs));r|=w}return To(e,r,t,n,i)});function is(t,e,n){var r,i,a,s,u,l,f=0,d=!1,p=!1,h=!0;if("function"!=typeof t)throw new ie(c);function v(e){var n=r,a=i;return r=i=o,f=e,s=t.apply(a,n)}function m(t){var n=t-l;return l===o||n>=e||n<0||p&&t-f>=a}function g(){var t=Xa();if(m(t))return y(t);u=ia(g,function(t){var n=e-(t-l);return p?Vn(n,a-(t-f)):n}(t))}function y(t){return u=o,h&&r?v(t):(r=i=o,s)}function A(){var t=Xa(),n=m(t);if(r=arguments,i=this,l=t,n){if(u===o)return function(t){return f=t,u=ia(g,e),d?v(t):s}(l);if(p)return Gi(u),u=ia(g,e),v(l)}return u===o&&(u=ia(g,e)),s}return e=zs(e)||0,Es(n)&&(d=!!n.leading,a=(p="maxWait"in n)?Wn(zs(n.maxWait)||0,e):a,h="trailing"in n?!!n.trailing:h),A.cancel=function(){u!==o&&Gi(u),f=0,r=l=i=u=o},A.flush=function(){return u===o?s:y(Xa())},A}var os=xi(function(t,e){return Rr(t,1,e)}),as=xi(function(t,e,n){return Rr(t,zs(e)||0,n)});function ss(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new ie(c);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=t.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(ss.Cache||_r),n}function cs(t){if("function"!=typeof t)throw new ie(c);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}ss.Cache=_r;var us=Qi(function(t,e){var n=(e=1==e.length&&gs(e[0])?Xe(e[0],gn(Po())):Xe(qr(e,1),gn(Po()))).length;return xi(function(r){for(var i=-1,o=Vn(r.length,n);++i=e}),ms=ii(function(){return arguments}())?ii:function(t){return $s(t)&&le.call(t,"callee")&&!Ne.call(t,"callee")},gs=r.isArray,ys=Me?gn(Me):function(t){return $s(t)&&Zr(t)==ct};function As(t){return null!=t&&ks(t.length)&&!Cs(t)}function _s(t){return $s(t)&&As(t)}var bs=Un||zc,ws=Fe?gn(Fe):function(t){return $s(t)&&Zr(t)==W};function xs(t){if(!$s(t))return!1;var e=Zr(t);return e==Q||e==V||"string"==typeof t.message&&"string"==typeof t.name&&!Ds(t)}function Cs(t){if(!Es(t))return!1;var e=Zr(t);return e==Y||e==G||e==z||e==tt}function Ts(t){return"number"==typeof t&&t==Us(t)}function ks(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=N}function Es(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function $s(t){return null!=t&&"object"==typeof t}var Ss=Ue?gn(Ue):function(t){return $s(t)&&Ho(t)==K};function Bs(t){return"number"==typeof t||$s(t)&&Zr(t)==J}function Ds(t){if(!$s(t)||Zr(t)!=X)return!1;var e=De(t);if(null===e)return!0;var n=le.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&ue.call(n)==he}var Os=He?gn(He):function(t){return $s(t)&&Zr(t)==et};var Is=ze?gn(ze):function(t){return $s(t)&&Ho(t)==nt};function Ns(t){return"string"==typeof t||!gs(t)&&$s(t)&&Zr(t)==rt}function js(t){return"symbol"==typeof t||$s(t)&&Zr(t)==it}var Ps=qe?gn(qe):function(t){return $s(t)&&ks(t.length)&&!!ke[Zr(t)]};var Rs=_o(fi),Ls=_o(function(t,e){return t<=e});function Ms(t){if(!t)return[];if(As(t))return Ns(t)?On(t):no(t);if(Le&&t[Le])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[Le]());var e=Ho(t);return(e==K?kn:e==nt?Sn:pc)(t)}function Fs(t){return t?(t=zs(t))===I||t===-I?(t<0?-1:1)*j:t==t?t:0:0===t?t:0}function Us(t){var e=Fs(t),n=e%1;return e==e?n?e-n:e:0}function Hs(t){return t?Nr(Us(t),0,R):0}function zs(t){if("number"==typeof t)return t;if(js(t))return P;if(Es(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Es(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(Nt,"");var n=Wt.test(t);return n||Qt.test(t)?Be(t.slice(2),n?2:8):qt.test(t)?P:+t}function qs(t){return ro(t,oc(t))}function Ws(t){return null==t?"":Pi(t)}var Vs=oo(function(t,e){if(Jo(e)||As(e))ro(e,ic(e),t);else for(var n in e)le.call(e,n)&&$r(t,n,e[n])}),Qs=oo(function(t,e){ro(e,oc(e),t)}),Ys=oo(function(t,e,n,r){ro(e,oc(e),t,r)}),Gs=oo(function(t,e,n,r){ro(e,ic(e),t,r)}),Ks=Bo(Ir);var Js=xi(function(t,e){t=ee(t);var n=-1,r=e.length,i=r>2?e[2]:o;for(i&&Qo(e[0],e[1],i)&&(r=1);++n1),e}),ro(t,Oo(t),n),r&&(n=jr(n,d|p|h,$o));for(var i=e.length;i--;)Li(n,e[i]);return n});var uc=Bo(function(t,e){return null==t?{}:function(t,e){return yi(t,e,function(e,n){return tc(t,n)})}(t,e)});function lc(t,e){if(null==t)return{};var n=Xe(Oo(t),function(t){return[t]});return e=Po(e),yi(t,n,function(t,n){return e(t,n[0])})}var fc=Co(ic),dc=Co(oc);function pc(t){return null==t?[]:yn(t,ic(t))}var hc=uo(function(t,e,n){return e=e.toLowerCase(),t+(n?vc(e):e)});function vc(t){return xc(Ws(t).toLowerCase())}function mc(t){return(t=Ws(t))&&t.replace(Gt,wn).replace(Ae,"")}var gc=uo(function(t,e,n){return t+(n?"-":"")+e.toLowerCase()}),yc=uo(function(t,e,n){return t+(n?" ":"")+e.toLowerCase()}),Ac=co("toLowerCase");var _c=uo(function(t,e,n){return t+(n?"_":"")+e.toLowerCase()});var bc=uo(function(t,e,n){return t+(n?" ":"")+xc(e)});var wc=uo(function(t,e,n){return t+(n?" ":"")+e.toUpperCase()}),xc=co("toUpperCase");function Cc(t,e,n){return t=Ws(t),(e=n?o:e)===o?function(t){return xe.test(t)}(t)?function(t){return t.match(be)||[]}(t):function(t){return t.match(Ft)||[]}(t):t.match(e)||[]}var Tc=xi(function(t,e){try{return We(t,o,e)}catch(t){return xs(t)?t:new Zt(t)}}),kc=Bo(function(t,e){return Qe(e,function(e){e=la(e),Or(t,e,ns(t[e],t))}),t});function Ec(t){return function(){return t}}var $c=po(),Sc=po(!0);function Bc(t){return t}function Dc(t){return ci("function"==typeof t?t:jr(t,d))}var Oc=xi(function(t,e){return function(n){return ri(n,t,e)}}),Ic=xi(function(t,e){return function(n){return ri(t,n,e)}});function Nc(t,e,n){var r=ic(e),i=Gr(e,r);null!=n||Es(e)&&(i.length||!r.length)||(n=e,e=t,t=this,i=Gr(e,ic(e)));var o=!(Es(n)&&"chain"in n&&!n.chain),a=Cs(t);return Qe(i,function(n){var r=e[n];t[n]=r,a&&(t.prototype[n]=function(){var e=this.__chain__;if(o||e){var n=t(this.__wrapped__),i=n.__actions__=no(this.__actions__);return i.push({func:r,args:arguments,thisArg:t}),n.__chain__=e,n}return r.apply(t,tn([this.value()],arguments))})}),t}function jc(){}var Pc=go(Xe),Rc=go(Ge),Lc=go(rn);function Mc(t){return Yo(t)?dn(la(t)):function(t){return function(e){return Kr(e,t)}}(t)}var Fc=Ao(),Uc=Ao(!0);function Hc(){return[]}function zc(){return!1}var qc=mo(function(t,e){return t+e},0),Wc=wo("ceil"),Vc=mo(function(t,e){return t/e},1),Qc=wo("floor");var Yc,Gc=mo(function(t,e){return t*e},1),Kc=wo("round"),Jc=mo(function(t,e){return t-e},0);return pr.after=function(t,e){if("function"!=typeof e)throw new ie(c);return t=Us(t),function(){if(--t<1)return e.apply(this,arguments)}},pr.ary=ts,pr.assign=Vs,pr.assignIn=Qs,pr.assignInWith=Ys,pr.assignWith=Gs,pr.at=Ks,pr.before=es,pr.bind=ns,pr.bindAll=kc,pr.bindKey=rs,pr.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return gs(t)?t:[t]},pr.chain=Ma,pr.chunk=function(t,e,n){e=(n?Qo(t,e,n):e===o)?1:Wn(Us(e),0);var i=null==t?0:t.length;if(!i||e<1)return[];for(var a=0,s=0,c=r(Ln(i/e));ai?0:i+n),(r=r===o||r>i?i:Us(r))<0&&(r+=i),r=n>r?0:Hs(r);n>>0)?(t=Ws(t))&&("string"==typeof e||null!=e&&!Os(e))&&!(e=Pi(e))&&Tn(t)?Yi(On(t),0,n):t.split(e,n):[]},pr.spread=function(t,e){if("function"!=typeof t)throw new ie(c);return e=null==e?0:Wn(Us(e),0),xi(function(n){var r=n[e],i=Yi(n,0,e);return r&&tn(i,r),We(t,this,i)})},pr.tail=function(t){var e=null==t?0:t.length;return e?Bi(t,1,e):[]},pr.take=function(t,e,n){return t&&t.length?Bi(t,0,(e=n||e===o?1:Us(e))<0?0:e):[]},pr.takeRight=function(t,e,n){var r=null==t?0:t.length;return r?Bi(t,(e=r-(e=n||e===o?1:Us(e)))<0?0:e,r):[]},pr.takeRightWhile=function(t,e){return t&&t.length?Fi(t,Po(e,3),!1,!0):[]},pr.takeWhile=function(t,e){return t&&t.length?Fi(t,Po(e,3)):[]},pr.tap=function(t,e){return e(t),t},pr.throttle=function(t,e,n){var r=!0,i=!0;if("function"!=typeof t)throw new ie(c);return Es(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),is(t,e,{leading:r,maxWait:e,trailing:i})},pr.thru=Fa,pr.toArray=Ms,pr.toPairs=fc,pr.toPairsIn=dc,pr.toPath=function(t){return gs(t)?Xe(t,la):js(t)?[t]:no(ua(Ws(t)))},pr.toPlainObject=qs,pr.transform=function(t,e,n){var r=gs(t),i=r||bs(t)||Ps(t);if(e=Po(e,4),null==n){var o=t&&t.constructor;n=i?r?new o:[]:Es(t)&&Cs(o)?hr(De(t)):{}}return(i?Qe:Qr)(t,function(t,r,i){return e(n,t,r,i)}),n},pr.unary=function(t){return ts(t,1)},pr.union=$a,pr.unionBy=Sa,pr.unionWith=Ba,pr.uniq=function(t){return t&&t.length?Ri(t):[]},pr.uniqBy=function(t,e){return t&&t.length?Ri(t,Po(e,2)):[]},pr.uniqWith=function(t,e){return e="function"==typeof e?e:o,t&&t.length?Ri(t,o,e):[]},pr.unset=function(t,e){return null==t||Li(t,e)},pr.unzip=Da,pr.unzipWith=Oa,pr.update=function(t,e,n){return null==t?t:Mi(t,e,Wi(n))},pr.updateWith=function(t,e,n,r){return r="function"==typeof r?r:o,null==t?t:Mi(t,e,Wi(n),r)},pr.values=pc,pr.valuesIn=function(t){return null==t?[]:yn(t,oc(t))},pr.without=Ia,pr.words=Cc,pr.wrap=function(t,e){return ls(Wi(e),t)},pr.xor=Na,pr.xorBy=ja,pr.xorWith=Pa,pr.zip=Ra,pr.zipObject=function(t,e){return zi(t||[],e||[],$r)},pr.zipObjectDeep=function(t,e){return zi(t||[],e||[],ki)},pr.zipWith=La,pr.entries=fc,pr.entriesIn=dc,pr.extend=Qs,pr.extendWith=Ys,Nc(pr,pr),pr.add=qc,pr.attempt=Tc,pr.camelCase=hc,pr.capitalize=vc,pr.ceil=Wc,pr.clamp=function(t,e,n){return n===o&&(n=e,e=o),n!==o&&(n=(n=zs(n))==n?n:0),e!==o&&(e=(e=zs(e))==e?e:0),Nr(zs(t),e,n)},pr.clone=function(t){return jr(t,h)},pr.cloneDeep=function(t){return jr(t,d|h)},pr.cloneDeepWith=function(t,e){return jr(t,d|h,e="function"==typeof e?e:o)},pr.cloneWith=function(t,e){return jr(t,h,e="function"==typeof e?e:o)},pr.conformsTo=function(t,e){return null==e||Pr(t,e,ic(e))},pr.deburr=mc,pr.defaultTo=function(t,e){return null==t||t!=t?e:t},pr.divide=Vc,pr.endsWith=function(t,e,n){t=Ws(t),e=Pi(e);var r=t.length,i=n=n===o?r:Nr(Us(n),0,r);return(n-=e.length)>=0&&t.slice(n,i)==e},pr.eq=ps,pr.escape=function(t){return(t=Ws(t))&&Tt.test(t)?t.replace(xt,xn):t},pr.escapeRegExp=function(t){return(t=Ws(t))&&It.test(t)?t.replace(Ot,"\\$&"):t},pr.every=function(t,e,n){var r=gs(t)?Ge:Ur;return n&&Qo(t,e,n)&&(e=o),r(t,Po(e,3))},pr.find=za,pr.findIndex=ma,pr.findKey=function(t,e){return an(t,Po(e,3),Qr)},pr.findLast=qa,pr.findLastIndex=ga,pr.findLastKey=function(t,e){return an(t,Po(e,3),Yr)},pr.floor=Qc,pr.forEach=Wa,pr.forEachRight=Va,pr.forIn=function(t,e){return null==t?t:Wr(t,Po(e,3),oc)},pr.forInRight=function(t,e){return null==t?t:Vr(t,Po(e,3),oc)},pr.forOwn=function(t,e){return t&&Qr(t,Po(e,3))},pr.forOwnRight=function(t,e){return t&&Yr(t,Po(e,3))},pr.get=Xs,pr.gt=hs,pr.gte=vs,pr.has=function(t,e){return null!=t&&zo(t,e,ti)},pr.hasIn=tc,pr.head=Aa,pr.identity=Bc,pr.includes=function(t,e,n,r){t=As(t)?t:pc(t),n=n&&!r?Us(n):0;var i=t.length;return n<0&&(n=Wn(i+n,0)),Ns(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&cn(t,e,n)>-1},pr.indexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:Us(n);return i<0&&(i=Wn(r+i,0)),cn(t,e,i)},pr.inRange=function(t,e,n){return e=Fs(e),n===o?(n=e,e=0):n=Fs(n),function(t,e,n){return t>=Vn(e,n)&&t=-N&&t<=N},pr.isSet=Is,pr.isString=Ns,pr.isSymbol=js,pr.isTypedArray=Ps,pr.isUndefined=function(t){return t===o},pr.isWeakMap=function(t){return $s(t)&&Ho(t)==at},pr.isWeakSet=function(t){return $s(t)&&Zr(t)==st},pr.join=function(t,e){return null==t?"":zn.call(t,e)},pr.kebabCase=gc,pr.last=xa,pr.lastIndexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=r;return n!==o&&(i=(i=Us(n))<0?Wn(r+i,0):Vn(i,r-1)),e==e?function(t,e,n){for(var r=n+1;r--;)if(t[r]===e)return r;return r}(t,e,i):sn(t,ln,i,!0)},pr.lowerCase=yc,pr.lowerFirst=Ac,pr.lt=Rs,pr.lte=Ls,pr.max=function(t){return t&&t.length?Hr(t,Bc,Xr):o},pr.maxBy=function(t,e){return t&&t.length?Hr(t,Po(e,2),Xr):o},pr.mean=function(t){return fn(t,Bc)},pr.meanBy=function(t,e){return fn(t,Po(e,2))},pr.min=function(t){return t&&t.length?Hr(t,Bc,fi):o},pr.minBy=function(t,e){return t&&t.length?Hr(t,Po(e,2),fi):o},pr.stubArray=Hc,pr.stubFalse=zc,pr.stubObject=function(){return{}},pr.stubString=function(){return""},pr.stubTrue=function(){return!0},pr.multiply=Gc,pr.nth=function(t,e){return t&&t.length?mi(t,Us(e)):o},pr.noConflict=function(){return Ie._===this&&(Ie._=ve),this},pr.noop=jc,pr.now=Xa,pr.pad=function(t,e,n){t=Ws(t);var r=(e=Us(e))?Dn(t):0;if(!e||r>=e)return t;var i=(e-r)/2;return yo(Mn(i),n)+t+yo(Ln(i),n)},pr.padEnd=function(t,e,n){t=Ws(t);var r=(e=Us(e))?Dn(t):0;return e&&re){var r=t;t=e,e=r}if(n||t%1||e%1){var i=Gn();return Vn(t+i*(e-t+Se("1e-"+((i+"").length-1))),e)}return bi(t,e)},pr.reduce=function(t,e,n){var r=gs(t)?en:hn,i=arguments.length<3;return r(t,Po(e,4),n,i,Mr)},pr.reduceRight=function(t,e,n){var r=gs(t)?nn:hn,i=arguments.length<3;return r(t,Po(e,4),n,i,Fr)},pr.repeat=function(t,e,n){return e=(n?Qo(t,e,n):e===o)?1:Us(e),wi(Ws(t),e)},pr.replace=function(){var t=arguments,e=Ws(t[0]);return t.length<3?e:e.replace(t[1],t[2])},pr.result=function(t,e,n){var r=-1,i=(e=Vi(e,t)).length;for(i||(i=1,t=o);++rN)return[];var n=R,r=Vn(t,R);e=Po(e),t-=R;for(var i=mn(r,e);++n=a)return t;var c=n-Dn(r);if(c<1)return r;var u=s?Yi(s,0,c).join(""):t.slice(0,c);if(i===o)return u+r;if(s&&(c+=u.length-c),Os(i)){if(t.slice(c).search(i)){var l,f=u;for(i.global||(i=ne(i.source,Ws(zt.exec(i))+"g")),i.lastIndex=0;l=i.exec(f);)var d=l.index;u=u.slice(0,d===o?c:d)}}else if(t.indexOf(Pi(i),c)!=c){var p=u.lastIndexOf(i);p>-1&&(u=u.slice(0,p))}return u+r},pr.unescape=function(t){return(t=Ws(t))&&Ct.test(t)?t.replace(wt,In):t},pr.uniqueId=function(t){var e=++fe;return Ws(t)+e},pr.upperCase=wc,pr.upperFirst=xc,pr.each=Wa,pr.eachRight=Va,pr.first=Aa,Nc(pr,(Yc={},Qr(pr,function(t,e){le.call(pr.prototype,e)||(Yc[e]=t)}),Yc),{chain:!1}),pr.VERSION="4.17.15",Qe(["bind","bindKey","curry","curryRight","partial","partialRight"],function(t){pr[t].placeholder=pr}),Qe(["drop","take"],function(t,e){gr.prototype[t]=function(n){n=n===o?1:Wn(Us(n),0);var r=this.__filtered__&&!e?new gr(this):this.clone();return r.__filtered__?r.__takeCount__=Vn(n,r.__takeCount__):r.__views__.push({size:Vn(n,R),type:t+(r.__dir__<0?"Right":"")}),r},gr.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}}),Qe(["filter","map","takeWhile"],function(t,e){var n=e+1,r=n==D||3==n;gr.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:Po(t,3),type:n}),e.__filtered__=e.__filtered__||r,e}}),Qe(["head","last"],function(t,e){var n="take"+(e?"Right":"");gr.prototype[t]=function(){return this[n](1).value()[0]}}),Qe(["initial","tail"],function(t,e){var n="drop"+(e?"":"Right");gr.prototype[t]=function(){return this.__filtered__?new gr(this):this[n](1)}}),gr.prototype.compact=function(){return this.filter(Bc)},gr.prototype.find=function(t){return this.filter(t).head()},gr.prototype.findLast=function(t){return this.reverse().find(t)},gr.prototype.invokeMap=xi(function(t,e){return"function"==typeof t?new gr(this):this.map(function(n){return ri(n,t,e)})}),gr.prototype.reject=function(t){return this.filter(cs(Po(t)))},gr.prototype.slice=function(t,e){t=Us(t);var n=this;return n.__filtered__&&(t>0||e<0)?new gr(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),e!==o&&(n=(e=Us(e))<0?n.dropRight(-e):n.take(e-t)),n)},gr.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},gr.prototype.toArray=function(){return this.take(R)},Qr(gr.prototype,function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),i=pr[r?"take"+("last"==e?"Right":""):e],a=r||/^find/.test(e);i&&(pr.prototype[e]=function(){var e=this.__wrapped__,s=r?[1]:arguments,c=e instanceof gr,u=s[0],l=c||gs(e),f=function(t){var e=i.apply(pr,tn([t],s));return r&&d?e[0]:e};l&&n&&"function"==typeof u&&1!=u.length&&(c=l=!1);var d=this.__chain__,p=!!this.__actions__.length,h=a&&!d,v=c&&!p;if(!a&&l){e=v?e:new gr(this);var m=t.apply(e,s);return m.__actions__.push({func:Fa,args:[f],thisArg:o}),new mr(m,d)}return h&&v?t.apply(this,s):(m=this.thru(f),h?r?m.value()[0]:m.value():m)})}),Qe(["pop","push","shift","sort","splice","unshift"],function(t){var e=oe[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);pr.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var i=this.value();return e.apply(gs(i)?i:[],t)}return this[n](function(n){return e.apply(gs(n)?n:[],t)})}}),Qr(gr.prototype,function(t,e){var n=pr[e];if(n){var r=n.name+"";le.call(ir,r)||(ir[r]=[]),ir[r].push({name:e,func:n})}}),ir[ho(o,y).name]=[{name:"wrapper",func:o}],gr.prototype.clone=function(){var t=new gr(this.__wrapped__);return t.__actions__=no(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=no(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=no(this.__views__),t},gr.prototype.reverse=function(){if(this.__filtered__){var t=new gr(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},gr.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=gs(t),r=e<0,i=n?t.length:0,o=function(t,e,n){var r=-1,i=n.length;for(;++r=this.__values__.length;return{done:t,value:t?o:this.__values__[this.__index__++]}},pr.prototype.plant=function(t){for(var e,n=this;n instanceof vr;){var r=da(n);r.__index__=0,r.__values__=o,e?i.__wrapped__=r:e=r;var i=r;n=n.__wrapped__}return i.__wrapped__=t,e},pr.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof gr){var e=t;return this.__actions__.length&&(e=new gr(this)),(e=e.reverse()).__actions__.push({func:Fa,args:[Ea],thisArg:o}),new mr(e,this.__chain__)}return this.thru(Ea)},pr.prototype.toJSON=pr.prototype.valueOf=pr.prototype.value=function(){return Ui(this.__wrapped__,this.__actions__)},pr.prototype.first=pr.prototype.head,Le&&(pr.prototype[Le]=function(){return this}),pr}();Ie._=Nn,(i=function(){return Nn}.call(e,n,e,r))===o||(r.exports=i)}).call(this)}).call(this,n(2),n(20)(t))},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,n){var r;!function(e,n){"use strict";"object"==typeof t.exports?t.exports=e.document?n(e,!0):function(t){if(!t.document)throw new Error("jQuery requires a window with a document");return n(t)}:n(e)}("undefined"!=typeof window?window:this,function(n,i){"use strict";var o=[],a=n.document,s=Object.getPrototypeOf,c=o.slice,u=o.concat,l=o.push,f=o.indexOf,d={},p=d.toString,h=d.hasOwnProperty,v=h.toString,m=v.call(Object),g={},y=function(t){return"function"==typeof t&&"number"!=typeof t.nodeType},A=function(t){return null!=t&&t===t.window},_={type:!0,src:!0,nonce:!0,noModule:!0};function b(t,e,n){var r,i,o=(n=n||a).createElement("script");if(o.text=t,e)for(r in _)(i=e[r]||e.getAttribute&&e.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(t){return null==t?t+"":"object"==typeof t||"function"==typeof t?d[p.call(t)]||"object":typeof t}var x=function(t,e){return new x.fn.init(t,e)},C=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;function T(t){var e=!!t&&"length"in t&&t.length,n=w(t);return!y(t)&&!A(t)&&("array"===n||0===e||"number"==typeof e&&e>0&&e-1 in t)}x.fn=x.prototype={jquery:"3.4.1",constructor:x,length:0,toArray:function(){return c.call(this)},get:function(t){return null==t?c.call(this):t<0?this[t+this.length]:this[t]},pushStack:function(t){var e=x.merge(this.constructor(),t);return e.prevObject=this,e},each:function(t){return x.each(this,t)},map:function(t){return this.pushStack(x.map(this,function(e,n){return t.call(e,n,e)}))},slice:function(){return this.pushStack(c.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(t){var e=this.length,n=+t+(t<0?e:0);return this.pushStack(n>=0&&n+~]|"+R+")"+R+"*"),W=new RegExp(R+"|>"),V=new RegExp(F),Q=new RegExp("^"+L+"$"),Y={ID:new RegExp("^#("+L+")"),CLASS:new RegExp("^\\.("+L+")"),TAG:new RegExp("^("+L+"|[*])"),ATTR:new RegExp("^"+M),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+R+"*(even|odd|(([+-]|)(\\d*)n|)"+R+"*(?:([+-]|)"+R+"*(\\d+)|))"+R+"*\\)|)","i"),bool:new RegExp("^(?:"+P+")$","i"),needsContext:new RegExp("^"+R+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+R+"*((?:-\\d)?\\d*)"+R+"*\\)|)(?=[^-]|$)","i")},G=/HTML$/i,K=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,Z=/^[^{]+\{\s*\[native \w/,X=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,tt=/[+~]/,et=new RegExp("\\\\([\\da-f]{1,6}"+R+"?|("+R+")|.)","ig"),nt=function(t,e,n){var r="0x"+e-65536;return r!=r||n?e:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},rt=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,it=function(t,e){return e?"\0"===t?"�":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t},ot=function(){d()},at=_t(function(t){return!0===t.disabled&&"fieldset"===t.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{I.apply(B=N.call(b.childNodes),b.childNodes),B[b.childNodes.length].nodeType}catch(t){I={apply:B.length?function(t,e){O.apply(t,N.call(e))}:function(t,e){for(var n=t.length,r=0;t[n++]=e[r++];);t.length=n-1}}}function st(t,e,r,i){var o,s,u,l,f,h,g,y=e&&e.ownerDocument,w=e?e.nodeType:9;if(r=r||[],"string"!=typeof t||!t||1!==w&&9!==w&&11!==w)return r;if(!i&&((e?e.ownerDocument||e:b)!==p&&d(e),e=e||p,v)){if(11!==w&&(f=X.exec(t)))if(o=f[1]){if(9===w){if(!(u=e.getElementById(o)))return r;if(u.id===o)return r.push(u),r}else if(y&&(u=y.getElementById(o))&&A(e,u)&&u.id===o)return r.push(u),r}else{if(f[2])return I.apply(r,e.getElementsByTagName(t)),r;if((o=f[3])&&n.getElementsByClassName&&e.getElementsByClassName)return I.apply(r,e.getElementsByClassName(o)),r}if(n.qsa&&!E[t+" "]&&(!m||!m.test(t))&&(1!==w||"object"!==e.nodeName.toLowerCase())){if(g=t,y=e,1===w&&W.test(t)){for((l=e.getAttribute("id"))?l=l.replace(rt,it):e.setAttribute("id",l=_),s=(h=a(t)).length;s--;)h[s]="#"+l+" "+At(h[s]);g=h.join(","),y=tt.test(t)&>(e.parentNode)||e}try{return I.apply(r,y.querySelectorAll(g)),r}catch(e){E(t,!0)}finally{l===_&&e.removeAttribute("id")}}}return c(t.replace(H,"$1"),e,r,i)}function ct(){var t=[];return function e(n,i){return t.push(n+" ")>r.cacheLength&&delete e[t.shift()],e[n+" "]=i}}function ut(t){return t[_]=!0,t}function lt(t){var e=p.createElement("fieldset");try{return!!t(e)}catch(t){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function ft(t,e){for(var n=t.split("|"),i=n.length;i--;)r.attrHandle[n[i]]=e}function dt(t,e){var n=e&&t,r=n&&1===t.nodeType&&1===e.nodeType&&t.sourceIndex-e.sourceIndex;if(r)return r;if(n)for(;n=n.nextSibling;)if(n===e)return-1;return t?1:-1}function pt(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function ht(t){return function(e){var n=e.nodeName.toLowerCase();return("input"===n||"button"===n)&&e.type===t}}function vt(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&at(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function mt(t){return ut(function(e){return e=+e,ut(function(n,r){for(var i,o=t([],n.length,e),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function gt(t){return t&&void 0!==t.getElementsByTagName&&t}for(e in n=st.support={},o=st.isXML=function(t){var e=t.namespaceURI,n=(t.ownerDocument||t).documentElement;return!G.test(e||n&&n.nodeName||"HTML")},d=st.setDocument=function(t){var e,i,a=t?t.ownerDocument||t:b;return a!==p&&9===a.nodeType&&a.documentElement?(h=(p=a).documentElement,v=!o(p),b!==p&&(i=p.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",ot,!1):i.attachEvent&&i.attachEvent("onunload",ot)),n.attributes=lt(function(t){return t.className="i",!t.getAttribute("className")}),n.getElementsByTagName=lt(function(t){return t.appendChild(p.createComment("")),!t.getElementsByTagName("*").length}),n.getElementsByClassName=Z.test(p.getElementsByClassName),n.getById=lt(function(t){return h.appendChild(t).id=_,!p.getElementsByName||!p.getElementsByName(_).length}),n.getById?(r.filter.ID=function(t){var e=t.replace(et,nt);return function(t){return t.getAttribute("id")===e}},r.find.ID=function(t,e){if(void 0!==e.getElementById&&v){var n=e.getElementById(t);return n?[n]:[]}}):(r.filter.ID=function(t){var e=t.replace(et,nt);return function(t){var n=void 0!==t.getAttributeNode&&t.getAttributeNode("id");return n&&n.value===e}},r.find.ID=function(t,e){if(void 0!==e.getElementById&&v){var n,r,i,o=e.getElementById(t);if(o){if((n=o.getAttributeNode("id"))&&n.value===t)return[o];for(i=e.getElementsByName(t),r=0;o=i[r++];)if((n=o.getAttributeNode("id"))&&n.value===t)return[o]}return[]}}),r.find.TAG=n.getElementsByTagName?function(t,e){return void 0!==e.getElementsByTagName?e.getElementsByTagName(t):n.qsa?e.querySelectorAll(t):void 0}:function(t,e){var n,r=[],i=0,o=e.getElementsByTagName(t);if("*"===t){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},r.find.CLASS=n.getElementsByClassName&&function(t,e){if(void 0!==e.getElementsByClassName&&v)return e.getElementsByClassName(t)},g=[],m=[],(n.qsa=Z.test(p.querySelectorAll))&&(lt(function(t){h.appendChild(t).innerHTML=" ",t.querySelectorAll("[msallowcapture^='']").length&&m.push("[*^$]="+R+"*(?:''|\"\")"),t.querySelectorAll("[selected]").length||m.push("\\["+R+"*(?:value|"+P+")"),t.querySelectorAll("[id~="+_+"-]").length||m.push("~="),t.querySelectorAll(":checked").length||m.push(":checked"),t.querySelectorAll("a#"+_+"+*").length||m.push(".#.+[+~]")}),lt(function(t){t.innerHTML=" ";var e=p.createElement("input");e.setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),t.querySelectorAll("[name=d]").length&&m.push("name"+R+"*[*^$|!~]?="),2!==t.querySelectorAll(":enabled").length&&m.push(":enabled",":disabled"),h.appendChild(t).disabled=!0,2!==t.querySelectorAll(":disabled").length&&m.push(":enabled",":disabled"),t.querySelectorAll("*,:x"),m.push(",.*:")})),(n.matchesSelector=Z.test(y=h.matches||h.webkitMatchesSelector||h.mozMatchesSelector||h.oMatchesSelector||h.msMatchesSelector))&<(function(t){n.disconnectedMatch=y.call(t,"*"),y.call(t,"[s!='']:x"),g.push("!=",F)}),m=m.length&&new RegExp(m.join("|")),g=g.length&&new RegExp(g.join("|")),e=Z.test(h.compareDocumentPosition),A=e||Z.test(h.contains)?function(t,e){var n=9===t.nodeType?t.documentElement:t,r=e&&e.parentNode;return t===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):t.compareDocumentPosition&&16&t.compareDocumentPosition(r)))}:function(t,e){if(e)for(;e=e.parentNode;)if(e===t)return!0;return!1},$=e?function(t,e){if(t===e)return f=!0,0;var r=!t.compareDocumentPosition-!e.compareDocumentPosition;return r||(1&(r=(t.ownerDocument||t)===(e.ownerDocument||e)?t.compareDocumentPosition(e):1)||!n.sortDetached&&e.compareDocumentPosition(t)===r?t===p||t.ownerDocument===b&&A(b,t)?-1:e===p||e.ownerDocument===b&&A(b,e)?1:l?j(l,t)-j(l,e):0:4&r?-1:1)}:function(t,e){if(t===e)return f=!0,0;var n,r=0,i=t.parentNode,o=e.parentNode,a=[t],s=[e];if(!i||!o)return t===p?-1:e===p?1:i?-1:o?1:l?j(l,t)-j(l,e):0;if(i===o)return dt(t,e);for(n=t;n=n.parentNode;)a.unshift(n);for(n=e;n=n.parentNode;)s.unshift(n);for(;a[r]===s[r];)r++;return r?dt(a[r],s[r]):a[r]===b?-1:s[r]===b?1:0},p):p},st.matches=function(t,e){return st(t,null,null,e)},st.matchesSelector=function(t,e){if((t.ownerDocument||t)!==p&&d(t),n.matchesSelector&&v&&!E[e+" "]&&(!g||!g.test(e))&&(!m||!m.test(e)))try{var r=y.call(t,e);if(r||n.disconnectedMatch||t.document&&11!==t.document.nodeType)return r}catch(t){E(e,!0)}return st(e,p,null,[t]).length>0},st.contains=function(t,e){return(t.ownerDocument||t)!==p&&d(t),A(t,e)},st.attr=function(t,e){(t.ownerDocument||t)!==p&&d(t);var i=r.attrHandle[e.toLowerCase()],o=i&&S.call(r.attrHandle,e.toLowerCase())?i(t,e,!v):void 0;return void 0!==o?o:n.attributes||!v?t.getAttribute(e):(o=t.getAttributeNode(e))&&o.specified?o.value:null},st.escape=function(t){return(t+"").replace(rt,it)},st.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},st.uniqueSort=function(t){var e,r=[],i=0,o=0;if(f=!n.detectDuplicates,l=!n.sortStable&&t.slice(0),t.sort($),f){for(;e=t[o++];)e===t[o]&&(i=r.push(o));for(;i--;)t.splice(r[i],1)}return l=null,t},i=st.getText=function(t){var e,n="",r=0,o=t.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)n+=i(t)}else if(3===o||4===o)return t.nodeValue}else for(;e=t[r++];)n+=i(e);return n},(r=st.selectors={cacheLength:50,createPseudo:ut,match:Y,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(et,nt),t[3]=(t[3]||t[4]||t[5]||"").replace(et,nt),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||st.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&st.error(t[0]),t},PSEUDO:function(t){var e,n=!t[6]&&t[2];return Y.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":n&&V.test(n)&&(e=a(n,!0))&&(e=n.indexOf(")",n.length-e)-n.length)&&(t[0]=t[0].slice(0,e),t[2]=n.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(et,nt).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=C[t+" "];return e||(e=new RegExp("(^|"+R+")"+t+"("+R+"|$)"))&&C(t,function(t){return e.test("string"==typeof t.className&&t.className||void 0!==t.getAttribute&&t.getAttribute("class")||"")})},ATTR:function(t,e,n){return function(r){var i=st.attr(r,t);return null==i?"!="===e:!e||(i+="","="===e?i===n:"!="===e?i!==n:"^="===e?n&&0===i.indexOf(n):"*="===e?n&&i.indexOf(n)>-1:"$="===e?n&&i.slice(-n.length)===n:"~="===e?(" "+i.replace(U," ")+" ").indexOf(n)>-1:"|="===e&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(t,e,n,r,i){var o="nth"!==t.slice(0,3),a="last"!==t.slice(-4),s="of-type"===e;return 1===r&&0===i?function(t){return!!t.parentNode}:function(e,n,c){var u,l,f,d,p,h,v=o!==a?"nextSibling":"previousSibling",m=e.parentNode,g=s&&e.nodeName.toLowerCase(),y=!c&&!s,A=!1;if(m){if(o){for(;v;){for(d=e;d=d[v];)if(s?d.nodeName.toLowerCase()===g:1===d.nodeType)return!1;h=v="only"===t&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&y){for(A=(p=(u=(l=(f=(d=m)[_]||(d[_]={}))[d.uniqueID]||(f[d.uniqueID]={}))[t]||[])[0]===w&&u[1])&&u[2],d=p&&m.childNodes[p];d=++p&&d&&d[v]||(A=p=0)||h.pop();)if(1===d.nodeType&&++A&&d===e){l[t]=[w,p,A];break}}else if(y&&(A=p=(u=(l=(f=(d=e)[_]||(d[_]={}))[d.uniqueID]||(f[d.uniqueID]={}))[t]||[])[0]===w&&u[1]),!1===A)for(;(d=++p&&d&&d[v]||(A=p=0)||h.pop())&&((s?d.nodeName.toLowerCase()!==g:1!==d.nodeType)||!++A||(y&&((l=(f=d[_]||(d[_]={}))[d.uniqueID]||(f[d.uniqueID]={}))[t]=[w,A]),d!==e)););return(A-=i)===r||A%r==0&&A/r>=0}}},PSEUDO:function(t,e){var n,i=r.pseudos[t]||r.setFilters[t.toLowerCase()]||st.error("unsupported pseudo: "+t);return i[_]?i(e):i.length>1?(n=[t,t,"",e],r.setFilters.hasOwnProperty(t.toLowerCase())?ut(function(t,n){for(var r,o=i(t,e),a=o.length;a--;)t[r=j(t,o[a])]=!(n[r]=o[a])}):function(t){return i(t,0,n)}):i}},pseudos:{not:ut(function(t){var e=[],n=[],r=s(t.replace(H,"$1"));return r[_]?ut(function(t,e,n,i){for(var o,a=r(t,null,i,[]),s=t.length;s--;)(o=a[s])&&(t[s]=!(e[s]=o))}):function(t,i,o){return e[0]=t,r(e,null,o,n),e[0]=null,!n.pop()}}),has:ut(function(t){return function(e){return st(t,e).length>0}}),contains:ut(function(t){return t=t.replace(et,nt),function(e){return(e.textContent||i(e)).indexOf(t)>-1}}),lang:ut(function(t){return Q.test(t||"")||st.error("unsupported lang: "+t),t=t.replace(et,nt).toLowerCase(),function(e){var n;do{if(n=v?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(n=n.toLowerCase())===t||0===n.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var n=t.location&&t.location.hash;return n&&n.slice(1)===e.id},root:function(t){return t===h},focus:function(t){return t===p.activeElement&&(!p.hasFocus||p.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:vt(!1),disabled:vt(!0),checked:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&!!t.checked||"option"===e&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!r.pseudos.empty(t)},header:function(t){return J.test(t.nodeName)},input:function(t){return K.test(t.nodeName)},button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},text:function(t){var e;return"input"===t.nodeName.toLowerCase()&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:mt(function(){return[0]}),last:mt(function(t,e){return[e-1]}),eq:mt(function(t,e,n){return[n<0?n+e:n]}),even:mt(function(t,e){for(var n=0;ne?e:n;--r>=0;)t.push(r);return t}),gt:mt(function(t,e,n){for(var r=n<0?n+e:n;++r1?function(e,n,r){for(var i=t.length;i--;)if(!t[i](e,n,r))return!1;return!0}:t[0]}function wt(t,e,n,r,i){for(var o,a=[],s=0,c=t.length,u=null!=e;s-1&&(o[u]=!(a[u]=f))}}else g=wt(g===a?g.splice(h,g.length):g),i?i(null,a,g,c):I.apply(a,g)})}function Ct(t){for(var e,n,i,o=t.length,a=r.relative[t[0].type],s=a||r.relative[" "],c=a?1:0,l=_t(function(t){return t===e},s,!0),f=_t(function(t){return j(e,t)>-1},s,!0),d=[function(t,n,r){var i=!a&&(r||n!==u)||((e=n).nodeType?l(t,n,r):f(t,n,r));return e=null,i}];c1&&bt(d),c>1&&At(t.slice(0,c-1).concat({value:" "===t[c-2].type?"*":""})).replace(H,"$1"),n,c0,i=t.length>0,o=function(o,a,s,c,l){var f,h,m,g=0,y="0",A=o&&[],_=[],b=u,x=o||i&&r.find.TAG("*",l),C=w+=null==b?1:Math.random()||.1,T=x.length;for(l&&(u=a===p||a||l);y!==T&&null!=(f=x[y]);y++){if(i&&f){for(h=0,a||f.ownerDocument===p||(d(f),s=!v);m=t[h++];)if(m(f,a||p,s)){c.push(f);break}l&&(w=C)}n&&((f=!m&&f)&&g--,o&&A.push(f))}if(g+=y,n&&y!==g){for(h=0;m=e[h++];)m(A,_,a,s);if(o){if(g>0)for(;y--;)A[y]||_[y]||(_[y]=D.call(c));_=wt(_)}I.apply(c,_),l&&!o&&_.length>0&&g+e.length>1&&st.uniqueSort(c)}return l&&(w=C,u=b),A};return n?ut(o):o}(o,i))).selector=t}return s},c=st.select=function(t,e,n,i){var o,c,u,l,f,d="function"==typeof t&&t,p=!i&&a(t=d.selector||t);if(n=n||[],1===p.length){if((c=p[0]=p[0].slice(0)).length>2&&"ID"===(u=c[0]).type&&9===e.nodeType&&v&&r.relative[c[1].type]){if(!(e=(r.find.ID(u.matches[0].replace(et,nt),e)||[])[0]))return n;d&&(e=e.parentNode),t=t.slice(c.shift().value.length)}for(o=Y.needsContext.test(t)?0:c.length;o--&&(u=c[o],!r.relative[l=u.type]);)if((f=r.find[l])&&(i=f(u.matches[0].replace(et,nt),tt.test(c[0].type)&>(e.parentNode)||e))){if(c.splice(o,1),!(t=i.length&&At(c)))return I.apply(n,i),n;break}}return(d||s(t,p))(i,e,!v,n,!e||tt.test(t)&>(e.parentNode)||e),n},n.sortStable=_.split("").sort($).join("")===_,n.detectDuplicates=!!f,d(),n.sortDetached=lt(function(t){return 1&t.compareDocumentPosition(p.createElement("fieldset"))}),lt(function(t){return t.innerHTML=" ","#"===t.firstChild.getAttribute("href")})||ft("type|href|height|width",function(t,e,n){if(!n)return t.getAttribute(e,"type"===e.toLowerCase()?1:2)}),n.attributes&<(function(t){return t.innerHTML=" ",t.firstChild.setAttribute("value",""),""===t.firstChild.getAttribute("value")})||ft("value",function(t,e,n){if(!n&&"input"===t.nodeName.toLowerCase())return t.defaultValue}),lt(function(t){return null==t.getAttribute("disabled")})||ft(P,function(t,e,n){var r;if(!n)return!0===t[e]?e.toLowerCase():(r=t.getAttributeNode(e))&&r.specified?r.value:null}),st}(n);x.find=k,x.expr=k.selectors,x.expr[":"]=x.expr.pseudos,x.uniqueSort=x.unique=k.uniqueSort,x.text=k.getText,x.isXMLDoc=k.isXML,x.contains=k.contains,x.escapeSelector=k.escape;var E=function(t,e,n){for(var r=[],i=void 0!==n;(t=t[e])&&9!==t.nodeType;)if(1===t.nodeType){if(i&&x(t).is(n))break;r.push(t)}return r},$=function(t,e){for(var n=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&n.push(t);return n},S=x.expr.match.needsContext;function B(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()}var D=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function O(t,e,n){return y(e)?x.grep(t,function(t,r){return!!e.call(t,r,t)!==n}):e.nodeType?x.grep(t,function(t){return t===e!==n}):"string"!=typeof e?x.grep(t,function(t){return f.call(e,t)>-1!==n}):x.filter(e,t,n)}x.filter=function(t,e,n){var r=e[0];return n&&(t=":not("+t+")"),1===e.length&&1===r.nodeType?x.find.matchesSelector(r,t)?[r]:[]:x.find.matches(t,x.grep(e,function(t){return 1===t.nodeType}))},x.fn.extend({find:function(t){var e,n,r=this.length,i=this;if("string"!=typeof t)return this.pushStack(x(t).filter(function(){for(e=0;e1?x.uniqueSort(n):n},filter:function(t){return this.pushStack(O(this,t||[],!1))},not:function(t){return this.pushStack(O(this,t||[],!0))},is:function(t){return!!O(this,"string"==typeof t&&S.test(t)?x(t):t||[],!1).length}});var I,N=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(x.fn.init=function(t,e,n){var r,i;if(!t)return this;if(n=n||I,"string"==typeof t){if(!(r="<"===t[0]&&">"===t[t.length-1]&&t.length>=3?[null,t,null]:N.exec(t))||!r[1]&&e)return!e||e.jquery?(e||n).find(t):this.constructor(e).find(t);if(r[1]){if(e=e instanceof x?e[0]:e,x.merge(this,x.parseHTML(r[1],e&&e.nodeType?e.ownerDocument||e:a,!0)),D.test(r[1])&&x.isPlainObject(e))for(r in e)y(this[r])?this[r](e[r]):this.attr(r,e[r]);return this}return(i=a.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return t.nodeType?(this[0]=t,this.length=1,this):y(t)?void 0!==n.ready?n.ready(t):t(x):x.makeArray(t,this)}).prototype=x.fn,I=x(a);var j=/^(?:parents|prev(?:Until|All))/,P={children:!0,contents:!0,next:!0,prev:!0};function R(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}x.fn.extend({has:function(t){var e=x(t,this),n=e.length;return this.filter(function(){for(var t=0;t-1:1===n.nodeType&&x.find.matchesSelector(n,t))){o.push(n);break}return this.pushStack(o.length>1?x.uniqueSort(o):o)},index:function(t){return t?"string"==typeof t?f.call(x(t),this[0]):f.call(this,t.jquery?t[0]:t):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(x.uniqueSort(x.merge(this.get(),x(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),x.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return E(t,"parentNode")},parentsUntil:function(t,e,n){return E(t,"parentNode",n)},next:function(t){return R(t,"nextSibling")},prev:function(t){return R(t,"previousSibling")},nextAll:function(t){return E(t,"nextSibling")},prevAll:function(t){return E(t,"previousSibling")},nextUntil:function(t,e,n){return E(t,"nextSibling",n)},prevUntil:function(t,e,n){return E(t,"previousSibling",n)},siblings:function(t){return $((t.parentNode||{}).firstChild,t)},children:function(t){return $(t.firstChild)},contents:function(t){return void 0!==t.contentDocument?t.contentDocument:(B(t,"template")&&(t=t.content||t),x.merge([],t.childNodes))}},function(t,e){x.fn[t]=function(n,r){var i=x.map(this,e,n);return"Until"!==t.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=x.filter(r,i)),this.length>1&&(P[t]||x.uniqueSort(i),j.test(t)&&i.reverse()),this.pushStack(i)}});var L=/[^\x20\t\r\n\f]+/g;function M(t){return t}function F(t){throw t}function U(t,e,n,r){var i;try{t&&y(i=t.promise)?i.call(t).done(e).fail(n):t&&y(i=t.then)?i.call(t,e,n):e.apply(void 0,[t].slice(r))}catch(t){n.apply(void 0,[t])}}x.Callbacks=function(t){t="string"==typeof t?function(t){var e={};return x.each(t.match(L)||[],function(t,n){e[n]=!0}),e}(t):x.extend({},t);var e,n,r,i,o=[],a=[],s=-1,c=function(){for(i=i||t.once,r=e=!0;a.length;s=-1)for(n=a.shift();++s-1;)o.splice(n,1),n<=s&&s--}),this},has:function(t){return t?x.inArray(t,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=a=[],o=n="",this},disabled:function(){return!o},lock:function(){return i=a=[],n||e||(o=n=""),this},locked:function(){return!!i},fireWith:function(t,n){return i||(n=[t,(n=n||[]).slice?n.slice():n],a.push(n),e||c()),this},fire:function(){return u.fireWith(this,arguments),this},fired:function(){return!!r}};return u},x.extend({Deferred:function(t){var e=[["notify","progress",x.Callbacks("memory"),x.Callbacks("memory"),2],["resolve","done",x.Callbacks("once memory"),x.Callbacks("once memory"),0,"resolved"],["reject","fail",x.Callbacks("once memory"),x.Callbacks("once memory"),1,"rejected"]],r="pending",i={state:function(){return r},always:function(){return o.done(arguments).fail(arguments),this},catch:function(t){return i.then(null,t)},pipe:function(){var t=arguments;return x.Deferred(function(n){x.each(e,function(e,r){var i=y(t[r[4]])&&t[r[4]];o[r[1]](function(){var t=i&&i.apply(this,arguments);t&&y(t.promise)?t.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[r[0]+"With"](this,i?[t]:arguments)})}),t=null}).promise()},then:function(t,r,i){var o=0;function a(t,e,r,i){return function(){var s=this,c=arguments,u=function(){var n,u;if(!(t=o&&(r!==F&&(s=void 0,c=[n]),e.rejectWith(s,c))}};t?l():(x.Deferred.getStackHook&&(l.stackTrace=x.Deferred.getStackHook()),n.setTimeout(l))}}return x.Deferred(function(n){e[0][3].add(a(0,n,y(i)?i:M,n.notifyWith)),e[1][3].add(a(0,n,y(t)?t:M)),e[2][3].add(a(0,n,y(r)?r:F))}).promise()},promise:function(t){return null!=t?x.extend(t,i):i}},o={};return x.each(e,function(t,n){var a=n[2],s=n[5];i[n[1]]=a.add,s&&a.add(function(){r=s},e[3-t][2].disable,e[3-t][3].disable,e[0][2].lock,e[0][3].lock),a.add(n[3].fire),o[n[0]]=function(){return o[n[0]+"With"](this===o?void 0:this,arguments),this},o[n[0]+"With"]=a.fireWith}),i.promise(o),t&&t.call(o,o),o},when:function(t){var e=arguments.length,n=e,r=Array(n),i=c.call(arguments),o=x.Deferred(),a=function(t){return function(n){r[t]=this,i[t]=arguments.length>1?c.call(arguments):n,--e||o.resolveWith(r,i)}};if(e<=1&&(U(t,o.done(a(n)).resolve,o.reject,!e),"pending"===o.state()||y(i[n]&&i[n].then)))return o.then();for(;n--;)U(i[n],a(n),o.reject);return o.promise()}});var H=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;x.Deferred.exceptionHook=function(t,e){n.console&&n.console.warn&&t&&H.test(t.name)&&n.console.warn("jQuery.Deferred exception: "+t.message,t.stack,e)},x.readyException=function(t){n.setTimeout(function(){throw t})};var z=x.Deferred();function q(){a.removeEventListener("DOMContentLoaded",q),n.removeEventListener("load",q),x.ready()}x.fn.ready=function(t){return z.then(t).catch(function(t){x.readyException(t)}),this},x.extend({isReady:!1,readyWait:1,ready:function(t){(!0===t?--x.readyWait:x.isReady)||(x.isReady=!0,!0!==t&&--x.readyWait>0||z.resolveWith(a,[x]))}}),x.ready.then=z.then,"complete"===a.readyState||"loading"!==a.readyState&&!a.documentElement.doScroll?n.setTimeout(x.ready):(a.addEventListener("DOMContentLoaded",q),n.addEventListener("load",q));var W=function(t,e,n,r,i,o,a){var s=0,c=t.length,u=null==n;if("object"===w(n))for(s in i=!0,n)W(t,e,s,n[s],!0,o,a);else if(void 0!==r&&(i=!0,y(r)||(a=!0),u&&(a?(e.call(t,r),e=null):(u=e,e=function(t,e,n){return u.call(x(t),n)})),e))for(;s1,null,!0)},removeData:function(t){return this.each(function(){X.remove(this,t)})}}),x.extend({queue:function(t,e,n){var r;if(t)return e=(e||"fx")+"queue",r=Z.get(t,e),n&&(!r||Array.isArray(n)?r=Z.access(t,e,x.makeArray(n)):r.push(n)),r||[]},dequeue:function(t,e){e=e||"fx";var n=x.queue(t,e),r=n.length,i=n.shift(),o=x._queueHooks(t,e);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===e&&n.unshift("inprogress"),delete o.stop,i.call(t,function(){x.dequeue(t,e)},o)),!r&&o&&o.empty.fire()},_queueHooks:function(t,e){var n=e+"queueHooks";return Z.get(t,n)||Z.access(t,n,{empty:x.Callbacks("once memory").add(function(){Z.remove(t,[e+"queue",n])})})}}),x.fn.extend({queue:function(t,e){var n=2;return"string"!=typeof t&&(e=t,t="fx",n--),arguments.length\x20\t\r\n\f]*)/i,gt=/^$|^module$|\/(?:java|ecma)script/i,yt={option:[1,""," "],thead:[1,""],col:[2,""],tr:[2,""],td:[3,""],_default:[0,"",""]};function At(t,e){var n;return n=void 0!==t.getElementsByTagName?t.getElementsByTagName(e||"*"):void 0!==t.querySelectorAll?t.querySelectorAll(e||"*"):[],void 0===e||e&&B(t,e)?x.merge([t],n):n}function _t(t,e){for(var n=0,r=t.length;n-1)i&&i.push(o);else if(u=st(o),a=At(f.appendChild(o),"script"),u&&_t(a),n)for(l=0;o=a[l++];)gt.test(o.type||"")&&n.push(o);return f}bt=a.createDocumentFragment().appendChild(a.createElement("div")),(wt=a.createElement("input")).setAttribute("type","radio"),wt.setAttribute("checked","checked"),wt.setAttribute("name","t"),bt.appendChild(wt),g.checkClone=bt.cloneNode(!0).cloneNode(!0).lastChild.checked,bt.innerHTML="",g.noCloneChecked=!!bt.cloneNode(!0).lastChild.defaultValue;var Tt=/^key/,kt=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Et=/^([^.]*)(?:\.(.+)|)/;function $t(){return!0}function St(){return!1}function Bt(t,e){return t===function(){try{return a.activeElement}catch(t){}}()==("focus"===e)}function Dt(t,e,n,r,i,o){var a,s;if("object"==typeof e){for(s in"string"!=typeof n&&(r=r||n,n=void 0),e)Dt(t,s,n,r,e[s],o);return t}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=St;else if(!i)return t;return 1===o&&(a=i,(i=function(t){return x().off(t),a.apply(this,arguments)}).guid=a.guid||(a.guid=x.guid++)),t.each(function(){x.event.add(this,e,i,r,n)})}function Ot(t,e,n){n?(Z.set(t,e,!1),x.event.add(t,e,{namespace:!1,handler:function(t){var r,i,o=Z.get(this,e);if(1&t.isTrigger&&this[e]){if(o.length)(x.event.special[e]||{}).delegateType&&t.stopPropagation();else if(o=c.call(arguments),Z.set(this,e,o),r=n(this,e),this[e](),o!==(i=Z.get(this,e))||r?Z.set(this,e,!1):i={},o!==i)return t.stopImmediatePropagation(),t.preventDefault(),i.value}else o.length&&(Z.set(this,e,{value:x.event.trigger(x.extend(o[0],x.Event.prototype),o.slice(1),this)}),t.stopImmediatePropagation())}})):void 0===Z.get(t,e)&&x.event.add(t,e,$t)}x.event={global:{},add:function(t,e,n,r,i){var o,a,s,c,u,l,f,d,p,h,v,m=Z.get(t);if(m)for(n.handler&&(n=(o=n).handler,i=o.selector),i&&x.find.matchesSelector(at,i),n.guid||(n.guid=x.guid++),(c=m.events)||(c=m.events={}),(a=m.handle)||(a=m.handle=function(e){return void 0!==x&&x.event.triggered!==e.type?x.event.dispatch.apply(t,arguments):void 0}),u=(e=(e||"").match(L)||[""]).length;u--;)p=v=(s=Et.exec(e[u])||[])[1],h=(s[2]||"").split(".").sort(),p&&(f=x.event.special[p]||{},p=(i?f.delegateType:f.bindType)||p,f=x.event.special[p]||{},l=x.extend({type:p,origType:v,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&x.expr.match.needsContext.test(i),namespace:h.join(".")},o),(d=c[p])||((d=c[p]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(t,r,h,a)||t.addEventListener&&t.addEventListener(p,a)),f.add&&(f.add.call(t,l),l.handler.guid||(l.handler.guid=n.guid)),i?d.splice(d.delegateCount++,0,l):d.push(l),x.event.global[p]=!0)},remove:function(t,e,n,r,i){var o,a,s,c,u,l,f,d,p,h,v,m=Z.hasData(t)&&Z.get(t);if(m&&(c=m.events)){for(u=(e=(e||"").match(L)||[""]).length;u--;)if(p=v=(s=Et.exec(e[u])||[])[1],h=(s[2]||"").split(".").sort(),p){for(f=x.event.special[p]||{},d=c[p=(r?f.delegateType:f.bindType)||p]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=d.length;o--;)l=d[o],!i&&v!==l.origType||n&&n.guid!==l.guid||s&&!s.test(l.namespace)||r&&r!==l.selector&&("**"!==r||!l.selector)||(d.splice(o,1),l.selector&&d.delegateCount--,f.remove&&f.remove.call(t,l));a&&!d.length&&(f.teardown&&!1!==f.teardown.call(t,h,m.handle)||x.removeEvent(t,p,m.handle),delete c[p])}else for(p in c)x.event.remove(t,p+e[u],n,r,!0);x.isEmptyObject(c)&&Z.remove(t,"handle events")}},dispatch:function(t){var e,n,r,i,o,a,s=x.event.fix(t),c=new Array(arguments.length),u=(Z.get(this,"events")||{})[s.type]||[],l=x.event.special[s.type]||{};for(c[0]=s,e=1;e=1))for(;u!==this;u=u.parentNode||this)if(1===u.nodeType&&("click"!==t.type||!0!==u.disabled)){for(o=[],a={},n=0;n-1:x.find(i,this,null,[u]).length),a[i]&&o.push(r);o.length&&s.push({elem:u,handlers:o})}return u=this,c\x20\t\r\n\f]*)[^>]*)\/>/gi,Nt=/
diff --git a/resources/views/v1/reports/default/year.twig b/resources/views/v1/reports/default/year.twig
index 39bcede316..7801cdc3ed 100644
--- a/resources/views/v1/reports/default/year.twig
+++ b/resources/views/v1/reports/default/year.twig
@@ -220,7 +220,7 @@
var budgetPeriodReportUri = '{{ route('report-data.budget.period', [accountIds, start.format('Ymd'), end.format('Ymd')]) }}';
var categoryExpenseUri = '{{ route('report-data.category.expenses', [accountIds, start.format('Ymd'), end.format('Ymd')]) }}';
var categoryIncomeUri = '{{ route('report-data.category.income', [accountIds, start.format('Ymd'), end.format('Ymd')]) }}';
-
+ var billReportUri = '';
diff --git a/resources/views/v1/reports/partials/accounts.twig b/resources/views/v1/reports/partials/accounts.twig
index 34ef9d6798..53a9e5e0c5 100644
--- a/resources/views/v1/reports/partials/accounts.twig
+++ b/resources/views/v1/reports/partials/accounts.twig
@@ -14,28 +14,35 @@
{{ account.name }}
- {{ formatAmountByCurrency(account.currency, account.start_balance) }}
+ {{ formatAmountBySymbol(account.start_balance, account.currency_symbol, account.currency_decimal_places) }}
- {{ formatAmountByCurrency(account.currency, account.end_balance) }}
+ {{ formatAmountBySymbol(account.end_balance, account.currency_symbol, account.currency_decimal_places) }}
+
- {{ formatAmountByCurrency(account.currency, (account.end_balance - account.start_balance)) }}
+ {{ formatAmountBySymbol(account.end_balance - account.start_balance, account.currency_symbol, account.currency_decimal_places) }}
{% endfor %}
+
+ {{ 'sumOfSums'|_ }}
+
+ {% for sum in accountReport.sums %}
+
+
+
+
+
+ {{ formatAmountBySymbol(sum.start, sum.currency_symbol, sum.currency_decimal_places) }}
+
+
+ {{ formatAmountBySymbol(sum.end, sum.currency_symbol, sum.currency_decimal_places) }}
+
+
+ {{ formatAmountBySymbol(sum.difference, sum.currency_symbol, sum.currency_decimal_places) }}
+
+
+ {% endfor %}
-
-
- {{ 'sumOfSums'|_ }}
- {{ accountReport.start|formatAmount }}
- {{ accountReport.end|formatAmount }}
- {{ accountReport.difference|formatAmount }}
-
- {% if accountReport.currencies > 1 %}
-
- {{ 'multi_currency_report_sum'|_ }}
-
- {% endif %}
-
diff --git a/resources/views/v1/reports/partials/balance.twig b/resources/views/v1/reports/partials/balance.twig
index 3bed737ebe..f3cdf36345 100644
--- a/resources/views/v1/reports/partials/balance.twig
+++ b/resources/views/v1/reports/partials/balance.twig
@@ -1,59 +1,57 @@
- {{ 'budgets'|_ }}
- {% for account in balance.getBalanceHeader.getAccounts %}
- {{ account.name }}
+ {{ 'budgets'|_ }}
+ {% for account in report.accounts %}
+ {% if account.sum != 0 %}
+ {{ account.name }}
+ {% endif %}
{% endfor %}
-
- {{ 'leftInBudget'|_ }}
-
+ {{ 'sum'|_ }}
- {% for balanceLine in balance.getBalanceLines %}
-
-
- {% if balanceLine.getBudget.id %}
-
- {{ balanceLine.getTitle }}
- {% if balanceLine.getStartdate and balanceLine.getEnddate %}
-
- {{ balanceLine.getStartdate.formatLocalized(monthAndDayFormat) }}
- —
- {{ balanceLine.getEnddate.formatLocalized(monthAndDayFormat) }}
-
- {% endif %}
-
+ {% for budget in report.budgets %}
+ {% if budget.spent|length > 0 %}
+
+
+ {{ budget.budget_name }}
+
+ {% for account in report.accounts %}
+ {% if budget.spent[account.id] %}
- {% if(balanceLine.getBudgetLimit.amount) %}
- {{ balanceLine.getBudgetLimit.amount|formatAmount }}
- {% else %}
- {{ '0'|formatAmount }}
- {% endif %}
+ {{ formatAmountBySymbol(budget.spent[account.id].spent, budget.spent[account.id].currency_symbol, budget.spent[account.id].currency_decimal_places) }}
+
+ {# TODO #}
+ {#data-location="category-entry" data-category-id="{{ category.id }}" data-currency-id="{{ category.currency_id }}"-->#}
{% else %}
- {{ balanceLine.getTitle }}
+ {% if report.accounts[account.id].sum != 0 %}
+
+ {% endif %}
{% endif %}
- {% for balanceEntry in balanceLine.getBalanceEntries %}
-
- {% if balanceEntry.getSpent != 0 %}
- {{ (balanceEntry.getSpent)|formatAmountPlain }}
-
- {% endif %}
- {% if balanceEntry.getLeft != 0 %}
- {{ (balanceEntry.getLeft)|formatAmountPlain }}
- {% endif %}
-
+ {% endfor %}
+
+ {% for sum in report.sums[budget.budget_id] %}
+ {{ formatAmountBySymbol(sum.sum, sum.currency_symbol, sum.currency_decimal_places) }}
{% endfor %}
-
- {{ balanceLine.leftOfRepetition|formatAmount }}
-
-
+
+
+ {% endif %}
{% endfor %}
+
+
+ {{ 'sum'|_ }}
+ {% for account in report.accounts %}
+ {% if account.sum != 0 %}
+
+ {{ formatAmountBySymbol(account.sum, account.currency_symbol, account.currency_decimal_places) }}
+
+ {% endif %}
+ {% endfor %}
+
+
diff --git a/resources/views/v1/reports/partials/bills.twig b/resources/views/v1/reports/partials/bills.twig
index f6a90b5081..d9fbad38a6 100644
--- a/resources/views/v1/reports/partials/bills.twig
+++ b/resources/views/v1/reports/partials/bills.twig
@@ -1,19 +1,51 @@
-
-
-
{{ trans('form.name') }}
{{ trans('form.amount_min') }}
{{ trans('form.amount_max') }}
- {{ trans('form.amount') }}
- {{ trans('form.under') }}
+ {{ trans('form.expected_on') }}
+ {{ trans('form.paid') }}
+ {% for bill in report.bills %}
+ {% if bill.expected_dates|length > 0 and bill.paid_moments|length > 0 and bill.active %}
+
+
+ {{ bill.name }}
+
+
+ {{ formatAmountBySymbol(bill.amount_min, bill.currency_symbol, bill.currency_decimal_places) }}
+
+
+ {{ formatAmountBySymbol(bill.amount_max, bill.currency_symbol, bill.currency_decimal_places) }}
+
+
+ {% for date in bill.expected_dates %}
+ {{ date.formatLocalized(monthAndDayFormat) }}
+ {% endfor %}
+
+
+ {% set hitCount = 0 %}
+ {% for journals in bill.paid_moments %}
+ {% for journal in journals %}
+ {% set hitCount = hitCount+1 %}
+ {{ journal.description }} ,
+ {{ formatAmountBySymbol(journal.amount, journal.currency_symbol, journal.currency_decimal_places) }}
+
+ {% endfor %}
+ {% endfor %}
+ {% if hitCount == 0 %}
+ {{ 'notCharged'|_ }}
+ {% endif %}
+
+
+ {% endif %}
+ {% endfor %}
+
+
{% for line in bills.getBills %}
@@ -50,5 +82,3 @@
{% endfor %}
-
-
diff --git a/resources/views/v1/reports/partials/budgets.twig b/resources/views/v1/reports/partials/budgets.twig
index d9f5cb991a..9378ab4dda 100644
--- a/resources/views/v1/reports/partials/budgets.twig
+++ b/resources/views/v1/reports/partials/budgets.twig
@@ -11,19 +11,74 @@
- {% set sum_budgeted = 0 %}
- {% set sum_spent = 0 %}
- {% set sum_left = 0 %}
- {% set sum_overspent = 0 %}
- {% for line in budgets %}
+ {% for budget in budgets.budgets %}
+ {% for row in budget.rows %}
+
+
+ {% if budget.no_budget %}
+
+ {{ 'no_budget'|_ }} ({{ row.currency_name }})
+
+ {% else %}
+
+ {{ budget.budget_name }}
+
+ {% endif %}
+
+
+ {% if null != row.limit_id %}
+
+ {{ row.start_date.formatLocalized(monthAndDayFormat) }}
+ —
+ {{ row.end_date.formatLocalized(monthAndDayFormat) }}
+
+ {% endif %}
+
+
+
+
+ {% if null != row.budgeted %}
+ {{ formatAmountBySymbol(row.budgeted, row.currency_symbol, row.currency_decimal_places) }}
+ {% endif %}
+
+
+
+
+ {{ formatAmountBySymbol(row.spent, row.currency_symbol, row.currency_decimal_places) }}
+
+
+
+
+ {% if row.spent != 0 %}
+
+ {% endif %}
+
+
+
+
+ {% if null != row.left %}
+ {{ formatAmountBySymbol(row.left, row.currency_symbol, row.currency_decimal_places) }}
+ {% endif %}
+
+
+
+
+ {% if null != row.overspent %}
+ {{ formatAmountBySymbol(row.overspent, row.currency_symbol, row.currency_decimal_places) }}
+ {% endif %}
+
+
+ {% endfor %}
+ {#
{% set sum_budgeted = sum_budgeted + line.budgeted %}
{% set sum_spent = sum_spent + line.spent %}
{% set sum_left = sum_left + line.left %}
{% set sum_overspent = sum_overspent + line.overspent %}
- {# Budget name, always visible #}
+
{% if line.type == 'no-budget' %}
{{ 'no_budget'|_ }}
@@ -33,7 +88,7 @@
{{ line.name }}
{% endif %}
- {# date, hidden on mobile #}
+
{% if line.type == 'budget-line' %}
@@ -48,17 +103,17 @@
{% endif %}
- {# budgeted, hidden on mobile #}
+
{{ line.budgeted|formatAmount }}
- {# spent, visible on mobile #}
+
{{ line.spent|formatAmount }}
- {# info button, not visible on mobile #}
+
{% if line.spent != 0 %}
- {# left, hidden on mobile #}
+
{{ line.left|formatAmount }}
- {# overspent, visible. #}
+
{{ line.overspent|formatAmount }}
+ #}
{% endfor %}
+ {% for sum in budgets.sums %}
+
+ {{ 'sum'|_ }} ({{ sum.currency_name }})
+ {{ formatAmountBySymbol(sum.budgeted, sum.currency_symbol, sum.decimal_places) }}
+ {{ formatAmountBySymbol(sum.spent, sum.currency_symbol, sum.decimal_places) }}
+
+ {{ formatAmountBySymbol(sum.left, sum.currency_symbol, sum.decimal_places) }}
+ {{ formatAmountBySymbol(sum.overspent, sum.currency_symbol, sum.decimal_places) }}
+
+ {% endfor %}
+ {#
- {# title, visible #}
+
{{ 'sum'|_ }}
- {# date, hidden #}
+
+
- {# sum of budgeted, hidden #}
+
{{ sum_budgeted|formatAmount }}
- {# spent, visible #}
+
{{ sum_spent|formatAmount }}
- {# info button, hidden #}
+
- {# left, hidden #}
+
{{ sum_left|formatAmount }}
{{ sum_overspent|formatAmount }}
+ #}
diff --git a/resources/views/v1/reports/partials/categories.twig b/resources/views/v1/reports/partials/categories.twig
index 8b6954fd83..9a07c2d2dc 100644
--- a/resources/views/v1/reports/partials/categories.twig
+++ b/resources/views/v1/reports/partials/categories.twig
@@ -2,17 +2,14 @@
{{ 'category'|_ }}
- {{ 'earned'|_ }}
{{ 'spent'|_ }}
+ {{ 'earned'|_ }}
- {% set sumSpent = 0 %}
- {% set sumEarned = 0 %}
- {% for index, category in report %}
- {% set sumSpent = sumSpent + category.spent %}
- {% set sumEarned = sumEarned + category.earned %}
+
+ {% for index, category in report.categories %}
{% if loop.index > listLength %}
{% else %}
@@ -21,11 +18,11 @@
{{ category.name }}
- {{ category.earned|formatAmount }}
- {{ category.spent|formatAmount }}
+ {{ formatAmountBySymbol(category.spent, category.currency_symbol, category.currency_decimal_places, true) }}
+ {{ formatAmountBySymbol(category.earned, category.currency_symbol, category.currency_decimal_places, true) }}
@@ -34,17 +31,31 @@
{% if report|length > listLength %}
-
+
{{ trans('firefly.show_full_list',{number:incomeTopLength}) }}
{% endif %}
-
+ {% for sum in report.sums %}
+
+ {{ 'sum'|_ }} ({{ sum.currency_name }})
+
+ {{ formatAmountBySymbol(sum.spent, sum.currency_symbol, sum.currency_decimal_places) }}
+
+
+ {{ formatAmountBySymbol(sum.earned, sum.currency_symbol, sum.currency_decimal_places) }}
+
+
+
+ {% endfor %}
+ {#
{{ 'sum'|_ }}
{{ sumEarned|formatAmount }}
{{ sumSpent|formatAmount }}
+ TODO fix the sum here.
+ #}
diff --git a/resources/views/v1/reports/partials/income-expenses.twig b/resources/views/v1/reports/partials/income-expenses.twig
index 6d804feceb..fb89c15b6f 100644
--- a/resources/views/v1/reports/partials/income-expenses.twig
+++ b/resources/views/v1/reports/partials/income-expenses.twig
@@ -8,58 +8,54 @@
- {% set sum = 0 %}
- {% for entry in entries %}
- {% set sum = sum + entry.sum %}
+ {% for account in report.accounts %}
{% if loop.index > listLength %}
{% else %}
{% endif %}
-
- {{ entry.name }}
- {% if entry.count > 1 %}
+
+ {{ account.name }}
+ {% if account.count > 1 %}
- {{ entry.count }} {{ 'transactions'|_|lower }}
+ {{ account.count }} {{ 'transactions'|_|lower }}
{% endif %}
-
- {% if entry.currencies == 1 %}
- {{ formatAmountByCurrency(entry.single_currency, entry.sum) }}
- {% else %}
- {{ (entry.sum)|formatAmount }}
- {% endif %}
+
+ {{ formatAmountBySymbol(account.sum, account.currency_symbol, account.currency_decimal_places) }}
-
- {% if entry.count > 1 %}
- {{ entry.average|formatAmount }}
+
+ {% if account.count > 1 %}
+ {{ formatAmountBySymbol(account.average, account.currency_symbol, account.currency_decimal_places) }}
{% else %}
—
{% endif %}
+ data-account-id="{{ account.id }}" data-currency-id="{{ account.currency_id }}">
{% endfor %}
+
- {% if entries|length > listLength %}
+ {% if report.accounts|length > listLength %}
{{ trans('firefly.show_full_list',{number:incomeTopLength}) }}
{% endif %}
-
- {{ 'sum'|_ }}
- {{ (sum)|formatAmount }}
-
-
- {{ 'sum_in_default_currency'|_ }}
-
-
+ {% for sum in report.sums %}
+
+ {{ 'sum'|_ }} ({{ sum.currency_name }})
+
+ {{ formatAmountBySymbol(sum.sum, sum.currency_symbol, sum.currency_decimal_places) }}
+
+
+
+ {% endfor %}
diff --git a/resources/views/v1/reports/partials/journals-audit.twig b/resources/views/v1/reports/partials/journals-audit.twig
index fda96e3377..0310f3ca64 100644
--- a/resources/views/v1/reports/partials/journals-audit.twig
+++ b/resources/views/v1/reports/partials/journals-audit.twig
@@ -77,14 +77,14 @@
- {{ formatAmountBySymbol(journal.balance_before, journal.currency_symbol, journal.currency_symbol_decimal_places) }}
+ {{ formatAmountBySymbol(journal.balance_before, journal.currency_symbol, journal.currency_decimal_places) }}
- {{ formatAmountBySymbol(journal.amount, journal.currency_symbol, journal.currency_symbol_decimal_places) }}
+ {{ formatAmountBySymbol(journal.amount, journal.currency_symbol, journal.currency_decimal_places) }}
- {{ formatAmountBySymbol(journal.balance_after, journal.currency_symbol, journal.currency_symbol_decimal_places) }}
+ {{ formatAmountBySymbol(journal.balance_after, journal.currency_symbol, journal.currency_decimal_places) }}
{{ journal.date.formatLocalized(monthAndDayFormat) }}
diff --git a/resources/views/v1/reports/partials/operations.twig b/resources/views/v1/reports/partials/operations.twig
index b77387d38d..e0e772e938 100644
--- a/resources/views/v1/reports/partials/operations.twig
+++ b/resources/views/v1/reports/partials/operations.twig
@@ -1,19 +1,22 @@
- {{ 'money_flowing_in'|_ }}
- {{ incomeSum|formatAmount }}
+ {{'currency'|_}}
+ {{ 'money_flowing_in'|_ }}
+ {{ 'money_flowing_out'|_ }}
+ {{ 'difference'|_ }}
+ {% for sum in sums %}
- {{ 'money_flowing_out'|_ }}
- {{ expensesSum|formatAmount }}
-
-
- {{ 'difference'|_ }}
- {{ (incomeSum + expensesSum)|formatAmount }}
-
-
-
- {{ 'sum_in_default_currency'|_ }}
+ {{ sum.currency_name }} ({{ sum.currency_symbol }})
+
+ {{ formatAmountBySymbol(sum.in, sum.currency_symbol, sum.currency_decimal_places) }}
+
+
+ {{ formatAmountBySymbol(sum.out, sum.currency_symbol, sum.currency_decimal_places) }}
+
+
+ {{ formatAmountBySymbol(sum.sum, sum.currency_symbol, sum.currency_decimal_places) }}
+ {% endfor %}
diff --git a/resources/views/v1/reports/partials/top-transactions.twig b/resources/views/v1/reports/partials/top-transactions.twig
index c52c4fa895..a8f6f7e85e 100644
--- a/resources/views/v1/reports/partials/top-transactions.twig
+++ b/resources/views/v1/reports/partials/top-transactions.twig
@@ -20,9 +20,9 @@
- {{ formatAmountBySymbol(transaction.amount, transaction.currency_symbol, transaction.currency_symbol_decimal_places) }}
+ {{ formatAmountBySymbol(transaction.amount, transaction.currency_symbol, transaction.currency_decimal_places) }}
{% if null != transaction.foreign_amount %}
- ({{ formatAmountBySymbol(transaction.foreign_amount, transaction.foreign_currency_symbol, transaction.foreign_currency_symbol_decimal_places) }})
+ ({{ formatAmountBySymbol(transaction.foreign_amount, transaction.foreign_currency_symbol, transaction.foreign_currency_decimal_places) }})
{% endif %}
diff --git a/resources/views/v1/reports/tag/month.twig b/resources/views/v1/reports/tag/month.twig
index 5d8fb2f095..a24b5f050a 100644
--- a/resources/views/v1/reports/tag/month.twig
+++ b/resources/views/v1/reports/tag/month.twig
@@ -300,7 +300,7 @@
- {{ formatAmountBySymbol(row.amount, row.currency_symbol, row.currency_symbol_decimal_places) }}
+ {{ formatAmountBySymbol(row.amount, row.currency_symbol, row.currency_decimal_places) }}
{% endfor %}
diff --git a/resources/views/v1/search/search.twig b/resources/views/v1/search/search.twig
index 5398c90e8d..5234c64dce 100644
--- a/resources/views/v1/search/search.twig
+++ b/resources/views/v1/search/search.twig
@@ -3,4 +3,4 @@
{{ trans('firefly.search_found_transactions', {count: transactions.count, time: searchTime}) }}
-{% include 'list.groups' %}
\ No newline at end of file
+{% include 'list.groups' %}
diff --git a/resources/views/v1/transactions/bulk/edit.twig b/resources/views/v1/transactions/bulk/edit.twig
index e5e9bfb2e6..bff7dbf877 100644
--- a/resources/views/v1/transactions/bulk/edit.twig
+++ b/resources/views/v1/transactions/bulk/edit.twig
@@ -43,21 +43,21 @@
{{ journal.description }}
{% if journal.transaction_type_type == 'Deposit' %}
- {{ formatAmountBySymbol(journal.amount*-1, journal.currency_symbol, journal.currency_symbol_decimal_places) }}
+ {{ formatAmountBySymbol(journal.amount*-1, journal.currency_symbol, journal.currency_decimal_places) }}
{% if null != journal.foreign_amount %}
- ({{ formatAmountBySymbol(journal.foreign_amount*-1, journal.foreign_currency_symbol, journal.foreign_currency_symbol_decimal_places) }})
+ ({{ formatAmountBySymbol(journal.foreign_amount*-1, journal.foreign_currency_symbol, journal.foreign_currency_decimal_places) }})
{% endif %}
{% elseif journal.transaction_type_type == 'Transfer' %}
- {{ formatAmountBySymbol(journal.amount*-1, journal.currency_symbol, journal.currency_symbol_decimal_places, false) }}
+ {{ formatAmountBySymbol(journal.amount*-1, journal.currency_symbol, journal.currency_decimal_places, false) }}
{% if null != journal.foreign_amount %}
- ({{ formatAmountBySymbol(journal.foreign_amount*-1, journal.foreign_currency_symbol, journal.foreign_currency_symbol_decimal_places, false) }})
+ ({{ formatAmountBySymbol(journal.foreign_amount*-1, journal.foreign_currency_symbol, journal.foreign_currency_decimal_places, false) }})
{% endif %}
{% else %}
- {{ formatAmountBySymbol(journal.amount, journal.currency_symbol, journal.currency_symbol_decimal_places) }}
+ {{ formatAmountBySymbol(journal.amount, journal.currency_symbol, journal.currency_decimal_places) }}
{% if null != journal.foreign_amount %}
- ({{ formatAmountBySymbol(journal.foreign_amount, journal.foreign_currency_symbol, journal.foreign_currency_symbol_decimal_places) }})
+ ({{ formatAmountBySymbol(journal.foreign_amount, journal.foreign_currency_symbol, journal.foreign_currency_decimal_places) }})
{% endif %}
{% endif %}
diff --git a/resources/views/v1/transactions/convert.twig b/resources/views/v1/transactions/convert.twig
index 768ae2e33f..7892fca981 100644
--- a/resources/views/v1/transactions/convert.twig
+++ b/resources/views/v1/transactions/convert.twig
@@ -254,19 +254,19 @@
{% if transaction.transaction_type_type == 'Deposit' %}
- {{ formatAmountBySymbol(transaction.amount*-1, transaction.currency_symbol, transaction.currency_symbol_decimal_places) }}
+ {{ formatAmountBySymbol(transaction.amount*-1, transaction.currency_symbol, transaction.currency_decimal_places) }}
{% if null != transaction.foreign_amount %}
- ({{ formatAmountBySymbol(transaction.foreign_amount*-1, transaction.foreign_currency_symbol, transaction.foreign_currency_symbol_decimal_places) }})
+ ({{ formatAmountBySymbol(transaction.foreign_amount*-1, transaction.foreign_currency_symbol, transaction.foreign_currency_decimal_places) }})
{% endif %}
{% elseif transaction.transaction_type_type == 'Transfer' %}
- {{ formatAmountBySymbol(transaction.amount*-1, transaction.currency_symbol, transaction.currency_symbol_decimal_places, false) }}
+ {{ formatAmountBySymbol(transaction.amount*-1, transaction.currency_symbol, transaction.currency_decimal_places, false) }}
{% if null != transaction.foreign_amount %}
- ({{ formatAmountBySymbol(transaction.foreign_amount*-1, transaction.foreign_currency_symbol, transaction.foreign_currency_symbol_decimal_places, false) }})
+ ({{ formatAmountBySymbol(transaction.foreign_amount*-1, transaction.foreign_currency_symbol, transaction.foreign_currency_decimal_places, false) }})
{% endif %}
{% else %}
- {{ formatAmountBySymbol(transaction.amount, transaction.currency_symbol, transaction.currency_symbol_decimal_places) }}
+ {{ formatAmountBySymbol(transaction.amount, transaction.currency_symbol, transaction.currency_decimal_places) }}
{% if null != transaction.foreign_amount %}
- ({{ formatAmountBySymbol(transaction.foreign_amount, transaction.foreign_currency_symbol, transaction.foreign_currency_symbol_decimal_places) }})
+ ({{ formatAmountBySymbol(transaction.foreign_amount, transaction.foreign_currency_symbol, transaction.foreign_currency_decimal_places) }})
{% endif %}
{% endif %}
diff --git a/resources/views/v1/transactions/index.twig b/resources/views/v1/transactions/index.twig
index 3646195456..7fe398a107 100644
--- a/resources/views/v1/transactions/index.twig
+++ b/resources/views/v1/transactions/index.twig
@@ -24,7 +24,7 @@
{# actual list #}
{% include 'list.groups' %}
diff --git a/resources/views/v1/transactions/links/modal.twig b/resources/views/v1/transactions/links/modal.twig
index 3fc07d9ef2..ecd38eaf0f 100644
--- a/resources/views/v1/transactions/links/modal.twig
+++ b/resources/views/v1/transactions/links/modal.twig
@@ -49,4 +49,4 @@
-
\ No newline at end of file
+
diff --git a/resources/views/v1/transactions/mass/delete.twig b/resources/views/v1/transactions/mass/delete.twig
index f7c96b4463..ce460512c3 100644
--- a/resources/views/v1/transactions/mass/delete.twig
+++ b/resources/views/v1/transactions/mass/delete.twig
@@ -65,20 +65,20 @@
{% if journal.transaction_type_type == 'Deposit' %}
- {{ formatAmountBySymbol(journal.amount*-1, journal.currency_symbol, journal.currency_symbol_decimal_places) }}
+ {{ formatAmountBySymbol(journal.amount*-1, journal.currency_symbol, journal.currency_decimal_places) }}
{% if null != journal.foreign_amount %}
- ({{ formatAmountBySymbol(journal.foreign_amount*-1, journal.foreign_currency_symbol, journal.foreign_currency_symbol_decimal_places) }})
+ ({{ formatAmountBySymbol(journal.foreign_amount*-1, journal.foreign_currency_symbol, journal.foreign_currency_decimal_places) }})
{% endif %}
{% elseif journal.transaction_type_type == 'Transfer' %}
- {{ formatAmountBySymbol(journal.amount*-1, journal.currency_symbol, journal.currency_symbol_decimal_places, false) }}
+ {{ formatAmountBySymbol(journal.amount*-1, journal.currency_symbol, journal.currency_decimal_places, false) }}
{% if null != journal.foreign_amount %}
- ({{ formatAmountBySymbol(journal.foreign_amount*-1, journal.foreign_currency_symbol, journal.foreign_currency_symbol_decimal_places, false) }})
+ ({{ formatAmountBySymbol(journal.foreign_amount*-1, journal.foreign_currency_symbol, journal.foreign_currency_decimal_places, false) }})
{% endif %}
{% else %}
- {{ formatAmountBySymbol(journal.amount, journal.currency_symbol, journal.currency_symbol_decimal_places) }}
+ {{ formatAmountBySymbol(journal.amount, journal.currency_symbol, journal.currency_decimal_places) }}
{% if null != journal.foreign_amount %}
- ({{ formatAmountBySymbol(journal.foreign_amount, journal.foreign_currency_symbol, journal.foreign_currency_symbol_decimal_places) }})
+ ({{ formatAmountBySymbol(journal.foreign_amount, journal.foreign_currency_symbol, journal.foreign_currency_decimal_places) }})
{% endif %}
{% endif %}
diff --git a/resources/views/v1/transactions/mass/edit.twig b/resources/views/v1/transactions/mass/edit.twig
index e7f95317c0..e9039cbe8c 100644
--- a/resources/views/v1/transactions/mass/edit.twig
+++ b/resources/views/v1/transactions/mass/edit.twig
@@ -69,21 +69,21 @@
{% if journal.reconciled != false %}
{% if journal.transaction_type_type == 'Deposit' %}
- {{ formatAmountBySymbol(journal.amount*-1, journal.currency_symbol, journal.currency_symbol_decimal_places) }}
+ {{ formatAmountBySymbol(journal.amount*-1, journal.currency_symbol, journal.currency_decimal_places) }}
{% if null != journal.foreign_amount %}
- ({{ formatAmountBySymbol(journal.foreign_amount*-1, journal.foreign_currency_symbol, journal.foreign_currency_symbol_decimal_places) }})
+ ({{ formatAmountBySymbol(journal.foreign_amount*-1, journal.foreign_currency_symbol, journal.foreign_currency_decimal_places) }})
{% endif %}
{% elseif journal.transaction_type_type == 'Transfer' %}
- {{ formatAmountBySymbol(journal.amount*-1, journal.currency_symbol, journal.currency_symbol_decimal_places, false) }}
+ {{ formatAmountBySymbol(journal.amount*-1, journal.currency_symbol, journal.currency_decimal_places, false) }}
{% if null != journal.foreign_amount %}
- ({{ formatAmountBySymbol(journal.foreign_amount*-1, journal.foreign_currency_symbol, journal.foreign_currency_symbol_decimal_places, false) }})
+ ({{ formatAmountBySymbol(journal.foreign_amount*-1, journal.foreign_currency_symbol, journal.foreign_currency_decimal_places, false) }})
{% endif %}
{% else %}
- {{ formatAmountBySymbol(journal.amount, journal.currency_symbol, journal.currency_symbol_decimal_places) }}
+ {{ formatAmountBySymbol(journal.amount, journal.currency_symbol, journal.currency_decimal_places) }}
{% if null != journal.foreign_amount %}
- ({{ formatAmountBySymbol(journal.foreign_amount, journal.foreign_currency_symbol, journal.foreign_currency_symbol_decimal_places) }})
+ ({{ formatAmountBySymbol(journal.foreign_amount, journal.foreign_currency_symbol, journal.foreign_currency_decimal_places) }})
{% endif %}
{% endif %}
{% endif %}
diff --git a/resources/views/v1/transactions/show.twig b/resources/views/v1/transactions/show.twig
index 3b0e75c589..4a17bb36e7 100644
--- a/resources/views/v1/transactions/show.twig
+++ b/resources/views/v1/transactions/show.twig
@@ -176,7 +176,7 @@
title="{{ journal.source_iban|default(journal.source_name) }}">{{ journal.source_name }} →
{% if type == 'Withdrawal' or type == 'Deposit' %}
{{ formatAmountBySymbol(journal.amount*-1, journal.currency_symbol, journal.currency_decimal_places) }}
- {% elseif type == 'Transfer' %}
+ {% elseif type == 'Transfer' or type == 'Opening balance' %}
{{ formatAmountBySymbol(journal.amount, journal.currency_symbol, journal.currency_decimal_places, false) }}
@@ -193,7 +193,6 @@
{% endif %}
{% endif %}
-
→
{{ journal.destination_name }}
diff --git a/routes/api.php b/routes/api.php
index 1e77504a33..802290a612 100644
--- a/routes/api.php
+++ b/routes/api.php
@@ -42,7 +42,9 @@ declare(strict_types=1);
*/
Route::group(
- ['middleware' => ['auth:api', 'bindings'], 'namespace' => 'FireflyIII\Api\V1\Controllers', 'prefix' => 'about', 'as' => 'api.v1.about.'],
+ [
+ 'namespace' => 'FireflyIII\Api\V1\Controllers', 'prefix' => 'about',
+ 'as' => 'api.v1.about.'],
static function () {
// Accounts API routes:
@@ -53,7 +55,8 @@ Route::group(
Route::group(
- ['middleware' => ['auth:api', 'bindings'], 'namespace' => 'FireflyIII\Api\V1\Controllers', 'prefix' => 'accounts', 'as' => 'api.v1.accounts.'],
+ ['namespace' => 'FireflyIII\Api\V1\Controllers', 'prefix' => 'accounts',
+ 'as' => 'api.v1.accounts.'],
static function () {
// Accounts API routes:
@@ -70,7 +73,8 @@ Route::group(
);
Route::group(
- ['middleware' => ['auth:api', 'bindings'], 'namespace' => 'FireflyIII\Api\V1\Controllers', 'prefix' => 'attachments', 'as' => 'api.v1.attachments.'],
+ ['namespace' => 'FireflyIII\Api\V1\Controllers', 'prefix' => 'attachments',
+ 'as' => 'api.v1.attachments.'],
static function () {
// Attachment API routes:
@@ -85,7 +89,7 @@ Route::group(
);
Route::group(
- ['middleware' => ['auth:api', 'bindings'], 'namespace' => 'FireflyIII\Api\V1\Controllers', 'prefix' => 'available_budgets',
+ ['namespace' => 'FireflyIII\Api\V1\Controllers', 'prefix' => 'available_budgets',
'as' => 'api.v1.available_budgets.'],
static function () {
@@ -99,7 +103,8 @@ Route::group(
);
Route::group(
- ['middleware' => ['auth:api', 'bindings'], 'namespace' => 'FireflyIII\Api\V1\Controllers', 'prefix' => 'bills', 'as' => 'api.v1.bills.'], static function () {
+ ['namespace' => 'FireflyIII\Api\V1\Controllers', 'prefix' => 'bills',
+ 'as' => 'api.v1.bills.'], static function () {
// Bills API routes:
Route::get('', ['uses' => 'BillController@index', 'as' => 'index']);
@@ -116,7 +121,8 @@ Route::group(
Route::group(
- ['middleware' => ['auth:api', 'bindings'], 'namespace' => 'FireflyIII\Api\V1\Controllers', 'prefix' => 'budgets/limits', 'as' => 'api.v1.budget_limits.'],
+ ['namespace' => 'FireflyIII\Api\V1\Controllers', 'prefix' => 'budgets/limits',
+ 'as' => 'api.v1.budget_limits.'],
static function () {
// Budget Limit API routes:
@@ -130,7 +136,8 @@ Route::group(
);
Route::group(
- ['middleware' => ['auth:api', 'bindings'], 'namespace' => 'FireflyIII\Api\V1\Controllers', 'prefix' => 'budgets', 'as' => 'api.v1.budgets.'],
+ ['namespace' => 'FireflyIII\Api\V1\Controllers', 'prefix' => 'budgets',
+ 'as' => 'api.v1.budgets.'],
static function () {
// Budget API routes:
@@ -146,7 +153,8 @@ Route::group(
);
Route::group(
- ['middleware' => ['auth:api', 'bindings'], 'namespace' => 'FireflyIII\Api\V1\Controllers', 'prefix' => 'categories', 'as' => 'api.v1.categories.'],
+ ['namespace' => 'FireflyIII\Api\V1\Controllers', 'prefix' => 'categories',
+ 'as' => 'api.v1.categories.'],
static function () {
// Category API routes:
@@ -165,7 +173,7 @@ Route::group(
// Accounts
Route::group(
- ['middleware' => ['auth:api', 'bindings'], 'namespace' => 'FireflyIII\Api\V1\Controllers\Chart', 'prefix' => 'chart/account',
+ ['namespace' => 'FireflyIII\Api\V1\Controllers\Chart', 'prefix' => 'chart/account',
'as' => 'api.v1.chart.account.'],
static function () {
Route::get('overview', ['uses' => 'AccountController@overview', 'as' => 'overview']);
@@ -177,7 +185,7 @@ Route::group(
// Available budgets
Route::group(
- ['middleware' => ['auth:api', 'bindings'], 'namespace' => 'FireflyIII\Api\V1\Controllers\Chart', 'prefix' => 'chart/ab',
+ ['namespace' => 'FireflyIII\Api\V1\Controllers\Chart', 'prefix' => 'chart/ab',
'as' => 'api.v1.chart.ab.'],
static function () {
@@ -188,7 +196,7 @@ Route::group(
// Categories
Route::group(
- ['middleware' => ['auth:api', 'bindings'], 'namespace' => 'FireflyIII\Api\V1\Controllers\Chart', 'prefix' => 'chart/category',
+ ['namespace' => 'FireflyIII\Api\V1\Controllers\Chart', 'prefix' => 'chart/category',
'as' => 'api.v1.chart.category.'],
static function () {
@@ -202,7 +210,8 @@ Route::group(
Route::group(
- ['middleware' => ['auth:api', 'bindings'], 'namespace' => 'FireflyIII\Api\V1\Controllers', 'prefix' => 'configuration', 'as' => 'api.v1.configuration.'],
+ ['namespace' => 'FireflyIII\Api\V1\Controllers', 'prefix' => 'configuration',
+ 'as' => 'api.v1.configuration.'],
static function () {
// Configuration API routes:
@@ -212,7 +221,8 @@ Route::group(
);
Route::group(
- ['middleware' => ['auth:api', 'bindings'], 'namespace' => 'FireflyIII\Api\V1\Controllers', 'prefix' => 'cer', 'as' => 'api.v1.cer.'],
+ ['namespace' => 'FireflyIII\Api\V1\Controllers', 'prefix' => 'cer',
+ 'as' => 'api.v1.cer.'],
static function () {
// Currency Exchange Rate API routes:
@@ -221,7 +231,8 @@ Route::group(
);
Route::group(
- ['middleware' => ['auth:api', 'bindings'], 'namespace' => 'FireflyIII\Api\V1\Controllers', 'prefix' => 'import', 'as' => 'api.v1.import.'],
+ ['namespace' => 'FireflyIII\Api\V1\Controllers', 'prefix' => 'import',
+ 'as' => 'api.v1.import.'],
static function () {
// Transaction Links API routes:
@@ -231,7 +242,8 @@ Route::group(
}
);
Route::group(
- ['middleware' => ['auth:api', 'bindings'], 'namespace' => 'FireflyIII\Api\V1\Controllers', 'prefix' => 'link_types', 'as' => 'api.v1.link_types.'],
+ ['namespace' => 'FireflyIII\Api\V1\Controllers', 'prefix' => 'link_types',
+ 'as' => 'api.v1.link_types.'],
static function () {
// Link Type API routes:
@@ -245,7 +257,7 @@ Route::group(
);
Route::group(
- ['middleware' => ['auth:api', 'bindings'], 'namespace' => 'FireflyIII\Api\V1\Controllers', 'prefix' => 'transaction_links',
+ ['namespace' => 'FireflyIII\Api\V1\Controllers', 'prefix' => 'transaction_links',
'as' => 'api.v1.transaction_links.'],
static function () {
@@ -260,7 +272,8 @@ Route::group(
);
Route::group(
- ['middleware' => ['auth:api', 'bindings'], 'namespace' => 'FireflyIII\Api\V1\Controllers', 'prefix' => 'piggy_banks', 'as' => 'api.v1.piggy_banks.'],
+ ['namespace' => 'FireflyIII\Api\V1\Controllers', 'prefix' => 'piggy_banks',
+ 'as' => 'api.v1.piggy_banks.'],
static function () {
// Piggy Bank API routes:
@@ -274,7 +287,8 @@ Route::group(
);
Route::group(
- ['middleware' => ['auth:api', 'bindings'], 'namespace' => 'FireflyIII\Api\V1\Controllers', 'prefix' => 'preferences', 'as' => 'api.v1.preferences.'],
+ ['namespace' => 'FireflyIII\Api\V1\Controllers', 'prefix' => 'preferences',
+ 'as' => 'api.v1.preferences.'],
static function () {
// Preference API routes:
@@ -285,7 +299,8 @@ Route::group(
);
Route::group(
- ['middleware' => ['auth:api', 'bindings'], 'namespace' => 'FireflyIII\Api\V1\Controllers', 'prefix' => 'recurrences', 'as' => 'api.v1.recurrences.'],
+ ['namespace' => 'FireflyIII\Api\V1\Controllers', 'prefix' => 'recurrences',
+ 'as' => 'api.v1.recurrences.'],
static function () {
// Recurrence API routes:
@@ -300,7 +315,8 @@ Route::group(
);
Route::group(
- ['middleware' => ['auth:api', 'bindings'], 'namespace' => 'FireflyIII\Api\V1\Controllers', 'prefix' => 'rules', 'as' => 'api.v1.rules.'],
+ ['namespace' => 'FireflyIII\Api\V1\Controllers', 'prefix' => 'rules',
+ 'as' => 'api.v1.rules.'],
static function () {
// Rules API routes:
@@ -317,7 +333,8 @@ Route::group(
);
Route::group(
- ['middleware' => ['auth:api', 'bindings'], 'namespace' => 'FireflyIII\Api\V1\Controllers', 'prefix' => 'rule_groups', 'as' => 'api.v1.rule_groups.'],
+ ['namespace' => 'FireflyIII\Api\V1\Controllers', 'prefix' => 'rule_groups',
+ 'as' => 'api.v1.rule_groups.'],
static function () {
// Rules API routes:
@@ -336,7 +353,7 @@ Route::group(
);
Route::group(
- ['middleware' => ['auth:api', 'bindings'], 'namespace' => 'FireflyIII\Api\V1\Controllers', 'prefix' => 'summary',
+ ['namespace' => 'FireflyIII\Api\V1\Controllers', 'prefix' => 'summary',
'as' => 'api.v1.summary.'],
static function () {
@@ -347,7 +364,8 @@ Route::group(
);
Route::group(
- ['middleware' => ['auth:api', 'bindings'], 'namespace' => 'FireflyIII\Api\V1\Controllers', 'prefix' => 'currencies', 'as' => 'api.v1.currencies.'],
+ ['namespace' => 'FireflyIII\Api\V1\Controllers', 'prefix' => 'currencies',
+ 'as' => 'api.v1.currencies.'],
static function () {
// Transaction currency API routes:
@@ -373,7 +391,8 @@ Route::group(
);
Route::group(
- ['middleware' => ['auth:api', 'bindings'], 'namespace' => 'FireflyIII\Api\V1\Controllers', 'prefix' => 'tags', 'as' => 'api.v1.tags.'],
+ ['namespace' => 'FireflyIII\Api\V1\Controllers', 'prefix' => 'tags',
+ 'as' => 'api.v1.tags.'],
static function () {
// Tag API routes:
Route::get('', ['uses' => 'TagController@index', 'as' => 'index']);
@@ -386,7 +405,8 @@ Route::group(
);
Route::group(
- ['middleware' => ['auth:api', 'bindings'], 'namespace' => 'FireflyIII\Api\V1\Controllers', 'prefix' => 'tag-cloud', 'as' => 'api.v1.tag-cloud.'],
+ ['namespace' => 'FireflyIII\Api\V1\Controllers', 'prefix' => 'tag-cloud',
+ 'as' => 'api.v1.tag-cloud.'],
static function () {
// Tag cloud API routes (to prevent collisions)
Route::get('', ['uses' => 'TagController@cloud', 'as' => 'cloud']);
@@ -395,7 +415,8 @@ Route::group(
Route::group(
- ['middleware' => ['auth:api', 'bindings'], 'namespace' => 'FireflyIII\Api\V1\Controllers', 'prefix' => 'transactions', 'as' => 'api.v1.transactions.'],
+ ['namespace' => 'FireflyIII\Api\V1\Controllers', 'prefix' => 'transactions',
+ 'as' => 'api.v1.transactions.'],
static function () {
// Transaction API routes:
diff --git a/routes/web.php b/routes/web.php
index 174d7fb86d..624b4520e6 100644
--- a/routes/web.php
+++ b/routes/web.php
@@ -701,6 +701,16 @@ Route::group(
}
);
+/**
+ * Report Data Bill Controller
+ */
+Route::group(
+ ['middleware' => 'user-full-auth', 'namespace' => 'FireflyIII\Http\Controllers\Report', 'prefix' => 'report-data/bill', 'as' => 'report-data.bills.'],
+ static function () {
+ Route::get('overview/{accountList}/{start_date}/{end_date}', ['uses' => 'BillController@overview', 'as' => 'overview']);
+ }
+);
+
/**
* Report Data Expense / Revenue Account Controller
*/
diff --git a/tests/Api/V1/Controllers/Chart/AccountControllerTest.php b/tests/Api/V1/Controllers/Chart/AccountControllerTest.php
index ab7c178551..993c99d907 100644
--- a/tests/Api/V1/Controllers/Chart/AccountControllerTest.php
+++ b/tests/Api/V1/Controllers/Chart/AccountControllerTest.php
@@ -1,4 +1,5 @@
assertStatus(200);
}
-}
\ No newline at end of file
+}
diff --git a/tests/Api/V1/Controllers/Chart/CategoryControllerTest.php b/tests/Api/V1/Controllers/Chart/CategoryControllerTest.php
index 8496c1ed31..07418b3bb0 100644
--- a/tests/Api/V1/Controllers/Chart/CategoryControllerTest.php
+++ b/tests/Api/V1/Controllers/Chart/CategoryControllerTest.php
@@ -1,4 +1,5 @@
assertStatus(200);
}
-}
\ No newline at end of file
+}
diff --git a/tests/Api/V1/Controllers/RecurrenceControllerTest.php b/tests/Api/V1/Controllers/RecurrenceControllerTest.php
index 064b7b5850..8ad80b3fa2 100644
--- a/tests/Api/V1/Controllers/RecurrenceControllerTest.php
+++ b/tests/Api/V1/Controllers/RecurrenceControllerTest.php
@@ -38,6 +38,7 @@ use Tests\TestCase;
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
+ * @SuppressWarnings(PHPMD.ExcessiveClassLength)
*/
class RecurrenceControllerTest extends TestCase
{
diff --git a/tests/Api/V1/Controllers/SummaryControllerTest.php b/tests/Api/V1/Controllers/SummaryControllerTest.php
index 0131ab5b3d..4d59076eab 100644
--- a/tests/Api/V1/Controllers/SummaryControllerTest.php
+++ b/tests/Api/V1/Controllers/SummaryControllerTest.php
@@ -1,4 +1,5 @@
assertStatus(200);
// TODO AFTER 4.8,0: check if JSON is correct
}
-}
\ No newline at end of file
+}
diff --git a/tests/CreatesApplication.php b/tests/CreatesApplication.php
index a463ed26b2..93695f63fb 100644
--- a/tests/CreatesApplication.php
+++ b/tests/CreatesApplication.php
@@ -27,6 +27,9 @@ use Illuminate\Contracts\Console\Kernel;
/**
* Trait CreatesApplication
*
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
trait CreatesApplication
{
diff --git a/tests/Feature/Controllers/Account/CreateControllerTest.php b/tests/Feature/Controllers/Account/CreateControllerTest.php
index 317227a041..dc1ab0692c 100644
--- a/tests/Feature/Controllers/Account/CreateControllerTest.php
+++ b/tests/Feature/Controllers/Account/CreateControllerTest.php
@@ -39,8 +39,9 @@ use Tests\TestCase;
*
* Class CreateControllerTest.
*
- * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class CreateControllerTest extends TestCase
{
diff --git a/tests/Feature/Controllers/Account/DeleteControllerTest.php b/tests/Feature/Controllers/Account/DeleteControllerTest.php
index d4b5a4c4e4..eb65fd05e6 100644
--- a/tests/Feature/Controllers/Account/DeleteControllerTest.php
+++ b/tests/Feature/Controllers/Account/DeleteControllerTest.php
@@ -38,8 +38,9 @@ use Tests\TestCase;
*
* Class DeleteControllerTest
*
- * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class DeleteControllerTest extends TestCase
{
diff --git a/tests/Feature/Controllers/Account/EditControllerTest.php b/tests/Feature/Controllers/Account/EditControllerTest.php
index 1725c4414c..600dfb7277 100644
--- a/tests/Feature/Controllers/Account/EditControllerTest.php
+++ b/tests/Feature/Controllers/Account/EditControllerTest.php
@@ -38,8 +38,9 @@ use Tests\TestCase;
*
* Class EditControllerTest
*
- * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class EditControllerTest extends TestCase
{
diff --git a/tests/Feature/Controllers/Account/IndexControllerTest.php b/tests/Feature/Controllers/Account/IndexControllerTest.php
index 6e608e72ae..c3444bd689 100644
--- a/tests/Feature/Controllers/Account/IndexControllerTest.php
+++ b/tests/Feature/Controllers/Account/IndexControllerTest.php
@@ -38,8 +38,9 @@ use Tests\TestCase;
/**
* Class IndexControllerTest
*
- * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class IndexControllerTest extends TestCase
{
diff --git a/tests/Feature/Controllers/Account/ReconcileControllerTest.php b/tests/Feature/Controllers/Account/ReconcileControllerTest.php
index 7808bb05d5..9a21c0c2b8 100644
--- a/tests/Feature/Controllers/Account/ReconcileControllerTest.php
+++ b/tests/Feature/Controllers/Account/ReconcileControllerTest.php
@@ -39,9 +39,10 @@ use Tests\TestCase;
/**
* Class ConfigurationControllerTest
- * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
- * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class ReconcileControllerTest extends TestCase
{
diff --git a/tests/Feature/Controllers/Account/ShowControllerTest.php b/tests/Feature/Controllers/Account/ShowControllerTest.php
index b3f1b5dd99..d5c401f1f4 100644
--- a/tests/Feature/Controllers/Account/ShowControllerTest.php
+++ b/tests/Feature/Controllers/Account/ShowControllerTest.php
@@ -42,8 +42,9 @@ use Tests\TestCase;
*
* Class ShowControllerTest
*
- * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class ShowControllerTest extends TestCase
{
diff --git a/tests/Feature/Controllers/Admin/ConfigurationControllerTest.php b/tests/Feature/Controllers/Admin/ConfigurationControllerTest.php
index bc863e633a..b8e615d112 100644
--- a/tests/Feature/Controllers/Admin/ConfigurationControllerTest.php
+++ b/tests/Feature/Controllers/Admin/ConfigurationControllerTest.php
@@ -32,6 +32,10 @@ use Tests\TestCase;
/**
* Class ConfigurationControllerTest
+ *
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class ConfigurationControllerTest extends TestCase
{
diff --git a/tests/Feature/Controllers/Admin/HomeControllerTest.php b/tests/Feature/Controllers/Admin/HomeControllerTest.php
index e590841992..976c1d29e9 100644
--- a/tests/Feature/Controllers/Admin/HomeControllerTest.php
+++ b/tests/Feature/Controllers/Admin/HomeControllerTest.php
@@ -31,6 +31,10 @@ use Tests\TestCase;
/**
* Class HomeControllerTest
+ *
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class HomeControllerTest extends TestCase
{
diff --git a/tests/Feature/Controllers/Admin/UpdateControllerTest.php b/tests/Feature/Controllers/Admin/UpdateControllerTest.php
index dbb3df9a8f..659da6c936 100644
--- a/tests/Feature/Controllers/Admin/UpdateControllerTest.php
+++ b/tests/Feature/Controllers/Admin/UpdateControllerTest.php
@@ -35,6 +35,10 @@ use Tests\TestCase;
/**
* Class UpdateControllerTest
+ *
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class UpdateControllerTest extends TestCase
{
diff --git a/tests/Feature/Controllers/Admin/UserControllerTest.php b/tests/Feature/Controllers/Admin/UserControllerTest.php
index abfdd737e1..57eabb51a8 100644
--- a/tests/Feature/Controllers/Admin/UserControllerTest.php
+++ b/tests/Feature/Controllers/Admin/UserControllerTest.php
@@ -31,6 +31,9 @@ use Tests\TestCase;
/**
* Class UserControllerTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class UserControllerTest extends TestCase
{
diff --git a/tests/Feature/Controllers/Auth/TwoFactorControllerTest.php b/tests/Feature/Controllers/Auth/TwoFactorControllerTest.php
index ac633b01ea..956128ca36 100644
--- a/tests/Feature/Controllers/Auth/TwoFactorControllerTest.php
+++ b/tests/Feature/Controllers/Auth/TwoFactorControllerTest.php
@@ -30,6 +30,9 @@ use Tests\TestCase;
/**
* Class TwoFactorControllerTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class TwoFactorControllerTest extends TestCase
{
diff --git a/tests/Feature/Controllers/Budget/AmountControllerTest.php b/tests/Feature/Controllers/Budget/AmountControllerTest.php
index 671b5930f5..649310ddd7 100644
--- a/tests/Feature/Controllers/Budget/AmountControllerTest.php
+++ b/tests/Feature/Controllers/Budget/AmountControllerTest.php
@@ -36,6 +36,9 @@ use Tests\TestCase;
/**
*
* Class AmountControllerTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class AmountControllerTest extends TestCase
{
diff --git a/tests/Feature/Controllers/Budget/CreateControllerTest.php b/tests/Feature/Controllers/Budget/CreateControllerTest.php
index d4753f2b2c..72176fd05b 100644
--- a/tests/Feature/Controllers/Budget/CreateControllerTest.php
+++ b/tests/Feature/Controllers/Budget/CreateControllerTest.php
@@ -34,6 +34,9 @@ use Tests\TestCase;
/**
*
* Class CreateControllerTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class CreateControllerTest extends TestCase
{
diff --git a/tests/Feature/Controllers/Budget/DeleteControllerTest.php b/tests/Feature/Controllers/Budget/DeleteControllerTest.php
index 08fa1dd524..6eb6c55b40 100644
--- a/tests/Feature/Controllers/Budget/DeleteControllerTest.php
+++ b/tests/Feature/Controllers/Budget/DeleteControllerTest.php
@@ -33,6 +33,9 @@ use Tests\TestCase;
/**
*
* Class DeleteControllerTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class DeleteControllerTest extends TestCase
{
diff --git a/tests/Feature/Controllers/Budget/EditControllerTest.php b/tests/Feature/Controllers/Budget/EditControllerTest.php
index 60082c81e5..cc17c668ec 100644
--- a/tests/Feature/Controllers/Budget/EditControllerTest.php
+++ b/tests/Feature/Controllers/Budget/EditControllerTest.php
@@ -33,6 +33,9 @@ use Tests\TestCase;
/**
*
* Class EditControllerTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class EditControllerTest extends TestCase
{
diff --git a/tests/Feature/Controllers/Category/CreateControllerTest.php b/tests/Feature/Controllers/Category/CreateControllerTest.php
index 5539ccbb9f..10663f0fb4 100644
--- a/tests/Feature/Controllers/Category/CreateControllerTest.php
+++ b/tests/Feature/Controllers/Category/CreateControllerTest.php
@@ -1,4 +1,5 @@
assertStatus(302);
$response->assertSessionHas('success');
}
-}
\ No newline at end of file
+}
diff --git a/tests/Feature/Controllers/Category/DeleteControllerTest.php b/tests/Feature/Controllers/Category/DeleteControllerTest.php
index 55ef0ab04f..39b4b735ee 100644
--- a/tests/Feature/Controllers/Category/DeleteControllerTest.php
+++ b/tests/Feature/Controllers/Category/DeleteControllerTest.php
@@ -1,4 +1,5 @@
assertStatus(302);
$response->assertSessionHas('success');
}
-}
\ No newline at end of file
+}
diff --git a/tests/Feature/Controllers/Category/EditControllerTest.php b/tests/Feature/Controllers/Category/EditControllerTest.php
index f45c813d18..5504b640ee 100644
--- a/tests/Feature/Controllers/Category/EditControllerTest.php
+++ b/tests/Feature/Controllers/Category/EditControllerTest.php
@@ -1,4 +1,5 @@
assertStatus(302);
$response->assertSessionHas('success');
}
-}
\ No newline at end of file
+}
diff --git a/tests/Feature/Controllers/Category/IndexControllerTest.php b/tests/Feature/Controllers/Category/IndexControllerTest.php
index 9f47e52a24..788022bae3 100644
--- a/tests/Feature/Controllers/Category/IndexControllerTest.php
+++ b/tests/Feature/Controllers/Category/IndexControllerTest.php
@@ -1,4 +1,5 @@
assertSee('');
}
-}
\ No newline at end of file
+}
diff --git a/tests/Feature/Controllers/Chart/BillControllerTest.php b/tests/Feature/Controllers/Chart/BillControllerTest.php
index a92373c3cb..5666849571 100644
--- a/tests/Feature/Controllers/Chart/BillControllerTest.php
+++ b/tests/Feature/Controllers/Chart/BillControllerTest.php
@@ -33,6 +33,9 @@ use Tests\TestCase;
/**
* Class BillControllerTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class BillControllerTest extends TestCase
{
diff --git a/tests/Feature/Controllers/Chart/BudgetControllerTest.php b/tests/Feature/Controllers/Chart/BudgetControllerTest.php
index 568def1fcd..3125ba94bc 100644
--- a/tests/Feature/Controllers/Chart/BudgetControllerTest.php
+++ b/tests/Feature/Controllers/Chart/BudgetControllerTest.php
@@ -39,6 +39,9 @@ use Tests\TestCase;
/**
* Class BudgetControllerTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class BudgetControllerTest extends TestCase
{
diff --git a/tests/Feature/Controllers/Chart/BudgetReportControllerTest.php b/tests/Feature/Controllers/Chart/BudgetReportControllerTest.php
index fa375a3001..127c7c4d7f 100644
--- a/tests/Feature/Controllers/Chart/BudgetReportControllerTest.php
+++ b/tests/Feature/Controllers/Chart/BudgetReportControllerTest.php
@@ -38,6 +38,9 @@ use Tests\TestCase;
/**
* Class BudgetReportControllerTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class BudgetReportControllerTest extends TestCase
{
diff --git a/tests/Feature/Controllers/Chart/CategoryControllerTest.php b/tests/Feature/Controllers/Chart/CategoryControllerTest.php
index cdca2234ac..c37093ef87 100644
--- a/tests/Feature/Controllers/Chart/CategoryControllerTest.php
+++ b/tests/Feature/Controllers/Chart/CategoryControllerTest.php
@@ -60,6 +60,7 @@ class CategoryControllerTest extends TestCase
*
* @param string $range
* @throws FireflyException
+ * @SuppressWarnings(PHPMD.CyclomaticComplexity)
*/
public function testAll(string $range): void
{
@@ -97,10 +98,10 @@ class CategoryControllerTest extends TestCase
$this->mockDefaultSession();
Preferences::shouldReceive('lastActivity')->atLeast()->once()->andReturn('md512345');
- $repository->shouldReceive('spentInPeriod')->andReturn('0')->atLeast()->once();
- $repository->shouldReceive('earnedInPeriod')->andReturn('0')->atLeast()->once();
+ $repository->shouldReceive('spentInPeriod')->andReturn([])->atLeast()->once();
+ $repository->shouldReceive('earnedInPeriod')->andReturn([])->atLeast()->once();
$repository->shouldReceive('firstUseDate')->andReturn($firstUseDate)->once();
- $accountRepos->shouldReceive('getAccountsByType')->withArgs([[AccountType::DEFAULT, AccountType::ASSET]])->andReturn(new Collection)->once();
+ $accountRepos->shouldReceive('getAccountsByType')->withArgs([[AccountType::DEFAULT, AccountType::ASSET, AccountType::LOAN, AccountType::DEBT,AccountType::MORTGAGE]])->andReturn(new Collection)->once();
$generator->shouldReceive('multiSet')->once()->andReturn([]);
$this->be($this->user());
@@ -244,8 +245,8 @@ class CategoryControllerTest extends TestCase
$fiscalHelper->shouldReceive('startOfFiscalYear')->atLeast()->once()->andReturn($date);
$accountRepos->shouldReceive('getAccountsByType')->andReturn(new Collection([$account]));
- $repository->shouldReceive('spentInPeriod')->andReturn('0');
- $repository->shouldReceive('earnedInPeriod')->andReturn('0');
+ $repository->shouldReceive('spentInPeriod')->andReturn([]);
+ $repository->shouldReceive('earnedInPeriod')->andReturn([]);
$generator->shouldReceive('multiSet')->andReturn([])->once();
$this->be($this->user());
diff --git a/tests/Feature/Controllers/Chart/CategoryReportControllerTest.php b/tests/Feature/Controllers/Chart/CategoryReportControllerTest.php
index 92cb518b54..328f843a5d 100644
--- a/tests/Feature/Controllers/Chart/CategoryReportControllerTest.php
+++ b/tests/Feature/Controllers/Chart/CategoryReportControllerTest.php
@@ -35,6 +35,9 @@ use Tests\TestCase;
/**
* Class CategoryReportControllerTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class CategoryReportControllerTest extends TestCase
{
diff --git a/tests/Feature/Controllers/Chart/ExpenseReportControllerTest.php b/tests/Feature/Controllers/Chart/ExpenseReportControllerTest.php
index eb31db4d29..5f0859266b 100644
--- a/tests/Feature/Controllers/Chart/ExpenseReportControllerTest.php
+++ b/tests/Feature/Controllers/Chart/ExpenseReportControllerTest.php
@@ -34,6 +34,9 @@ use Tests\TestCase;
/**
* Class ExpenseReportControllerTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class ExpenseReportControllerTest extends TestCase
{
diff --git a/tests/Feature/Controllers/Chart/PiggyBankControllerTest.php b/tests/Feature/Controllers/Chart/PiggyBankControllerTest.php
index 4eeb80bf0e..cdeeea4a9e 100644
--- a/tests/Feature/Controllers/Chart/PiggyBankControllerTest.php
+++ b/tests/Feature/Controllers/Chart/PiggyBankControllerTest.php
@@ -32,6 +32,9 @@ use Tests\TestCase;
/**
* Class PiggyBankControllerTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class PiggyBankControllerTest extends TestCase
{
diff --git a/tests/Feature/Controllers/Chart/ReportControllerTest.php b/tests/Feature/Controllers/Chart/ReportControllerTest.php
index 1b555df8dd..cadb24e0e6 100644
--- a/tests/Feature/Controllers/Chart/ReportControllerTest.php
+++ b/tests/Feature/Controllers/Chart/ReportControllerTest.php
@@ -26,7 +26,6 @@ use Carbon\Carbon;
use FireflyIII\Generator\Chart\Basic\GeneratorInterface;
use FireflyIII\Helpers\Fiscal\FiscalHelperInterface;
use FireflyIII\Helpers\Report\NetWorthInterface;
-use FireflyIII\Models\TransactionCurrency;
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
use FireflyIII\Repositories\Account\AccountTaskerInterface;
use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface;
@@ -38,6 +37,9 @@ use Tests\TestCase;
/**
* Class ReportControllerTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class ReportControllerTest extends TestCase
{
@@ -113,8 +115,12 @@ class ReportControllerTest extends TestCase
$fiscalHelper->shouldReceive('endOfFiscalYear')->atLeast()->once()->andReturn($date);
$fiscalHelper->shouldReceive('startOfFiscalYear')->atLeast()->once()->andReturn($date);
- $income = [1 => ['sum' => '100']];
- $expense = [2 => ['sum' => '-100']];
+ $income = [
+ 'accounts' => [
+ 1 => ['sum' => '100']]];
+ $expense = [
+ 'accounts' => [
+ 2 => ['sum' => '-100']]];
$tasker->shouldReceive('getIncomeReport')->once()->andReturn($income);
$tasker->shouldReceive('getExpenseReport')->once()->andReturn($expense);
$generator->shouldReceive('multiSet')->andReturn([]);
@@ -141,8 +147,12 @@ class ReportControllerTest extends TestCase
$fiscalHelper->shouldReceive('endOfFiscalYear')->atLeast()->once()->andReturn($date);
$fiscalHelper->shouldReceive('startOfFiscalYear')->atLeast()->once()->andReturn($date);
- $income = [];
- $expense = [];
+ $income = [
+ 'accounts' => [
+ 1 => ['sum' => '100']]];
+ $expense = [
+ 'accounts' => [
+ 2 => ['sum' => '-100']]];
$tasker->shouldReceive('getIncomeReport')->andReturn($income)->times(1);
$tasker->shouldReceive('getExpenseReport')->andReturn($expense)->times(1);
diff --git a/tests/Feature/Controllers/Chart/TagReportControllerTest.php b/tests/Feature/Controllers/Chart/TagReportControllerTest.php
index 45cf7fa7bb..dda96f8431 100644
--- a/tests/Feature/Controllers/Chart/TagReportControllerTest.php
+++ b/tests/Feature/Controllers/Chart/TagReportControllerTest.php
@@ -38,6 +38,9 @@ use Tests\TestCase;
/**
* Class TagReportControllerTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class TagReportControllerTest extends TestCase
{
diff --git a/tests/Feature/Controllers/Import/CallbackControllerTest.php b/tests/Feature/Controllers/Import/CallbackControllerTest.php
index dbb09ebdd8..26abf0db4d 100644
--- a/tests/Feature/Controllers/Import/CallbackControllerTest.php
+++ b/tests/Feature/Controllers/Import/CallbackControllerTest.php
@@ -33,6 +33,9 @@ use Tests\TestCase;
/**
*
* Class CallbackControllerTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class CallbackControllerTest extends TestCase
{
diff --git a/tests/Feature/Controllers/Import/JobConfigurationControllerTest.php b/tests/Feature/Controllers/Import/JobConfigurationControllerTest.php
index 5f8f9f6e00..1c88135913 100644
--- a/tests/Feature/Controllers/Import/JobConfigurationControllerTest.php
+++ b/tests/Feature/Controllers/Import/JobConfigurationControllerTest.php
@@ -35,6 +35,9 @@ use Tests\TestCase;
/**
* Class JobConfigurationControllerTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class JobConfigurationControllerTest extends TestCase
{
diff --git a/tests/Feature/Controllers/Json/AutoCompleteControllerTest.php b/tests/Feature/Controllers/Json/AutoCompleteControllerTest.php
index 320810a307..376201714a 100644
--- a/tests/Feature/Controllers/Json/AutoCompleteControllerTest.php
+++ b/tests/Feature/Controllers/Json/AutoCompleteControllerTest.php
@@ -31,6 +31,9 @@ use Tests\TestCase;
/**
* Class AutoCompleteControllerTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class AutoCompleteControllerTest extends TestCase
{
diff --git a/tests/Feature/Controllers/Json/BoxControllerTest.php b/tests/Feature/Controllers/Json/BoxControllerTest.php
index a4b6ba31b9..ccdb01fa0c 100644
--- a/tests/Feature/Controllers/Json/BoxControllerTest.php
+++ b/tests/Feature/Controllers/Json/BoxControllerTest.php
@@ -39,6 +39,9 @@ use Tests\TestCase;
/**
* Class BoxControllerTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class BoxControllerTest extends TestCase
{
diff --git a/tests/Feature/Controllers/Json/ReconcileControllerTest.php b/tests/Feature/Controllers/Json/ReconcileControllerTest.php
index 0f819d808c..9491f23019 100644
--- a/tests/Feature/Controllers/Json/ReconcileControllerTest.php
+++ b/tests/Feature/Controllers/Json/ReconcileControllerTest.php
@@ -39,6 +39,9 @@ use Tests\TestCase;
/**
*
* Class ReconcileControllerTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class ReconcileControllerTest extends TestCase
{
diff --git a/tests/Feature/Controllers/Json/RecurrenceControllerTest.php b/tests/Feature/Controllers/Json/RecurrenceControllerTest.php
index f20f7976ae..dd634c2864 100644
--- a/tests/Feature/Controllers/Json/RecurrenceControllerTest.php
+++ b/tests/Feature/Controllers/Json/RecurrenceControllerTest.php
@@ -33,6 +33,9 @@ use Tests\TestCase;
/**
*
* Class RecurrenceControllerTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class RecurrenceControllerTest extends TestCase
{
diff --git a/tests/Feature/Controllers/Popup/ReportControllerTest.php b/tests/Feature/Controllers/Popup/ReportControllerTest.php
index a7b5e96688..19ee165daf 100644
--- a/tests/Feature/Controllers/Popup/ReportControllerTest.php
+++ b/tests/Feature/Controllers/Popup/ReportControllerTest.php
@@ -107,119 +107,6 @@ class ReportControllerTest extends TestCase
$response->assertDontSee('Firefly III could not render the view. Please see the log files.');
}
- /**
- * @covers \FireflyIII\Http\Controllers\Popup\ReportController
- */
- public function testBalanceAmountDefaultNoBudget(): void
- {
- $this->mockDefaultSession();
- $this->mock(CategoryRepositoryInterface::class);
- $accountRepos = $this->mock(AccountRepositoryInterface::class);
- $budgetRepos = $this->mock(BudgetRepositoryInterface::class);
- $popupHelper = $this->mock(PopupReportInterface::class);
- $account = $this->getRandomAsset();
-
- $popupHelper->shouldReceive('balanceForNoBudget')->andReturn([]);
- $budgetRepos->shouldReceive('findNull')->andReturn(null)->once()->withArgs([0]);
- $accountRepos->shouldReceive('findNull')->andReturn($account)->once()->withArgs([1]);
- //$popupHelper->shouldReceive('balanceForBudget')->once()->andReturn([]);
-
- Amount::shouldReceive('formatAnything')->andReturn('-100');
-
- $this->be($this->user());
- $arguments = [
- 'attributes' => [
- 'location' => 'balance-amount',
- 'startDate' => Carbon::now()->startOfMonth()->format('Ymd'),
- 'endDate' => Carbon::now()->endOfMonth()->format('Ymd'),
- 'accounts' => 1,
- 'accountId' => 1,
- 'categoryId' => 1,
- 'budgetId' => 0,
- 'role' => 1, // ROLE_DEFAULTROLE
- ],
- ];
- $uri = route('popup.general') . '?' . http_build_query($arguments);
- $response = $this->get($uri);
- $response->assertStatus(200);
- $response->assertSee($account->name);
- $response->assertDontSee('Firefly III could not render the view. Please see the log files.');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Popup\ReportController
- */
- public function testBalanceAmountDefaultRole(): void
- {
- $this->mock(CategoryRepositoryInterface::class);
- $accountRepos = $this->mock(AccountRepositoryInterface::class);
- $budgetRepos = $this->mock(BudgetRepositoryInterface::class);
- $popupHelper = $this->mock(PopupReportInterface::class);
- $account = $this->getRandomAsset();
- $budget = $this->getRandomBudget();
- $this->mockDefaultSession();
-
- Amount::shouldReceive('formatAnything')->andReturn('-100')->atLeast()->once();
-
- $budgetRepos->shouldReceive('findNull')->andReturn($budget)->once()->withArgs([1]);
- $accountRepos->shouldReceive('findNull')->andReturn($account)->once()->withArgs([1]);
- $popupHelper->shouldReceive('balanceForBudget')->once()->andReturn([]);
-
- $this->be($this->user());
- $arguments = [
- 'attributes' => [
- 'location' => 'balance-amount',
- 'startDate' => Carbon::now()->startOfMonth()->format('Ymd'),
- 'endDate' => Carbon::now()->endOfMonth()->format('Ymd'),
- 'accounts' => 1,
- 'accountId' => 1,
- 'categoryId' => 1,
- 'budgetId' => 1,
- 'role' => 1, // ROLE_DEFAULTROLE
- ],
- ];
- $uri = route('popup.general') . '?' . http_build_query($arguments);
- $response = $this->get($uri);
- $response->assertStatus(200);
- $response->assertDontSee('Firefly III could not render the view. Please see the log files.');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Popup\ReportController
- */
- public function testBalanceAmountTagRole(): void
- {
- $categoryRepos = $this->mock(CategoryRepositoryInterface::class);
- $accountRepos = $this->mock(AccountRepositoryInterface::class);
- $budgetRepos = $this->mock(BudgetRepositoryInterface::class);
- $popupReport = $this->mock(PopupReportInterface::class);
- $account = $this->getRandomAsset();
- $budget = $this->getRandomBudget();
-
- $this->mockDefaultSession();
- $budgetRepos->shouldReceive('findNull')->andReturn($budget)->once()->withArgs([1]);
- $accountRepos->shouldReceive('findNull')->andReturn($account)->once()->withArgs([1]);
-
- $this->be($this->user());
- $arguments = [
- 'attributes' => [
- 'location' => 'balance-amount',
- 'startDate' => Carbon::now()->startOfMonth()->format('Ymd'),
- 'endDate' => Carbon::now()->endOfMonth()->format('Ymd'),
- 'accounts' => 1,
- 'accountId' => 1,
- 'categoryId' => 1,
- 'budgetId' => 1,
- 'role' => 2, // ROLE_TAGROLE
- ],
- ];
-
- $uri = route('popup.general') . '?' . http_build_query($arguments);
- $response = $this->get($uri);
- $response->assertStatus(200);
- $response->assertDontSee('Firefly III could not render the view. Please see the log files.');
- }
-
/**
* @covers \FireflyIII\Http\Controllers\Popup\ReportController
*/
@@ -235,7 +122,7 @@ class ReportControllerTest extends TestCase
$budgetRepos->shouldReceive('findNull')->andReturn($budget)->once()->withArgs([1]);
$popupHelper->shouldReceive('byBudget')->andReturn([]);
- Amount::shouldReceive('formatAnything')->andReturn('-100')->atLeast()->once();
+ //Amount::shouldReceive('formatAnything')->andReturn('-100')->atLeast()->once();
$this->be($this->user());
$arguments = [
@@ -245,6 +132,7 @@ class ReportControllerTest extends TestCase
'endDate' => Carbon::now()->endOfMonth()->format('Ymd'),
'accounts' => 1,
'accountId' => 1,
+ 'currencyId' => 1,
'categoryId' => 1,
'budgetId' => 1,
],
@@ -265,7 +153,7 @@ class ReportControllerTest extends TestCase
$budgetRepos = $this->mock(BudgetRepositoryInterface::class);
$popupHelper = $this->mock(PopupReportInterface::class);
- Amount::shouldReceive('formatAnything')->andReturn('-100')->atLeast()->once();
+ //Amount::shouldReceive('formatAnything')->andReturn('-100')->atLeast()->once();
$this->mockDefaultSession();
$budgetRepos->shouldReceive('findNull')->andReturnNull()->once()->withArgs([1]);
@@ -303,7 +191,8 @@ class ReportControllerTest extends TestCase
$this->mockDefaultSession();
$categoryRepos->shouldReceive('findNull')->andReturn($category)->once()->withArgs([1]);
$popupHelper->shouldReceive('byCategory')->andReturn([]);
- Amount::shouldReceive('formatAnything')->andReturn('-100')->atLeast()->once();
+
+ //Amount::shouldReceive('formatAnything')->andReturn('-100')->atLeast()->once();
$this->be($this->user());
$arguments = [
@@ -369,7 +258,7 @@ class ReportControllerTest extends TestCase
$accountRepos = $this->mock(AccountRepositoryInterface::class);
$account = $this->getRandomAsset();
- Amount::shouldReceive('formatAnything')->andReturn('-100')->atLeast()->once();
+ //Amount::shouldReceive('formatAnything')->andReturn('-100')->atLeast()->once();
$this->mockDefaultSession();
$accountRepos->shouldReceive('findNull')->withArgs([1])->andReturn($account)->once();
@@ -443,7 +332,8 @@ class ReportControllerTest extends TestCase
$this->mockDefaultSession();
$accountRepos->shouldReceive('findNull')->withArgs([1])->andReturn($account)->once();
$popupHelper->shouldReceive('byIncome')->andReturn([]);
- Amount::shouldReceive('formatAnything')->andReturn('-100')->atLeast()->once();
+
+ //Amount::shouldReceive('formatAnything')->andReturn('-100')->atLeast()->once();
$this->be($this->user());
$arguments = [
diff --git a/tests/Feature/Controllers/Recurring/CreateControllerTest.php b/tests/Feature/Controllers/Recurring/CreateControllerTest.php
index 34f5f0b1f7..c18f31eb82 100644
--- a/tests/Feature/Controllers/Recurring/CreateControllerTest.php
+++ b/tests/Feature/Controllers/Recurring/CreateControllerTest.php
@@ -44,7 +44,9 @@ use Tests\TestCase;
/**
*
* Class CreateControllerTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class CreateControllerTest extends TestCase
{
diff --git a/tests/Feature/Controllers/Recurring/DeleteControllerTest.php b/tests/Feature/Controllers/Recurring/DeleteControllerTest.php
index 8391ed0dbd..265ebf338c 100644
--- a/tests/Feature/Controllers/Recurring/DeleteControllerTest.php
+++ b/tests/Feature/Controllers/Recurring/DeleteControllerTest.php
@@ -34,6 +34,9 @@ use Tests\TestCase;
/**
*
* Class DeleteControllerTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class DeleteControllerTest extends TestCase
{
diff --git a/tests/Feature/Controllers/Recurring/EditControllerTest.php b/tests/Feature/Controllers/Recurring/EditControllerTest.php
index 1a145570aa..c735cc82cc 100644
--- a/tests/Feature/Controllers/Recurring/EditControllerTest.php
+++ b/tests/Feature/Controllers/Recurring/EditControllerTest.php
@@ -43,6 +43,9 @@ use Tests\TestCase;
/**
*
* Class EditControllerTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class EditControllerTest extends TestCase
{
diff --git a/tests/Feature/Controllers/Recurring/IndexControllerTest.php b/tests/Feature/Controllers/Recurring/IndexControllerTest.php
index 216a0c762a..d09f3fe23e 100644
--- a/tests/Feature/Controllers/Recurring/IndexControllerTest.php
+++ b/tests/Feature/Controllers/Recurring/IndexControllerTest.php
@@ -40,6 +40,9 @@ use Tests\TestCase;
/**
*
* Class IndexControllerTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class IndexControllerTest extends TestCase
{
diff --git a/tests/Feature/Controllers/Report/BalanceControllerTest.php b/tests/Feature/Controllers/Report/BalanceControllerTest.php
index dd1d9f2bae..11f5420c1e 100644
--- a/tests/Feature/Controllers/Report/BalanceControllerTest.php
+++ b/tests/Feature/Controllers/Report/BalanceControllerTest.php
@@ -23,7 +23,6 @@ declare(strict_types=1);
namespace Tests\Feature\Controllers\Report;
use Carbon\Carbon;
-use FireflyIII\Helpers\Collection\Balance;
use FireflyIII\Helpers\Fiscal\FiscalHelperInterface;
use FireflyIII\Helpers\Report\BalanceReportHelperInterface;
use Log;
@@ -62,7 +61,7 @@ class BalanceControllerTest extends TestCase
Preferences::shouldReceive('lastActivity')->atLeast()->once()->andReturn('md512345');
$fiscalHelper->shouldReceive('endOfFiscalYear')->atLeast()->once()->andReturn($date);
$fiscalHelper->shouldReceive('startOfFiscalYear')->atLeast()->once()->andReturn($date);
- $balance->shouldReceive('getBalanceReport')->andReturn(new Balance);
+ $balance->shouldReceive('getBalanceReport')->andReturn([]);
$this->be($this->user());
$response = $this->get(route('report-data.balance.general', ['1', '20120101', '20120131']));
diff --git a/tests/Feature/Controllers/Report/BudgetControllerTest.php b/tests/Feature/Controllers/Report/BudgetControllerTest.php
index ac61d8d548..f14dbe469f 100644
--- a/tests/Feature/Controllers/Report/BudgetControllerTest.php
+++ b/tests/Feature/Controllers/Report/BudgetControllerTest.php
@@ -63,7 +63,7 @@ class BudgetControllerTest extends TestCase
$date = new Carbon;
Preferences::shouldReceive('lastActivity')->atLeast()->once()->andReturn('md512345');
- Amount::shouldReceive('formatAnything')->atLeast()->once()->andReturn('x');
+ //Amount::shouldReceive('formatAnything')->atLeast()->once()->andReturn('x');
$fiscalHelper->shouldReceive('endOfFiscalYear')->atLeast()->once()->andReturn($date);
$fiscalHelper->shouldReceive('startOfFiscalYear')->atLeast()->once()->andReturn($date);
$helper->shouldReceive('getBudgetReport')->andReturn($return);
diff --git a/tests/Feature/Controllers/Report/CategoryControllerTest.php b/tests/Feature/Controllers/Report/CategoryControllerTest.php
index 99c78b0c96..8e88b87cea 100644
--- a/tests/Feature/Controllers/Report/CategoryControllerTest.php
+++ b/tests/Feature/Controllers/Report/CategoryControllerTest.php
@@ -112,11 +112,12 @@ class CategoryControllerTest extends TestCase
$fiscalHelper = $this->mock(FiscalHelperInterface::class);
$date = new Carbon;
Preferences::shouldReceive('lastActivity')->atLeast()->once()->andReturn('md512345');
+ //Amount::shouldReceive('formatAnything')->atLeast()->once()->andReturn('x');
$fiscalHelper->shouldReceive('endOfFiscalYear')->atLeast()->once()->andReturn($date);
$fiscalHelper->shouldReceive('startOfFiscalYear')->atLeast()->once()->andReturn($date);
$repository->shouldReceive('getCategories')->andReturn(new Collection([$category]));
- $repository->shouldReceive('spentInPeriod')->andReturn('-1');
- $repository->shouldReceive('earnedInPeriod')->andReturn('1');
+ $repository->shouldReceive('spentInPeriod')->andReturn([]);
+ $repository->shouldReceive('earnedInPeriod')->andReturn([]);
$this->be($this->user());
diff --git a/tests/Feature/Controllers/Report/OperationsControllerTest.php b/tests/Feature/Controllers/Report/OperationsControllerTest.php
index 3240684fa7..87dd312345 100644
--- a/tests/Feature/Controllers/Report/OperationsControllerTest.php
+++ b/tests/Feature/Controllers/Report/OperationsControllerTest.php
@@ -55,7 +55,7 @@ class OperationsControllerTest extends TestCase
{
$this->mockDefaultSession();
$return = [
- 1 => [
+ 1 => [
'id' => 1,
'name' => 'Some name',
'sum' => '5',
@@ -104,6 +104,7 @@ class OperationsControllerTest extends TestCase
{
$this->mockDefaultSession();
$return = [
+ 'sums' => [],
1 => [
'id' => 1,
'name' => 'Some name',
diff --git a/tests/Feature/Controllers/ReportControllerTest.php b/tests/Feature/Controllers/ReportControllerTest.php
index 6776d7d829..f49f4f9e2e 100644
--- a/tests/Feature/Controllers/ReportControllerTest.php
+++ b/tests/Feature/Controllers/ReportControllerTest.php
@@ -52,6 +52,7 @@ use Tests\TestCase;
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.TooManyMethods)
*/
class ReportControllerTest extends TestCase
{
diff --git a/tests/Feature/Controllers/Rule/CreateControllerTest.php b/tests/Feature/Controllers/Rule/CreateControllerTest.php
index 27ef55128a..f84aaee53e 100644
--- a/tests/Feature/Controllers/Rule/CreateControllerTest.php
+++ b/tests/Feature/Controllers/Rule/CreateControllerTest.php
@@ -36,6 +36,9 @@ use Tests\TestCase;
/**
* Class CreateControllerTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class CreateControllerTest extends TestCase
{
diff --git a/tests/Feature/Controllers/Rule/DeleteControllerTest.php b/tests/Feature/Controllers/Rule/DeleteControllerTest.php
index 6abeb626dd..70fb2edcaa 100644
--- a/tests/Feature/Controllers/Rule/DeleteControllerTest.php
+++ b/tests/Feature/Controllers/Rule/DeleteControllerTest.php
@@ -34,6 +34,9 @@ use Tests\TestCase;
/**
*
* Class DeleteControllerTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class DeleteControllerTest extends TestCase
{
diff --git a/tests/Feature/Controllers/Rule/EditControllerTest.php b/tests/Feature/Controllers/Rule/EditControllerTest.php
index 35d67bb4a6..95e5bc2992 100644
--- a/tests/Feature/Controllers/Rule/EditControllerTest.php
+++ b/tests/Feature/Controllers/Rule/EditControllerTest.php
@@ -36,6 +36,9 @@ use Tests\TestCase;
/**
* Class EditControllerTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class EditControllerTest extends TestCase
{
diff --git a/tests/Feature/Controllers/Rule/SelectControllerTest.php b/tests/Feature/Controllers/Rule/SelectControllerTest.php
index a6a71f3fd6..c802b9dc5e 100644
--- a/tests/Feature/Controllers/Rule/SelectControllerTest.php
+++ b/tests/Feature/Controllers/Rule/SelectControllerTest.php
@@ -39,6 +39,9 @@ use Tests\TestCase;
/**
* Class SelectControllerTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class SelectControllerTest extends TestCase
{
@@ -134,7 +137,7 @@ class SelectControllerTest extends TestCase
$matcher->shouldReceive('setTriggeredLimit')->withArgs([10])->andReturnSelf()->once();
$matcher->shouldReceive('setSearchLimit')->withArgs([200])->andReturnSelf()->once();
$matcher->shouldReceive('setTriggers')->andReturnSelf()->once();
- $matcher->shouldReceive('findTransactionsByTriggers')->andReturn(new Collection);
+ $matcher->shouldReceive('findTransactionsByTriggers')->andReturn([]);
$this->be($this->user());
$uri = route('rules.test-triggers') . '?' . http_build_query($data);
@@ -203,7 +206,7 @@ class SelectControllerTest extends TestCase
$matcher->shouldReceive('setTriggeredLimit')->withArgs([10])->andReturnSelf()->once();
$matcher->shouldReceive('setSearchLimit')->withArgs([200])->andReturnSelf()->once();
$matcher->shouldReceive('setTriggers')->andReturnSelf()->once();
- $matcher->shouldReceive('findTransactionsByTriggers')->andReturn(new Collection);
+ $matcher->shouldReceive('findTransactionsByTriggers')->andReturn([]);
$this->be($this->user());
$uri = route('rules.test-triggers') . '?' . http_build_query($data);
diff --git a/tests/Feature/Controllers/RuleGroup/CreateControllerTest.php b/tests/Feature/Controllers/RuleGroup/CreateControllerTest.php
index fa19bce040..4a87655be8 100644
--- a/tests/Feature/Controllers/RuleGroup/CreateControllerTest.php
+++ b/tests/Feature/Controllers/RuleGroup/CreateControllerTest.php
@@ -1,4 +1,5 @@
assertSessionHas('success');
}
-}
\ No newline at end of file
+}
diff --git a/tests/Feature/Controllers/RuleGroup/DeleteControllerTest.php b/tests/Feature/Controllers/RuleGroup/DeleteControllerTest.php
index 9f6a37bed6..51f5e48d47 100644
--- a/tests/Feature/Controllers/RuleGroup/DeleteControllerTest.php
+++ b/tests/Feature/Controllers/RuleGroup/DeleteControllerTest.php
@@ -1,4 +1,5 @@
assertSessionHas('success');
$response->assertRedirect(route('index'));
}
-}
\ No newline at end of file
+}
diff --git a/tests/Feature/Controllers/RuleGroup/EditControllerTest.php b/tests/Feature/Controllers/RuleGroup/EditControllerTest.php
index 927657d640..8cfe9dd3ba 100644
--- a/tests/Feature/Controllers/RuleGroup/EditControllerTest.php
+++ b/tests/Feature/Controllers/RuleGroup/EditControllerTest.php
@@ -1,4 +1,5 @@
assertStatus(302);
$response->assertSessionHas('success');
}
-}
\ No newline at end of file
+}
diff --git a/tests/Feature/Controllers/RuleGroup/ExecutionControllerTest.php b/tests/Feature/Controllers/RuleGroup/ExecutionControllerTest.php
index 6bcb9a0223..87932454b1 100644
--- a/tests/Feature/Controllers/RuleGroup/ExecutionControllerTest.php
+++ b/tests/Feature/Controllers/RuleGroup/ExecutionControllerTest.php
@@ -1,4 +1,5 @@
assertSee('');
}
-}
\ No newline at end of file
+}
diff --git a/tests/Feature/Controllers/System/CronControllerTest.php b/tests/Feature/Controllers/System/CronControllerTest.php
index 4b4c106b55..1b3a804aab 100644
--- a/tests/Feature/Controllers/System/CronControllerTest.php
+++ b/tests/Feature/Controllers/System/CronControllerTest.php
@@ -36,6 +36,9 @@ use Tests\TestCase;
/**
*
* Class CronControllerTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class CronControllerTest extends TestCase
{
diff --git a/tests/Feature/Controllers/Transaction/CreateControllerTest.php b/tests/Feature/Controllers/Transaction/CreateControllerTest.php
index b785b7b77e..07d514fb6a 100644
--- a/tests/Feature/Controllers/Transaction/CreateControllerTest.php
+++ b/tests/Feature/Controllers/Transaction/CreateControllerTest.php
@@ -1,4 +1,5 @@
get(route('transactions.create', ['withdrawal']));
$response->assertStatus(200);
}
-}
\ No newline at end of file
+}
diff --git a/tests/Feature/Controllers/Transaction/EditControllerTest.php b/tests/Feature/Controllers/Transaction/EditControllerTest.php
index 46460247e7..ba9f55ee36 100644
--- a/tests/Feature/Controllers/Transaction/EditControllerTest.php
+++ b/tests/Feature/Controllers/Transaction/EditControllerTest.php
@@ -1,4 +1,5 @@
get(route('transactions.edit', [$group->id]));
$response->assertStatus(200);
}
-}
\ No newline at end of file
+}
diff --git a/tests/Feature/Controllers/Transaction/IndexControllerTest.php b/tests/Feature/Controllers/Transaction/IndexControllerTest.php
index 4ecbe745a2..223cfe1817 100644
--- a/tests/Feature/Controllers/Transaction/IndexControllerTest.php
+++ b/tests/Feature/Controllers/Transaction/IndexControllerTest.php
@@ -1,4 +1,5 @@
assertStatus(200);
}
-}
\ No newline at end of file
+}
diff --git a/tests/Feature/Controllers/Transaction/LinkControllerTest.php b/tests/Feature/Controllers/Transaction/LinkControllerTest.php
index e6d37a859d..0e52b12157 100644
--- a/tests/Feature/Controllers/Transaction/LinkControllerTest.php
+++ b/tests/Feature/Controllers/Transaction/LinkControllerTest.php
@@ -35,6 +35,9 @@ use Tests\TestCase;
/**
* Class LinkControllerTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class LinkControllerTest extends TestCase
{
diff --git a/tests/Feature/Controllers/Transaction/ShowControllerTest.php b/tests/Feature/Controllers/Transaction/ShowControllerTest.php
index 00d6a28c25..f47ec8d902 100644
--- a/tests/Feature/Controllers/Transaction/ShowControllerTest.php
+++ b/tests/Feature/Controllers/Transaction/ShowControllerTest.php
@@ -1,4 +1,5 @@
assertSee('');
}
-}
\ No newline at end of file
+}
diff --git a/tests/Feature/ExampleTest.php b/tests/Feature/ExampleTest.php
index 0088f7e6f4..2e48da3817 100644
--- a/tests/Feature/ExampleTest.php
+++ b/tests/Feature/ExampleTest.php
@@ -26,6 +26,9 @@ use Tests\TestCase;
/**
* Class ExampleTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class ExampleTest extends TestCase
{
diff --git a/tests/Object/FakeApiContext.php b/tests/Object/FakeApiContext.php
index a929bbac42..d93cc522f9 100644
--- a/tests/Object/FakeApiContext.php
+++ b/tests/Object/FakeApiContext.php
@@ -25,6 +25,9 @@ namespace Tests\Object;
/**
* Class FakeApiContext
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class FakeApiContext
{
diff --git a/tests/TestCase.php b/tests/TestCase.php
index 821928f173..600d3a7791 100644
--- a/tests/TestCase.php
+++ b/tests/TestCase.php
@@ -64,6 +64,10 @@ use RuntimeException;
* Class TestCase
*
* @SuppressWarnings(PHPMD.NumberOfChildren)
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
+ * @SuppressWarnings(PHPMD.ExcessiveClassComplexity)
*/
abstract class TestCase extends BaseTestCase
{
diff --git a/tests/Unit/Console/Commands/Correction/CreateAccessTokensTest.php b/tests/Unit/Console/Commands/Correction/CreateAccessTokensTest.php
index 384b22c175..fa8952da3b 100644
--- a/tests/Unit/Console/Commands/Correction/CreateAccessTokensTest.php
+++ b/tests/Unit/Console/Commands/Correction/CreateAccessTokensTest.php
@@ -1,4 +1,5 @@
expectsOutput('All access tokens OK!')
->assertExitCode(0);
}
-}
\ No newline at end of file
+}
diff --git a/tests/Unit/Console/Commands/Correction/CreateLinkTypesTest.php b/tests/Unit/Console/Commands/Correction/CreateLinkTypesTest.php
index db04b21796..3e3130ed76 100644
--- a/tests/Unit/Console/Commands/Correction/CreateLinkTypesTest.php
+++ b/tests/Unit/Console/Commands/Correction/CreateLinkTypesTest.php
@@ -1,4 +1,5 @@
assertCount(4, LinkType::get());
}
-}
\ No newline at end of file
+}
diff --git a/tests/Unit/Console/Commands/Correction/DeleteEmptyGroupsTest.php b/tests/Unit/Console/Commands/Correction/DeleteEmptyGroupsTest.php
index 4d07dc7078..3749ee1350 100644
--- a/tests/Unit/Console/Commands/Correction/DeleteEmptyGroupsTest.php
+++ b/tests/Unit/Console/Commands/Correction/DeleteEmptyGroupsTest.php
@@ -1,4 +1,5 @@
assertCount(0, TransactionGroup::where('id', $group->id)->whereNull('deleted_at')->get());
}
-}
\ No newline at end of file
+}
diff --git a/tests/Unit/Console/Commands/Correction/DeleteEmptyJournalsTest.php b/tests/Unit/Console/Commands/Correction/DeleteEmptyJournalsTest.php
index 47bad505d8..4a3cb0a10d 100644
--- a/tests/Unit/Console/Commands/Correction/DeleteEmptyJournalsTest.php
+++ b/tests/Unit/Console/Commands/Correction/DeleteEmptyJournalsTest.php
@@ -1,4 +1,5 @@
assertCount(0, TransactionJournal::where('id', $journal->id)->whereNull('deleted_at')->get());
$this->assertCount(0, Transaction::where('id', $transaction->id)->whereNull('deleted_at')->get());
}
-}
\ No newline at end of file
+}
diff --git a/tests/Unit/Console/Commands/Correction/DeleteZeroAmountTest.php b/tests/Unit/Console/Commands/Correction/DeleteZeroAmountTest.php
index 946a03672e..caaffe88b7 100644
--- a/tests/Unit/Console/Commands/Correction/DeleteZeroAmountTest.php
+++ b/tests/Unit/Console/Commands/Correction/DeleteZeroAmountTest.php
@@ -1,4 +1,5 @@
assertCount(0, Transaction::where('id', $transaction->id)->whereNull('deleted_at')->get());
$this->assertCount(0, TransactionJournal::where('id', $journal->id)->whereNull('deleted_at')->get());
}
-}
\ No newline at end of file
+}
diff --git a/tests/Unit/Console/Commands/Correction/EnableCurrenciesTest.php b/tests/Unit/Console/Commands/Correction/EnableCurrenciesTest.php
index 40163938c8..26aac5d725 100644
--- a/tests/Unit/Console/Commands/Correction/EnableCurrenciesTest.php
+++ b/tests/Unit/Console/Commands/Correction/EnableCurrenciesTest.php
@@ -1,4 +1,5 @@
assertCount($count + 1, TransactionCurrency::where('enabled', 1)->get());
}
-}
\ No newline at end of file
+}
diff --git a/tests/Unit/Console/Commands/Correction/FixAccountTypesTest.php b/tests/Unit/Console/Commands/Correction/FixAccountTypesTest.php
index 7d6b9d0cea..fb1651f979 100644
--- a/tests/Unit/Console/Commands/Correction/FixAccountTypesTest.php
+++ b/tests/Unit/Console/Commands/Correction/FixAccountTypesTest.php
@@ -1,4 +1,5 @@
forceDelete();
$journal->forceDelete();
}
-}
\ No newline at end of file
+}
diff --git a/tests/Unit/Console/Commands/Correction/FixPiggiesTest.php b/tests/Unit/Console/Commands/Correction/FixPiggiesTest.php
index 6f71a03ab6..cac9f051e9 100644
--- a/tests/Unit/Console/Commands/Correction/FixPiggiesTest.php
+++ b/tests/Unit/Console/Commands/Correction/FixPiggiesTest.php
@@ -1,4 +1,5 @@
assertCount(0, PiggyBankEvent::where('id', $event->id)->where('transaction_journal_id', $transfer->id)->get());
$event->forceDelete();
}
-}
\ No newline at end of file
+}
diff --git a/tests/Unit/Console/Commands/Correction/FixUnevenAmountTest.php b/tests/Unit/Console/Commands/Correction/FixUnevenAmountTest.php
index d5aa891a7a..71d249e5f6 100644
--- a/tests/Unit/Console/Commands/Correction/FixUnevenAmountTest.php
+++ b/tests/Unit/Console/Commands/Correction/FixUnevenAmountTest.php
@@ -1,4 +1,5 @@
assertCount(1, Transaction::where('id', $two->id)->where('amount', '10')->get());
}
-}
\ No newline at end of file
+}
diff --git a/tests/Unit/Console/Commands/Correction/RemoveBillsTest.php b/tests/Unit/Console/Commands/Correction/RemoveBillsTest.php
index ef2b5b35ac..8fbfeeaed8 100644
--- a/tests/Unit/Console/Commands/Correction/RemoveBillsTest.php
+++ b/tests/Unit/Console/Commands/Correction/RemoveBillsTest.php
@@ -1,4 +1,5 @@
assertCount(0, TransactionJournal::where('id', $journal->id)->whereNotNull('bill_id')->get());
}
-}
\ No newline at end of file
+}
diff --git a/tests/Unit/Console/Commands/Correction/RenameMetaFieldsTest.php b/tests/Unit/Console/Commands/Correction/RenameMetaFieldsTest.php
index 34e8d6a1bf..449829ada2 100644
--- a/tests/Unit/Console/Commands/Correction/RenameMetaFieldsTest.php
+++ b/tests/Unit/Console/Commands/Correction/RenameMetaFieldsTest.php
@@ -1,4 +1,5 @@
assertCount(1, TransactionJournalMeta::where('id', $entry->id)->where('name', 'import_hash_v2')->get());
}
-}
\ No newline at end of file
+}
diff --git a/tests/Unit/Console/Commands/Correction/TransferBudgetsTest.php b/tests/Unit/Console/Commands/Correction/TransferBudgetsTest.php
index 5512b2a86e..6e03a7f5a8 100644
--- a/tests/Unit/Console/Commands/Correction/TransferBudgetsTest.php
+++ b/tests/Unit/Console/Commands/Correction/TransferBudgetsTest.php
@@ -1,4 +1,5 @@
assertCount(0, $deposit->budgets()->get());
}
-}
\ No newline at end of file
+}
diff --git a/tests/Unit/Console/Commands/DecryptDatabaseTest.php b/tests/Unit/Console/Commands/DecryptDatabaseTest.php
index dde70b3b15..1c08ee1b07 100644
--- a/tests/Unit/Console/Commands/DecryptDatabaseTest.php
+++ b/tests/Unit/Console/Commands/DecryptDatabaseTest.php
@@ -1,4 +1,5 @@
assertCount(1, Account::where('id', $account->id)->where('iban', $iban)->get());
}
-}
\ No newline at end of file
+}
diff --git a/tests/Unit/Console/Commands/Import/CreateCSVImportTest.php b/tests/Unit/Console/Commands/Import/CreateCSVImportTest.php
index 5069ae66d0..bbd3e66ae2 100644
--- a/tests/Unit/Console/Commands/Import/CreateCSVImportTest.php
+++ b/tests/Unit/Console/Commands/Import/CreateCSVImportTest.php
@@ -1,4 +1,5 @@
assertExitCode(1);
}
-}
\ No newline at end of file
+}
diff --git a/tests/Unit/Console/Commands/Upgrade/AccountCurrenciesTest.php b/tests/Unit/Console/Commands/Upgrade/AccountCurrenciesTest.php
index 87642d6f2e..45d50ad47d 100644
--- a/tests/Unit/Console/Commands/Upgrade/AccountCurrenciesTest.php
+++ b/tests/Unit/Console/Commands/Upgrade/AccountCurrenciesTest.php
@@ -1,4 +1,5 @@
assertExitCode(0);
// nothing changed, so nothing to verify.
}
-}
\ No newline at end of file
+}
diff --git a/tests/Unit/Console/Commands/Upgrade/BackToJournalsTest.php b/tests/Unit/Console/Commands/Upgrade/BackToJournalsTest.php
index 203471e974..4d15782ed3 100644
--- a/tests/Unit/Console/Commands/Upgrade/BackToJournalsTest.php
+++ b/tests/Unit/Console/Commands/Upgrade/BackToJournalsTest.php
@@ -1,4 +1,5 @@
assertCount(1, BudgetLimit::where('id', $limit->id)->where('transaction_currency_id', 1)->get());
}
-}
\ No newline at end of file
+}
diff --git a/tests/Unit/Console/Commands/Upgrade/CCLiabilitiesTest.php b/tests/Unit/Console/Commands/Upgrade/CCLiabilitiesTest.php
index ef093beb38..e7a78ca7bb 100644
--- a/tests/Unit/Console/Commands/Upgrade/CCLiabilitiesTest.php
+++ b/tests/Unit/Console/Commands/Upgrade/CCLiabilitiesTest.php
@@ -1,4 +1,5 @@
forceDelete();
}
-}
\ No newline at end of file
+}
diff --git a/tests/Unit/Console/Commands/Upgrade/MigrateAttachmentsTest.php b/tests/Unit/Console/Commands/Upgrade/MigrateAttachmentsTest.php
index 812d6ad041..9d91bdf732 100644
--- a/tests/Unit/Console/Commands/Upgrade/MigrateAttachmentsTest.php
+++ b/tests/Unit/Console/Commands/Upgrade/MigrateAttachmentsTest.php
@@ -1,4 +1,5 @@
forceDelete();
}
-}
\ No newline at end of file
+}
diff --git a/tests/Unit/Console/Commands/Upgrade/MigrateJournalNotesTest.php b/tests/Unit/Console/Commands/Upgrade/MigrateJournalNotesTest.php
index 07048bcc47..8638b86077 100644
--- a/tests/Unit/Console/Commands/Upgrade/MigrateJournalNotesTest.php
+++ b/tests/Unit/Console/Commands/Upgrade/MigrateJournalNotesTest.php
@@ -1,4 +1,5 @@
assertExitCode(0);
}
-}
\ No newline at end of file
+}
diff --git a/tests/Unit/Console/Commands/Upgrade/OtherCurrenciesCorrectionsTest.php b/tests/Unit/Console/Commands/Upgrade/OtherCurrenciesCorrectionsTest.php
index 9126cf9704..d26fd087a3 100644
--- a/tests/Unit/Console/Commands/Upgrade/OtherCurrenciesCorrectionsTest.php
+++ b/tests/Unit/Console/Commands/Upgrade/OtherCurrenciesCorrectionsTest.php
@@ -1,4 +1,5 @@
forceDelete();
}
-}
\ No newline at end of file
+}
diff --git a/tests/Unit/Console/Commands/Upgrade/TransactionIdentifierTest.php b/tests/Unit/Console/Commands/Upgrade/TransactionIdentifierTest.php
index 1e305a3006..8fee32f112 100644
--- a/tests/Unit/Console/Commands/Upgrade/TransactionIdentifierTest.php
+++ b/tests/Unit/Console/Commands/Upgrade/TransactionIdentifierTest.php
@@ -1,4 +1,5 @@
assertCount(1, Transaction::where('id', $destination->id)->where('transaction_currency_id', $euro->id)->get());
}
-}
\ No newline at end of file
+}
diff --git a/tests/Unit/ExampleTest.php b/tests/Unit/ExampleTest.php
index 885cf132c4..c6eb4b093c 100644
--- a/tests/Unit/ExampleTest.php
+++ b/tests/Unit/ExampleTest.php
@@ -26,6 +26,9 @@ use Tests\TestCase;
/**
* Class ExampleTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class ExampleTest extends TestCase
{
diff --git a/tests/Unit/Factory/AccountFactoryTest.php b/tests/Unit/Factory/AccountFactoryTest.php
index 1cc9045205..8f7bdd8069 100644
--- a/tests/Unit/Factory/AccountFactoryTest.php
+++ b/tests/Unit/Factory/AccountFactoryTest.php
@@ -41,7 +41,9 @@ use Tests\TestCase;
/**
* Class AccountFactoryTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class AccountFactoryTest extends TestCase
{
diff --git a/tests/Unit/Factory/AccountMetaFactoryTest.php b/tests/Unit/Factory/AccountMetaFactoryTest.php
index 618597d929..18b8430932 100644
--- a/tests/Unit/Factory/AccountMetaFactoryTest.php
+++ b/tests/Unit/Factory/AccountMetaFactoryTest.php
@@ -32,6 +32,9 @@ use Tests\TestCase;
/**
*
* Class AccountMetaFactoryTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class AccountMetaFactoryTest extends TestCase
{
diff --git a/tests/Unit/Factory/AttachmentFactoryTest.php b/tests/Unit/Factory/AttachmentFactoryTest.php
index 548019536d..88f86a79c4 100644
--- a/tests/Unit/Factory/AttachmentFactoryTest.php
+++ b/tests/Unit/Factory/AttachmentFactoryTest.php
@@ -34,6 +34,9 @@ use Tests\TestCase;
/**
*
* Class AttachmentFactoryTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class AttachmentFactoryTest extends TestCase
{
diff --git a/tests/Unit/Factory/BillFactoryTest.php b/tests/Unit/Factory/BillFactoryTest.php
index 41a9e66678..9485722b02 100644
--- a/tests/Unit/Factory/BillFactoryTest.php
+++ b/tests/Unit/Factory/BillFactoryTest.php
@@ -32,6 +32,9 @@ use Tests\TestCase;
/**
* Class BillFactoryTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class BillFactoryTest extends TestCase
{
diff --git a/tests/Unit/Factory/BudgetFactoryTest.php b/tests/Unit/Factory/BudgetFactoryTest.php
index ccbac463e2..f8c6c755c6 100644
--- a/tests/Unit/Factory/BudgetFactoryTest.php
+++ b/tests/Unit/Factory/BudgetFactoryTest.php
@@ -30,6 +30,9 @@ use Tests\TestCase;
/**
* Class BudgetFactoryTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class BudgetFactoryTest extends TestCase
{
diff --git a/tests/Unit/Factory/CategoryFactoryTest.php b/tests/Unit/Factory/CategoryFactoryTest.php
index 565b46cf6e..768ece5fe9 100644
--- a/tests/Unit/Factory/CategoryFactoryTest.php
+++ b/tests/Unit/Factory/CategoryFactoryTest.php
@@ -29,6 +29,9 @@ use Tests\TestCase;
/**
* Class CategoryFactoryTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class CategoryFactoryTest extends TestCase
{
diff --git a/tests/Unit/Factory/PiggyBankEventFactoryTest.php b/tests/Unit/Factory/PiggyBankEventFactoryTest.php
index a0645e38ee..c4dace7159 100644
--- a/tests/Unit/Factory/PiggyBankEventFactoryTest.php
+++ b/tests/Unit/Factory/PiggyBankEventFactoryTest.php
@@ -33,6 +33,9 @@ use Tests\TestCase;
/**
* Class PiggyBankEventFactoryTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class PiggyBankEventFactoryTest extends TestCase
{
diff --git a/tests/Unit/Factory/PiggyBankFactoryTest.php b/tests/Unit/Factory/PiggyBankFactoryTest.php
index d207f1fd10..eb554fe566 100644
--- a/tests/Unit/Factory/PiggyBankFactoryTest.php
+++ b/tests/Unit/Factory/PiggyBankFactoryTest.php
@@ -30,6 +30,9 @@ use Tests\TestCase;
/**
* Class PiggyBankFactoryTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class PiggyBankFactoryTest extends TestCase
{
diff --git a/tests/Unit/Factory/RecurrenceFactoryTest.php b/tests/Unit/Factory/RecurrenceFactoryTest.php
index 3998a655f2..9899caa197 100644
--- a/tests/Unit/Factory/RecurrenceFactoryTest.php
+++ b/tests/Unit/Factory/RecurrenceFactoryTest.php
@@ -52,7 +52,9 @@ use Tests\TestCase;
* With the correct types.
*
* Class RecurrenceFactoryTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class RecurrenceFactoryTest extends TestCase
{
diff --git a/tests/Unit/Factory/TagFactoryTest.php b/tests/Unit/Factory/TagFactoryTest.php
index 3acc979749..251777eb71 100644
--- a/tests/Unit/Factory/TagFactoryTest.php
+++ b/tests/Unit/Factory/TagFactoryTest.php
@@ -30,6 +30,9 @@ use Tests\TestCase;
/**
* Class TagFactoryTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class TagFactoryTest extends TestCase
{
diff --git a/tests/Unit/Factory/TransactionCurrencyFactoryTest.php b/tests/Unit/Factory/TransactionCurrencyFactoryTest.php
index db49f10e3f..ce9fb583b3 100644
--- a/tests/Unit/Factory/TransactionCurrencyFactoryTest.php
+++ b/tests/Unit/Factory/TransactionCurrencyFactoryTest.php
@@ -31,6 +31,9 @@ use Tests\TestCase;
/**
* Class TransactionCurrencyFactoryTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class TransactionCurrencyFactoryTest extends TestCase
{
diff --git a/tests/Unit/Factory/TransactionFactoryTest.php b/tests/Unit/Factory/TransactionFactoryTest.php
index 2bd9947045..bb03800d75 100644
--- a/tests/Unit/Factory/TransactionFactoryTest.php
+++ b/tests/Unit/Factory/TransactionFactoryTest.php
@@ -30,6 +30,9 @@ use Tests\TestCase;
/**
* Class TransactionFactoryTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class TransactionFactoryTest extends TestCase
{
diff --git a/tests/Unit/Factory/TransactionJournalFactoryTest.php b/tests/Unit/Factory/TransactionJournalFactoryTest.php
index 8601b69552..60ccb47a0a 100644
--- a/tests/Unit/Factory/TransactionJournalFactoryTest.php
+++ b/tests/Unit/Factory/TransactionJournalFactoryTest.php
@@ -50,6 +50,9 @@ use Tests\TestCase;
/**
* Class TransactionJournalFactoryTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class TransactionJournalFactoryTest extends TestCase
{
diff --git a/tests/Unit/Factory/TransactionJournalMetaFactoryTest.php b/tests/Unit/Factory/TransactionJournalMetaFactoryTest.php
index 025adb868e..41272fbea4 100644
--- a/tests/Unit/Factory/TransactionJournalMetaFactoryTest.php
+++ b/tests/Unit/Factory/TransactionJournalMetaFactoryTest.php
@@ -31,6 +31,9 @@ use Tests\TestCase;
/**
* Class TransactionJournalMetaFactoryTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class TransactionJournalMetaFactoryTest extends TestCase
{
diff --git a/tests/Unit/Factory/TransactionTypeFactoryTest.php b/tests/Unit/Factory/TransactionTypeFactoryTest.php
index 25ba1c9e01..d336774b4d 100644
--- a/tests/Unit/Factory/TransactionTypeFactoryTest.php
+++ b/tests/Unit/Factory/TransactionTypeFactoryTest.php
@@ -32,6 +32,9 @@ use Tests\TestCase;
/**
*
* Class TransactionTypeFactoryTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class TransactionTypeFactoryTest extends TestCase
{
diff --git a/tests/Unit/Generator/Chart/Basic/ChartJsGeneratorTest.php b/tests/Unit/Generator/Chart/Basic/ChartJsGeneratorTest.php
index e660375e04..6bc48fd5e4 100644
--- a/tests/Unit/Generator/Chart/Basic/ChartJsGeneratorTest.php
+++ b/tests/Unit/Generator/Chart/Basic/ChartJsGeneratorTest.php
@@ -30,6 +30,9 @@ use Tests\TestCase;
/**
*
* Class ChartJsGeneratorTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class ChartJsGeneratorTest extends TestCase
{
diff --git a/tests/Unit/Generator/Report/Audit/MonthReportGeneratorTest.php b/tests/Unit/Generator/Report/Audit/MonthReportGeneratorTest.php
index e01688a6f5..6be88ba75f 100644
--- a/tests/Unit/Generator/Report/Audit/MonthReportGeneratorTest.php
+++ b/tests/Unit/Generator/Report/Audit/MonthReportGeneratorTest.php
@@ -39,6 +39,10 @@ use Tests\TestCase;
/**
*
* Class MonthReportGeneratorTest
+ *
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class MonthReportGeneratorTest extends TestCase
{
diff --git a/tests/Unit/Handlers/Events/APIEventHandlerTest.php b/tests/Unit/Handlers/Events/APIEventHandlerTest.php
index 8a382b117d..93efcde1ee 100644
--- a/tests/Unit/Handlers/Events/APIEventHandlerTest.php
+++ b/tests/Unit/Handlers/Events/APIEventHandlerTest.php
@@ -35,6 +35,9 @@ use Tests\TestCase;
/**
*
* Class APIEventHandlerTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class APIEventHandlerTest extends TestCase
{
diff --git a/tests/Unit/Handlers/Events/AdminEventHandlerTest.php b/tests/Unit/Handlers/Events/AdminEventHandlerTest.php
index f0a990a64a..8a99dfc934 100644
--- a/tests/Unit/Handlers/Events/AdminEventHandlerTest.php
+++ b/tests/Unit/Handlers/Events/AdminEventHandlerTest.php
@@ -35,6 +35,9 @@ use Tests\TestCase;
/**
* Class AdminEventHandlerTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class AdminEventHandlerTest extends TestCase
{
diff --git a/tests/Unit/Handlers/Events/AutomationHandlerTest.php b/tests/Unit/Handlers/Events/AutomationHandlerTest.php
index a5b2cff17f..69ff31e388 100644
--- a/tests/Unit/Handlers/Events/AutomationHandlerTest.php
+++ b/tests/Unit/Handlers/Events/AutomationHandlerTest.php
@@ -37,6 +37,9 @@ use Tests\TestCase;
/**
*
* Class AutomationHandlerTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class AutomationHandlerTest extends TestCase
{
diff --git a/tests/Unit/Handlers/Events/StoredGroupEventHandlerTest.php b/tests/Unit/Handlers/Events/StoredGroupEventHandlerTest.php
index 5d74498954..05a86d97c3 100644
--- a/tests/Unit/Handlers/Events/StoredGroupEventHandlerTest.php
+++ b/tests/Unit/Handlers/Events/StoredGroupEventHandlerTest.php
@@ -33,6 +33,9 @@ use Tests\TestCase;
/**
*
* Class StoredGroupEventHandlerTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class StoredGroupEventHandlerTest extends TestCase
{
diff --git a/tests/Unit/Handlers/Events/UpdatedGroupEventHandlerTest.php b/tests/Unit/Handlers/Events/UpdatedGroupEventHandlerTest.php
index 13bafdaf53..02ee50be7c 100644
--- a/tests/Unit/Handlers/Events/UpdatedGroupEventHandlerTest.php
+++ b/tests/Unit/Handlers/Events/UpdatedGroupEventHandlerTest.php
@@ -31,6 +31,9 @@ use Tests\TestCase;
/**
* Class UpdatedJournalEventHandlerTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class UpdatedGroupEventHandlerTest extends TestCase
{
diff --git a/tests/Unit/Handlers/Events/VersionCheckEventHandlerTest.php b/tests/Unit/Handlers/Events/VersionCheckEventHandlerTest.php
index 481c8eb539..bd18404c4f 100644
--- a/tests/Unit/Handlers/Events/VersionCheckEventHandlerTest.php
+++ b/tests/Unit/Handlers/Events/VersionCheckEventHandlerTest.php
@@ -38,6 +38,9 @@ use Tests\TestCase;
/**
* Class VersionCheckEventHandlerTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class VersionCheckEventHandlerTest extends TestCase
{
diff --git a/tests/Unit/Helpers/Fiscal/FiscalHelperTest.php b/tests/Unit/Helpers/Fiscal/FiscalHelperTest.php
index 7935e1c1d2..b1e3563901 100644
--- a/tests/Unit/Helpers/Fiscal/FiscalHelperTest.php
+++ b/tests/Unit/Helpers/Fiscal/FiscalHelperTest.php
@@ -35,6 +35,9 @@ use Tests\TestCase;
/**
*
* Class FiscalHelperTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class FiscalHelperTest extends TestCase
{
diff --git a/tests/Unit/Helpers/Help/HelpTest.php b/tests/Unit/Helpers/Help/HelpTest.php
index fdcd17472f..ed6a4278fb 100644
--- a/tests/Unit/Helpers/Help/HelpTest.php
+++ b/tests/Unit/Helpers/Help/HelpTest.php
@@ -35,6 +35,9 @@ use Tests\TestCase;
/**
*
* Class HelpTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class HelpTest extends TestCase
{
diff --git a/tests/Unit/Helpers/Report/NetWorthTest.php b/tests/Unit/Helpers/Report/NetWorthTest.php
index 38a8b70165..e86c147ffd 100644
--- a/tests/Unit/Helpers/Report/NetWorthTest.php
+++ b/tests/Unit/Helpers/Report/NetWorthTest.php
@@ -39,6 +39,9 @@ use Tests\TestCase;
/**
*
* Class NetWorthTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class NetWorthTest extends TestCase
{
diff --git a/tests/Unit/Import/Converter/AmountCreditTest.php b/tests/Unit/Import/Converter/AmountCreditTest.php
index fa4a4f7eb1..57ff0877f2 100644
--- a/tests/Unit/Import/Converter/AmountCreditTest.php
+++ b/tests/Unit/Import/Converter/AmountCreditTest.php
@@ -28,6 +28,9 @@ use Tests\TestCase;
/**
* Class AmountCreditTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class AmountCreditTest extends TestCase
{
diff --git a/tests/Unit/Import/Converter/AmountDebitTest.php b/tests/Unit/Import/Converter/AmountDebitTest.php
index 79656afd6d..cc62382a3e 100644
--- a/tests/Unit/Import/Converter/AmountDebitTest.php
+++ b/tests/Unit/Import/Converter/AmountDebitTest.php
@@ -28,6 +28,9 @@ use Tests\TestCase;
/**
* Class AmountDebitTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class AmountDebitTest extends TestCase
{
diff --git a/tests/Unit/Import/Converter/AmountNegatedTest.php b/tests/Unit/Import/Converter/AmountNegatedTest.php
index bdf8c98fce..3da2874260 100644
--- a/tests/Unit/Import/Converter/AmountNegatedTest.php
+++ b/tests/Unit/Import/Converter/AmountNegatedTest.php
@@ -27,6 +27,9 @@ use Tests\TestCase;
/**
* Class AmountNegatedTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class AmountNegatedTest extends TestCase
{
diff --git a/tests/Unit/Import/Converter/AmountTest.php b/tests/Unit/Import/Converter/AmountTest.php
index 4f2533025c..ccf97990e2 100644
--- a/tests/Unit/Import/Converter/AmountTest.php
+++ b/tests/Unit/Import/Converter/AmountTest.php
@@ -28,6 +28,9 @@ use Tests\TestCase;
/**
* Class AmountTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class AmountTest extends TestCase
{
diff --git a/tests/Unit/Import/Converter/BankDebitCreditTest.php b/tests/Unit/Import/Converter/BankDebitCreditTest.php
index 78b314a530..3fa2a6c314 100644
--- a/tests/Unit/Import/Converter/BankDebitCreditTest.php
+++ b/tests/Unit/Import/Converter/BankDebitCreditTest.php
@@ -31,6 +31,9 @@ use Tests\TestCase;
/**
*
* Class BankDebitCreditTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class BankDebitCreditTest extends TestCase
{
diff --git a/tests/Unit/Import/JobConfiguration/BunqJobConfigurationTest.php b/tests/Unit/Import/JobConfiguration/BunqJobConfigurationTest.php
index 842d8021ae..7b206eea0b 100644
--- a/tests/Unit/Import/JobConfiguration/BunqJobConfigurationTest.php
+++ b/tests/Unit/Import/JobConfiguration/BunqJobConfigurationTest.php
@@ -35,6 +35,9 @@ use Tests\TestCase;
/**
* Class BunqJobConfigurationTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class BunqJobConfigurationTest extends TestCase
{
diff --git a/tests/Unit/Import/JobConfiguration/FakeJobConfigurationTest.php b/tests/Unit/Import/JobConfiguration/FakeJobConfigurationTest.php
index 01e6a991d2..d3950230cc 100644
--- a/tests/Unit/Import/JobConfiguration/FakeJobConfigurationTest.php
+++ b/tests/Unit/Import/JobConfiguration/FakeJobConfigurationTest.php
@@ -32,6 +32,9 @@ use Tests\TestCase;
/**
* Class FakeJobConfigurationTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class FakeJobConfigurationTest extends TestCase
{
diff --git a/tests/Unit/Import/JobConfiguration/FileJobConfigurationTest.php b/tests/Unit/Import/JobConfiguration/FileJobConfigurationTest.php
index 433032a174..de8faf3b61 100644
--- a/tests/Unit/Import/JobConfiguration/FileJobConfigurationTest.php
+++ b/tests/Unit/Import/JobConfiguration/FileJobConfigurationTest.php
@@ -39,6 +39,9 @@ use Tests\TestCase;
/**
* Class FileJobConfigurationTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class FileJobConfigurationTest extends TestCase
{
diff --git a/tests/Unit/Import/JobConfiguration/FinTSJobConfigurationTest.php b/tests/Unit/Import/JobConfiguration/FinTSJobConfigurationTest.php
index 0190e65d5b..4579370084 100644
--- a/tests/Unit/Import/JobConfiguration/FinTSJobConfigurationTest.php
+++ b/tests/Unit/Import/JobConfiguration/FinTSJobConfigurationTest.php
@@ -1,4 +1,5 @@
assertEquals('import.fints.choose_account', $res);
}
-}
\ No newline at end of file
+}
diff --git a/tests/Unit/Import/JobConfiguration/SpectreJobConfigurationTest.php b/tests/Unit/Import/JobConfiguration/SpectreJobConfigurationTest.php
index 5184fdadb2..7639f66edd 100644
--- a/tests/Unit/Import/JobConfiguration/SpectreJobConfigurationTest.php
+++ b/tests/Unit/Import/JobConfiguration/SpectreJobConfigurationTest.php
@@ -38,6 +38,9 @@ use Tests\TestCase;
/**
* Class SpectreJobConfigurationTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class SpectreJobConfigurationTest extends TestCase
{
diff --git a/tests/Unit/Import/JobConfiguration/YnabJobConfigurationTest.php b/tests/Unit/Import/JobConfiguration/YnabJobConfigurationTest.php
index 291ad992af..ecf6168202 100644
--- a/tests/Unit/Import/JobConfiguration/YnabJobConfigurationTest.php
+++ b/tests/Unit/Import/JobConfiguration/YnabJobConfigurationTest.php
@@ -36,6 +36,9 @@ use Tests\TestCase;
/**
* Class YnabJobConfigurationTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class YnabJobConfigurationTest extends TestCase
{
diff --git a/tests/Unit/Import/Mapper/AssetAccountIbansTest.php b/tests/Unit/Import/Mapper/AssetAccountIbansTest.php
index 27c4fe2477..47c99de10d 100644
--- a/tests/Unit/Import/Mapper/AssetAccountIbansTest.php
+++ b/tests/Unit/Import/Mapper/AssetAccountIbansTest.php
@@ -33,6 +33,9 @@ use Tests\TestCase;
/**
* Class AssetAccountIbansTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class AssetAccountIbansTest extends TestCase
{
diff --git a/tests/Unit/Import/Mapper/AssetAccountsTest.php b/tests/Unit/Import/Mapper/AssetAccountsTest.php
index 024edf41cf..cb1d6c7d7d 100644
--- a/tests/Unit/Import/Mapper/AssetAccountsTest.php
+++ b/tests/Unit/Import/Mapper/AssetAccountsTest.php
@@ -33,6 +33,9 @@ use Tests\TestCase;
/**
* Class AssetAccountsTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class AssetAccountsTest extends TestCase
{
diff --git a/tests/Unit/Import/Mapper/BillsTest.php b/tests/Unit/Import/Mapper/BillsTest.php
index 460b155234..808ed69cf8 100644
--- a/tests/Unit/Import/Mapper/BillsTest.php
+++ b/tests/Unit/Import/Mapper/BillsTest.php
@@ -32,6 +32,9 @@ use Tests\TestCase;
/**
* Class BillsTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class BillsTest extends TestCase
{
diff --git a/tests/Unit/Import/Mapper/BudgetsTest.php b/tests/Unit/Import/Mapper/BudgetsTest.php
index 8b440f8f7f..3b0924bd46 100644
--- a/tests/Unit/Import/Mapper/BudgetsTest.php
+++ b/tests/Unit/Import/Mapper/BudgetsTest.php
@@ -32,6 +32,9 @@ use Tests\TestCase;
/**
* Class BudgetsTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class BudgetsTest extends TestCase
{
diff --git a/tests/Unit/Import/Mapper/CategoriesTest.php b/tests/Unit/Import/Mapper/CategoriesTest.php
index 14f5ff46ff..5d8bf9d35a 100644
--- a/tests/Unit/Import/Mapper/CategoriesTest.php
+++ b/tests/Unit/Import/Mapper/CategoriesTest.php
@@ -32,6 +32,9 @@ use Tests\TestCase;
/**
* Class CategoriesTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class CategoriesTest extends TestCase
{
diff --git a/tests/Unit/Import/Mapper/OpposingAccountIbansTest.php b/tests/Unit/Import/Mapper/OpposingAccountIbansTest.php
index 494bb6376f..9b40d68d46 100644
--- a/tests/Unit/Import/Mapper/OpposingAccountIbansTest.php
+++ b/tests/Unit/Import/Mapper/OpposingAccountIbansTest.php
@@ -33,6 +33,9 @@ use Tests\TestCase;
/**
* Class OpposingAccountIbansTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class OpposingAccountIbansTest extends TestCase
{
diff --git a/tests/Unit/Import/Mapper/OpposingAccountsTest.php b/tests/Unit/Import/Mapper/OpposingAccountsTest.php
index 8687dcdc6d..b0d1a5cb18 100644
--- a/tests/Unit/Import/Mapper/OpposingAccountsTest.php
+++ b/tests/Unit/Import/Mapper/OpposingAccountsTest.php
@@ -33,6 +33,9 @@ use Tests\TestCase;
/**
* Class OpposingAccountsTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class OpposingAccountsTest extends TestCase
{
diff --git a/tests/Unit/Import/Mapper/TagsTest.php b/tests/Unit/Import/Mapper/TagsTest.php
index b902968092..9092b26600 100644
--- a/tests/Unit/Import/Mapper/TagsTest.php
+++ b/tests/Unit/Import/Mapper/TagsTest.php
@@ -32,6 +32,9 @@ use Tests\TestCase;
/**
* Class TagsTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class TagsTest extends TestCase
{
diff --git a/tests/Unit/Import/Mapper/TransactionCurrenciesTest.php b/tests/Unit/Import/Mapper/TransactionCurrenciesTest.php
index 170e616f09..c674acee64 100644
--- a/tests/Unit/Import/Mapper/TransactionCurrenciesTest.php
+++ b/tests/Unit/Import/Mapper/TransactionCurrenciesTest.php
@@ -32,6 +32,9 @@ use Tests\TestCase;
/**
* Class TransactionCurrenciesTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class TransactionCurrenciesTest extends TestCase
{
diff --git a/tests/Unit/Import/MapperPreProcess/TagsCommaTest.php b/tests/Unit/Import/MapperPreProcess/TagsCommaTest.php
index 09d152b017..97ad59da06 100644
--- a/tests/Unit/Import/MapperPreProcess/TagsCommaTest.php
+++ b/tests/Unit/Import/MapperPreProcess/TagsCommaTest.php
@@ -29,6 +29,9 @@ use Tests\TestCase;
/**
* Class TagsCommaTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class TagsCommaTest extends TestCase
{
diff --git a/tests/Unit/Import/MapperPreProcess/TagsSpaceTest.php b/tests/Unit/Import/MapperPreProcess/TagsSpaceTest.php
index feb5ce53e7..1c3eda3c5e 100644
--- a/tests/Unit/Import/MapperPreProcess/TagsSpaceTest.php
+++ b/tests/Unit/Import/MapperPreProcess/TagsSpaceTest.php
@@ -29,6 +29,9 @@ use Tests\TestCase;
/**
* Class TagsSpaceTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class TagsSpaceTest extends TestCase
{
diff --git a/tests/Unit/Import/Prerequisites/BunqPrerequisitesTest.php b/tests/Unit/Import/Prerequisites/BunqPrerequisitesTest.php
index c23631d2e9..86b04d466f 100644
--- a/tests/Unit/Import/Prerequisites/BunqPrerequisitesTest.php
+++ b/tests/Unit/Import/Prerequisites/BunqPrerequisitesTest.php
@@ -36,6 +36,9 @@ use Tests\TestCase;
/**
* Class BunqPrerequisitesTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class BunqPrerequisitesTest extends TestCase
{
diff --git a/tests/Unit/Import/Prerequisites/FakePrerequisitesTest.php b/tests/Unit/Import/Prerequisites/FakePrerequisitesTest.php
index 2718d2af61..f1fdace905 100644
--- a/tests/Unit/Import/Prerequisites/FakePrerequisitesTest.php
+++ b/tests/Unit/Import/Prerequisites/FakePrerequisitesTest.php
@@ -33,6 +33,9 @@ use Tests\TestCase;
/**
* Class FakePrerequisitesTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class FakePrerequisitesTest extends TestCase
{
diff --git a/tests/Unit/Import/Prerequisites/SpectrePrerequisitesTest.php b/tests/Unit/Import/Prerequisites/SpectrePrerequisitesTest.php
index 957967b203..40902f6387 100644
--- a/tests/Unit/Import/Prerequisites/SpectrePrerequisitesTest.php
+++ b/tests/Unit/Import/Prerequisites/SpectrePrerequisitesTest.php
@@ -33,6 +33,9 @@ use Tests\TestCase;
/**
* Class SpectrePrerequisitesTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class SpectrePrerequisitesTest extends TestCase
{
diff --git a/tests/Unit/Import/Prerequisites/YnabPrerequisitesTest.php b/tests/Unit/Import/Prerequisites/YnabPrerequisitesTest.php
index a7cd1d970a..d9fb974827 100644
--- a/tests/Unit/Import/Prerequisites/YnabPrerequisitesTest.php
+++ b/tests/Unit/Import/Prerequisites/YnabPrerequisitesTest.php
@@ -32,6 +32,9 @@ use Tests\TestCase;
/**
* Class YnabPrerequisitesTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class YnabPrerequisitesTest extends TestCase
{
diff --git a/tests/Unit/Import/Routine/BunqRoutineTest.php b/tests/Unit/Import/Routine/BunqRoutineTest.php
index c78e1d5631..0b7a1a052a 100644
--- a/tests/Unit/Import/Routine/BunqRoutineTest.php
+++ b/tests/Unit/Import/Routine/BunqRoutineTest.php
@@ -36,6 +36,9 @@ use Tests\TestCase;
/**
* Class BunqRoutineTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class BunqRoutineTest extends TestCase
{
diff --git a/tests/Unit/Import/Routine/FakeRoutineTest.php b/tests/Unit/Import/Routine/FakeRoutineTest.php
index 24db7d24f2..e9d304e559 100644
--- a/tests/Unit/Import/Routine/FakeRoutineTest.php
+++ b/tests/Unit/Import/Routine/FakeRoutineTest.php
@@ -36,6 +36,9 @@ use Tests\TestCase;
/**
* Class FakeRoutineTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class FakeRoutineTest extends TestCase
{
diff --git a/tests/Unit/Import/Routine/FileRoutineTest.php b/tests/Unit/Import/Routine/FileRoutineTest.php
index d9eac4ad69..c69e8a6c72 100644
--- a/tests/Unit/Import/Routine/FileRoutineTest.php
+++ b/tests/Unit/Import/Routine/FileRoutineTest.php
@@ -38,6 +38,9 @@ use Tests\TestCase;
/**
* Class FileRoutineTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class FileRoutineTest extends TestCase
{
diff --git a/tests/Unit/Import/Routine/FinTSRoutineTest.php b/tests/Unit/Import/Routine/FinTSRoutineTest.php
index 6537b456f3..459693f734 100644
--- a/tests/Unit/Import/Routine/FinTSRoutineTest.php
+++ b/tests/Unit/Import/Routine/FinTSRoutineTest.php
@@ -1,4 +1,5 @@
assertTrue(false, $e->getMessage());
}
}
-}
\ No newline at end of file
+}
diff --git a/tests/Unit/Import/Routine/SpectreRoutineTest.php b/tests/Unit/Import/Routine/SpectreRoutineTest.php
index a540c3cec5..2212ee878d 100644
--- a/tests/Unit/Import/Routine/SpectreRoutineTest.php
+++ b/tests/Unit/Import/Routine/SpectreRoutineTest.php
@@ -37,6 +37,9 @@ use Tests\TestCase;
/**
* Class SpectreRoutineTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class SpectreRoutineTest extends TestCase
{
diff --git a/tests/Unit/Import/Routine/YnabRoutineTest.php b/tests/Unit/Import/Routine/YnabRoutineTest.php
index b3eed7c484..431c4a9bb7 100644
--- a/tests/Unit/Import/Routine/YnabRoutineTest.php
+++ b/tests/Unit/Import/Routine/YnabRoutineTest.php
@@ -38,6 +38,9 @@ use Tests\TestCase;
/**
* Class YnabRoutineTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class YnabRoutineTest extends TestCase
{
diff --git a/tests/Unit/Import/Specifics/AbnAmroDescriptionTest.php b/tests/Unit/Import/Specifics/AbnAmroDescriptionTest.php
index ed1d5bb099..679e87b1cd 100644
--- a/tests/Unit/Import/Specifics/AbnAmroDescriptionTest.php
+++ b/tests/Unit/Import/Specifics/AbnAmroDescriptionTest.php
@@ -30,6 +30,9 @@ use Tests\TestCase;
/**
* Class AbnAmroDescriptionTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class AbnAmroDescriptionTest extends TestCase
{
diff --git a/tests/Unit/Import/Specifics/BelfiusTest.php b/tests/Unit/Import/Specifics/BelfiusTest.php
index cee851cb31..195a88fef7 100644
--- a/tests/Unit/Import/Specifics/BelfiusTest.php
+++ b/tests/Unit/Import/Specifics/BelfiusTest.php
@@ -30,6 +30,9 @@ use Tests\TestCase;
/**
* Class BelfiusTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class BelfiusTest extends TestCase
{
diff --git a/tests/Unit/Import/Specifics/IngBelgiumTest.php b/tests/Unit/Import/Specifics/IngBelgiumTest.php
index 8201f4a0c1..f477f3cbce 100644
--- a/tests/Unit/Import/Specifics/IngBelgiumTest.php
+++ b/tests/Unit/Import/Specifics/IngBelgiumTest.php
@@ -30,6 +30,9 @@ use Tests\TestCase;
/**
* Class IngBelgiumTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class IngBelgiumTest extends TestCase
{
diff --git a/tests/Unit/Import/Specifics/IngDescriptionTest.php b/tests/Unit/Import/Specifics/IngDescriptionTest.php
index 1cee4ca664..d6d17c43da 100644
--- a/tests/Unit/Import/Specifics/IngDescriptionTest.php
+++ b/tests/Unit/Import/Specifics/IngDescriptionTest.php
@@ -30,6 +30,9 @@ use Tests\TestCase;
/**
* Class IngDescriptionTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class IngDescriptionTest extends TestCase
{
diff --git a/tests/Unit/Import/Specifics/PresidentsChoiceTest.php b/tests/Unit/Import/Specifics/PresidentsChoiceTest.php
index 909acd614f..2387cdbc8b 100644
--- a/tests/Unit/Import/Specifics/PresidentsChoiceTest.php
+++ b/tests/Unit/Import/Specifics/PresidentsChoiceTest.php
@@ -30,6 +30,9 @@ use Tests\TestCase;
/**
* Class PresidentsChoiceTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class PresidentsChoiceTest extends TestCase
{
diff --git a/tests/Unit/Import/Specifics/SnsDescriptionTest.php b/tests/Unit/Import/Specifics/SnsDescriptionTest.php
index dda090f422..fa6b02b0c0 100644
--- a/tests/Unit/Import/Specifics/SnsDescriptionTest.php
+++ b/tests/Unit/Import/Specifics/SnsDescriptionTest.php
@@ -30,6 +30,9 @@ use Tests\TestCase;
/**
* Class SnsDescriptionTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class SnsDescriptionTest extends TestCase
{
diff --git a/tests/Unit/Import/Storage/ImportArrayStorageTest.php b/tests/Unit/Import/Storage/ImportArrayStorageTest.php
index d79e985a7e..b1633818db 100644
--- a/tests/Unit/Import/Storage/ImportArrayStorageTest.php
+++ b/tests/Unit/Import/Storage/ImportArrayStorageTest.php
@@ -47,6 +47,11 @@ use Tests\TestCase;
/**
* Class ImportArrayStorageTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
+ * @SuppressWarnings(PHPMD.ExcessiveClassLength)
+ *
*/
class ImportArrayStorageTest extends TestCase
{
diff --git a/tests/Unit/Jobs/CreateRecurringTransactionsTest.php b/tests/Unit/Jobs/CreateRecurringTransactionsTest.php
index ceaf3ecb12..e668be0707 100644
--- a/tests/Unit/Jobs/CreateRecurringTransactionsTest.php
+++ b/tests/Unit/Jobs/CreateRecurringTransactionsTest.php
@@ -1,4 +1,5 @@
assertEquals(1, $job->submitted);
}
-}
\ No newline at end of file
+}
diff --git a/tests/Unit/Middleware/AuthenticateTest.php b/tests/Unit/Middleware/AuthenticateTest.php
index 591e0c3b74..342874023c 100644
--- a/tests/Unit/Middleware/AuthenticateTest.php
+++ b/tests/Unit/Middleware/AuthenticateTest.php
@@ -30,6 +30,9 @@ use Tests\TestCase;
/**
* Class AuthenticateTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class AuthenticateTest extends TestCase
{
diff --git a/tests/Unit/Middleware/BinderTest.php b/tests/Unit/Middleware/BinderTest.php
index f6c4658271..c6faa59688 100644
--- a/tests/Unit/Middleware/BinderTest.php
+++ b/tests/Unit/Middleware/BinderTest.php
@@ -48,6 +48,12 @@ use Tests\TestCase;
/**
* Class BinderTest
* Per object: works, not existing, not logged in + existing
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
+ * @SuppressWarnings(PHPMD.TooManyMethods)
+ * @SuppressWarnings(PHPMD.ExcessiveClassLength)
+ * @SuppressWarnings(PHPMD.ExcessiveClassComplexity)
*/
class BinderTest extends TestCase
{
diff --git a/tests/Unit/Middleware/IsAdminTest.php b/tests/Unit/Middleware/IsAdminTest.php
index 4ed7621f6e..24a016308b 100644
--- a/tests/Unit/Middleware/IsAdminTest.php
+++ b/tests/Unit/Middleware/IsAdminTest.php
@@ -33,6 +33,9 @@ use Tests\TestCase;
/**
* Class IsAdminTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class IsAdminTest extends TestCase
{
diff --git a/tests/Unit/Middleware/IsDemoUserTest.php b/tests/Unit/Middleware/IsDemoUserTest.php
index 2a32a56f6d..15f7255ce1 100644
--- a/tests/Unit/Middleware/IsDemoUserTest.php
+++ b/tests/Unit/Middleware/IsDemoUserTest.php
@@ -32,6 +32,9 @@ use Tests\TestCase;
/**
* Class IsDemoUserTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class IsDemoUserTest extends TestCase
{
diff --git a/tests/Unit/Middleware/IsSandstormUserTest.php b/tests/Unit/Middleware/IsSandstormUserTest.php
index 7a3a9ec20c..980cd5788e 100644
--- a/tests/Unit/Middleware/IsSandstormUserTest.php
+++ b/tests/Unit/Middleware/IsSandstormUserTest.php
@@ -31,6 +31,9 @@ use Tests\TestCase;
/**
* Class IsSandstormUserTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class IsSandstormUserTest extends TestCase
{
diff --git a/tests/Unit/Middleware/RangeTest.php b/tests/Unit/Middleware/RangeTest.php
index 1aed44718d..3ab1f92b6c 100644
--- a/tests/Unit/Middleware/RangeTest.php
+++ b/tests/Unit/Middleware/RangeTest.php
@@ -33,6 +33,9 @@ use Tests\TestCase;
/**
* Class RangeTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class RangeTest extends TestCase
{
diff --git a/tests/Unit/Middleware/RedirectIfAuthenticatedTest.php b/tests/Unit/Middleware/RedirectIfAuthenticatedTest.php
index 7d6946ad3d..5964c90dad 100644
--- a/tests/Unit/Middleware/RedirectIfAuthenticatedTest.php
+++ b/tests/Unit/Middleware/RedirectIfAuthenticatedTest.php
@@ -31,6 +31,9 @@ use Tests\TestCase;
/**
* Class RedirectIfAuthenticatedTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class RedirectIfAuthenticatedTest extends TestCase
{
diff --git a/tests/Unit/Middleware/SandstormTest.php b/tests/Unit/Middleware/SandstormTest.php
index d5a9ad3e53..737143a227 100644
--- a/tests/Unit/Middleware/SandstormTest.php
+++ b/tests/Unit/Middleware/SandstormTest.php
@@ -33,6 +33,9 @@ use Tests\TestCase;
/**
* Class RangeTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class SandstormTest extends TestCase
{
diff --git a/tests/Unit/Middleware/SecureHeadersTest.php b/tests/Unit/Middleware/SecureHeadersTest.php
index 84cce7cf62..bb59b2dd34 100644
--- a/tests/Unit/Middleware/SecureHeadersTest.php
+++ b/tests/Unit/Middleware/SecureHeadersTest.php
@@ -32,6 +32,9 @@ use Tests\TestCase;
/**
* Class SecureHeadersTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class SecureHeadersTest extends TestCase
{
diff --git a/tests/Unit/Rules/BelongsUserTest.php b/tests/Unit/Rules/BelongsUserTest.php
index 4eca8eddfb..bbdbbd217d 100644
--- a/tests/Unit/Rules/BelongsUserTest.php
+++ b/tests/Unit/Rules/BelongsUserTest.php
@@ -1,4 +1,5 @@
assertFalse($engine->passes($attribute, $value));
}
-}
\ No newline at end of file
+}
diff --git a/tests/Unit/Rules/IsBooleanTest.php b/tests/Unit/Rules/IsBooleanTest.php
index d86004d2b0..d1893653cb 100644
--- a/tests/Unit/Rules/IsBooleanTest.php
+++ b/tests/Unit/Rules/IsBooleanTest.php
@@ -1,4 +1,5 @@
assertFalse($engine->passes($attribute, $value), $value);
+ $this->assertFalse($engine->passes($attribute, $value), sprintf('%s', var_export($value, true)));
}
}
@@ -71,4 +75,4 @@ class IsDateOrTimeTest extends TestCase
}
-}
\ No newline at end of file
+}
diff --git a/tests/Unit/Rules/IsValidAttachmentModelTest.php b/tests/Unit/Rules/IsValidAttachmentModelTest.php
index b3da7794d3..58ef28caaf 100644
--- a/tests/Unit/Rules/IsValidAttachmentModelTest.php
+++ b/tests/Unit/Rules/IsValidAttachmentModelTest.php
@@ -1,4 +1,5 @@
assertFalse($engine->passes($attribute, $value));
}
-}
\ No newline at end of file
+}
diff --git a/tests/Unit/Rules/UniqueIbanTest.php b/tests/Unit/Rules/UniqueIbanTest.php
index 97e09431b2..0ddfbcb881 100644
--- a/tests/Unit/Rules/UniqueIbanTest.php
+++ b/tests/Unit/Rules/UniqueIbanTest.php
@@ -1,4 +1,5 @@
save();
}
-}
\ No newline at end of file
+}
diff --git a/tests/Unit/Services/Internal/Destroy/AccountDestroyServiceTest.php b/tests/Unit/Services/Internal/Destroy/AccountDestroyServiceTest.php
index 06b9d8c345..b8c9a7ab8c 100644
--- a/tests/Unit/Services/Internal/Destroy/AccountDestroyServiceTest.php
+++ b/tests/Unit/Services/Internal/Destroy/AccountDestroyServiceTest.php
@@ -34,6 +34,9 @@ use Tests\TestCase;
/**
* Class AccountDestroyServiceTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class AccountDestroyServiceTest extends TestCase
{
@@ -75,8 +78,8 @@ class AccountDestroyServiceTest extends TestCase
'virtual_balance' => '0', 'iban' => null, 'active' => true]
);
- $recurrence = $this->getRandomRecurrence();
- $recurrenceTransaction = RecurrenceTransaction::create(
+ $recurrence = $this->getRandomRecurrence();
+ $transaction = RecurrenceTransaction::create(
[
'recurrence_id' => $recurrence->id,
'transaction_currency_id' => $this->getEuro()->id,
@@ -88,7 +91,7 @@ class AccountDestroyServiceTest extends TestCase
);
$recService->shouldReceive('destroyById')->once()
- ->withAnyArgs([$recurrenceTransaction->id]);
+ ->withAnyArgs([$transaction->id]);
/** @var AccountDestroyService $service */
$service = app(AccountDestroyService::class);
@@ -96,7 +99,7 @@ class AccountDestroyServiceTest extends TestCase
$this->assertDatabaseMissing('accounts', ['id' => $account->id, 'deleted_at' => null]);
- $recurrenceTransaction->forceDelete();
+ $transaction->forceDelete();
}
/**
diff --git a/tests/Unit/Services/Internal/Update/AccountUpdateServiceTest.php b/tests/Unit/Services/Internal/Update/AccountUpdateServiceTest.php
index 65fff25a90..88950da7dc 100644
--- a/tests/Unit/Services/Internal/Update/AccountUpdateServiceTest.php
+++ b/tests/Unit/Services/Internal/Update/AccountUpdateServiceTest.php
@@ -38,6 +38,9 @@ use Tests\TestCase;
/**
* Class AccountUpdateServiceTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class AccountUpdateServiceTest extends TestCase
{
diff --git a/tests/Unit/Support/Cronjobs/RecurringCronjobTest.php b/tests/Unit/Support/Cronjobs/RecurringCronjobTest.php
index 10cccc2ac6..dd936a0e32 100644
--- a/tests/Unit/Support/Cronjobs/RecurringCronjobTest.php
+++ b/tests/Unit/Support/Cronjobs/RecurringCronjobTest.php
@@ -1,4 +1,5 @@
fire();
}
-}
\ No newline at end of file
+}
diff --git a/tests/Unit/Support/FinTS/MetadataParserTest.php b/tests/Unit/Support/FinTS/MetadataParserTest.php
index 72d9f78758..4a632501a3 100644
--- a/tests/Unit/Support/FinTS/MetadataParserTest.php
+++ b/tests/Unit/Support/FinTS/MetadataParserTest.php
@@ -30,6 +30,9 @@ use Tests\TestCase;
/**
*
* Class MetadataParserTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class MetadataParserTest extends TestCase
{
diff --git a/tests/Unit/Support/Import/JobConfiguration/Bunq/ChooseAccountsHandlerTest.php b/tests/Unit/Support/Import/JobConfiguration/Bunq/ChooseAccountsHandlerTest.php
index f3c935f22e..05d3aa6830 100644
--- a/tests/Unit/Support/Import/JobConfiguration/Bunq/ChooseAccountsHandlerTest.php
+++ b/tests/Unit/Support/Import/JobConfiguration/Bunq/ChooseAccountsHandlerTest.php
@@ -41,6 +41,9 @@ use Tests\TestCase;
/**
* Class ChooseAccountsHandlerTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class ChooseAccountsHandlerTest extends TestCase
{
diff --git a/tests/Unit/Support/Import/JobConfiguration/Bunq/NewBunqJobHandlerTest.php b/tests/Unit/Support/Import/JobConfiguration/Bunq/NewBunqJobHandlerTest.php
index 3e8fa4bf8d..7c9c2549f2 100644
--- a/tests/Unit/Support/Import/JobConfiguration/Bunq/NewBunqJobHandlerTest.php
+++ b/tests/Unit/Support/Import/JobConfiguration/Bunq/NewBunqJobHandlerTest.php
@@ -32,6 +32,9 @@ use Tests\TestCase;
/**
* Class NewBunqJobHandlerTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class NewBunqJobHandlerTest extends TestCase
{
diff --git a/tests/Unit/Support/Import/JobConfiguration/File/ConfigureMappingHandlerTest.php b/tests/Unit/Support/Import/JobConfiguration/File/ConfigureMappingHandlerTest.php
index feec1aa1d0..980efc868c 100644
--- a/tests/Unit/Support/Import/JobConfiguration/File/ConfigureMappingHandlerTest.php
+++ b/tests/Unit/Support/Import/JobConfiguration/File/ConfigureMappingHandlerTest.php
@@ -41,6 +41,9 @@ use Tests\TestCase;
/**
* Class ConfigureMappingHandlerTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*
*/
class ConfigureMappingHandlerTest extends TestCase
diff --git a/tests/Unit/Support/Import/JobConfiguration/File/ConfigureRolesHandlerTest.php b/tests/Unit/Support/Import/JobConfiguration/File/ConfigureRolesHandlerTest.php
index f753ddb0a3..07dd1d7e19 100644
--- a/tests/Unit/Support/Import/JobConfiguration/File/ConfigureRolesHandlerTest.php
+++ b/tests/Unit/Support/Import/JobConfiguration/File/ConfigureRolesHandlerTest.php
@@ -40,6 +40,9 @@ use Tests\TestCase;
/**
* Class ConfigureRolesHandlerTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class ConfigureRolesHandlerTest extends TestCase
{
diff --git a/tests/Unit/Support/Import/JobConfiguration/File/ConfigureUploadHandlerTest.php b/tests/Unit/Support/Import/JobConfiguration/File/ConfigureUploadHandlerTest.php
index d2e7fd5c5b..513241ab76 100644
--- a/tests/Unit/Support/Import/JobConfiguration/File/ConfigureUploadHandlerTest.php
+++ b/tests/Unit/Support/Import/JobConfiguration/File/ConfigureUploadHandlerTest.php
@@ -34,6 +34,9 @@ use Tests\TestCase;
/**
* Class ConfigureUploadHandlerTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class ConfigureUploadHandlerTest extends TestCase
{
diff --git a/tests/Unit/Support/Import/JobConfiguration/File/NewFileJobHandlerTest.php b/tests/Unit/Support/Import/JobConfiguration/File/NewFileJobHandlerTest.php
index c6e0b771fe..c141a9ce9a 100644
--- a/tests/Unit/Support/Import/JobConfiguration/File/NewFileJobHandlerTest.php
+++ b/tests/Unit/Support/Import/JobConfiguration/File/NewFileJobHandlerTest.php
@@ -37,6 +37,9 @@ use Tests\TestCase;
/**
* Class NewFileJobHandlerTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class NewFileJobHandlerTest extends TestCase
{
diff --git a/tests/Unit/Support/Import/JobConfiguration/Spectre/ChooseAccountsHandlerTest.php b/tests/Unit/Support/Import/JobConfiguration/Spectre/ChooseAccountsHandlerTest.php
index 3b304e9af5..f0f52b6221 100644
--- a/tests/Unit/Support/Import/JobConfiguration/Spectre/ChooseAccountsHandlerTest.php
+++ b/tests/Unit/Support/Import/JobConfiguration/Spectre/ChooseAccountsHandlerTest.php
@@ -44,6 +44,9 @@ use Tests\TestCase;
/**
* Class ChooseAccountsHandlerTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class ChooseAccountsHandlerTest extends TestCase
{
diff --git a/tests/Unit/Support/Import/JobConfiguration/Spectre/ChooseLoginHandlerTest.php b/tests/Unit/Support/Import/JobConfiguration/Spectre/ChooseLoginHandlerTest.php
index 53cb425b43..2f16902cfd 100644
--- a/tests/Unit/Support/Import/JobConfiguration/Spectre/ChooseLoginHandlerTest.php
+++ b/tests/Unit/Support/Import/JobConfiguration/Spectre/ChooseLoginHandlerTest.php
@@ -42,6 +42,9 @@ use Tests\TestCase;
/**
* Class ChooseLoginHandlerTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class ChooseLoginHandlerTest extends TestCase
{
@@ -139,9 +142,9 @@ class ChooseLoginHandlerTest extends TestCase
public function testConfigureJobCustomer(): void
{
// fake Spectre customer:
- $fakeCustomerPreference = new Preference;
- $fakeCustomerPreference->name = 'spectre_customer';
- $fakeCustomerPreference->data = [
+ $fakePref = new Preference;
+ $fakePref->name = 'spectre_customer';
+ $fakePref->data = [
'id' => 1,
'identifier' => 'fake',
'secret' => 'Dumbledore dies',
@@ -164,7 +167,7 @@ class ChooseLoginHandlerTest extends TestCase
// should try to grab customer from preferences:
Preferences::shouldReceive('getForUser')->withArgs([Mockery::any(), 'spectre_customer', null])
- ->andReturn($fakeCustomerPreference)->once();
+ ->andReturn($fakePref)->once();
// mock stuff
$ctRequest = $this->mock(CreateTokenRequest::class);
diff --git a/tests/Unit/Support/Import/JobConfiguration/Spectre/DoAuthenticateHandlerTest.php b/tests/Unit/Support/Import/JobConfiguration/Spectre/DoAuthenticateHandlerTest.php
index 7121e50f33..5f6d01bd82 100644
--- a/tests/Unit/Support/Import/JobConfiguration/Spectre/DoAuthenticateHandlerTest.php
+++ b/tests/Unit/Support/Import/JobConfiguration/Spectre/DoAuthenticateHandlerTest.php
@@ -39,6 +39,9 @@ use Tests\TestCase;
/**
* Class DoAuthenticateHandlerTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class DoAuthenticateHandlerTest extends TestCase
{
diff --git a/tests/Unit/Support/Import/Placeholder/ImportTransactionTest.php b/tests/Unit/Support/Import/Placeholder/ImportTransactionTest.php
index c821a5ce2b..308fbd735c 100644
--- a/tests/Unit/Support/Import/Placeholder/ImportTransactionTest.php
+++ b/tests/Unit/Support/Import/Placeholder/ImportTransactionTest.php
@@ -32,6 +32,11 @@ use Tests\TestCase;
/**
* Class ImportTransactionTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
+ * @SuppressWarnings(PHPMD.TooManyMethods)
+ * @SuppressWarnings(PHPMD.ExcessiveClassComplexity)
*/
class ImportTransactionTest extends TestCase
{
diff --git a/tests/Unit/Support/Import/Routine/Bunq/StageImportDataHandlerTest.php b/tests/Unit/Support/Import/Routine/Bunq/StageImportDataHandlerTest.php
index 4d70f988f8..69618a2a49 100644
--- a/tests/Unit/Support/Import/Routine/Bunq/StageImportDataHandlerTest.php
+++ b/tests/Unit/Support/Import/Routine/Bunq/StageImportDataHandlerTest.php
@@ -48,6 +48,9 @@ use Tests\TestCase;
/**
* Class StageImportDataHandlerTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class StageImportDataHandlerTest extends TestCase
{
diff --git a/tests/Unit/Support/Import/Routine/Bunq/StageNewHandlerTest.php b/tests/Unit/Support/Import/Routine/Bunq/StageNewHandlerTest.php
index 57c688f3ed..c59dd08afe 100644
--- a/tests/Unit/Support/Import/Routine/Bunq/StageNewHandlerTest.php
+++ b/tests/Unit/Support/Import/Routine/Bunq/StageNewHandlerTest.php
@@ -48,6 +48,9 @@ use Tests\TestCase;
/**
* Class StageNewHandlerTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class StageNewHandlerTest extends TestCase
{
@@ -82,7 +85,7 @@ class StageNewHandlerTest extends TestCase
// create fake bunq object:
$setting = new MonetaryAccountSetting(null, null, null);
$mab = new BunqMonetaryAccountBank('EUR', 'Some descr', null, null, null, null, null, null, null, null);
- $ma = new BunqMonetaryAccount;
+ $monAcc = new BunqMonetaryAccount;
$alias = new Pointer('a', 'b', null);
@@ -93,10 +96,10 @@ class StageNewHandlerTest extends TestCase
$setting->setColor('FFFFFF');
$mab->setSetting($setting);
$mab->setAlias([$alias]);
- $ma->setMonetaryAccountBank($mab);
+ $monAcc->setMonetaryAccountBank($mab);
// response list.
- $list = new BunqResponseMonetaryAccountList([$ma], []);
+ $list = new BunqResponseMonetaryAccountList([$monAcc], []);
$expectedConfig = [
'accounts' => [
@@ -169,7 +172,7 @@ class StageNewHandlerTest extends TestCase
// create fake bunq object:
$setting = new MonetaryAccountSetting(null, null, null);
$maj = new MonetaryAccountJoint('EUR', [], 'Some descr', null, null, null, null, null, null, null, null);
- $ma = new BunqMonetaryAccount;
+ $monAcc = new BunqMonetaryAccount;
$alias = new Pointer('a', 'b', null);
$labelUser = new LabelUser('x', 'James', 'NL');
$coOwner = new CoOwner($alias);
@@ -183,11 +186,11 @@ class StageNewHandlerTest extends TestCase
$maj->setSetting($setting);
$maj->setAlias([$alias]);
$maj->setAllCoOwner([$coOwner]);
- $ma->setMonetaryAccountJoint($maj);
+ $monAcc->setMonetaryAccountJoint($maj);
$coOwner->setAlias($labelUser);
// response list.
- $list = new BunqResponseMonetaryAccountList([$ma], []);
+ $list = new BunqResponseMonetaryAccountList([$monAcc], []);
$expectedConfig = [
'accounts' => [
@@ -261,7 +264,7 @@ class StageNewHandlerTest extends TestCase
// create fake bunq object:
$setting = new MonetaryAccountSetting(null, null, null);
$mal = new MonetaryAccountLight('EUR', 'Some descr', null, null, null, null, null, null, null, null);
- $ma = new BunqMonetaryAccount;
+ $monAcc = new BunqMonetaryAccount;
$alias = new Pointer('a', 'b', null);
@@ -272,10 +275,10 @@ class StageNewHandlerTest extends TestCase
$setting->setColor('FFFFFF');
$mal->setSetting($setting);
$mal->setAlias([$alias]);
- $ma->setMonetaryAccountLight($mal);
+ $monAcc->setMonetaryAccountLight($mal);
// response list.
- $list = new BunqResponseMonetaryAccountList([$ma], []);
+ $list = new BunqResponseMonetaryAccountList([$monAcc], []);
$expectedConfig = [
'accounts' => [
diff --git a/tests/Unit/Support/Import/Routine/File/AssetAccountMapperTest.php b/tests/Unit/Support/Import/Routine/File/AssetAccountMapperTest.php
index a8a7027507..723e5ed055 100644
--- a/tests/Unit/Support/Import/Routine/File/AssetAccountMapperTest.php
+++ b/tests/Unit/Support/Import/Routine/File/AssetAccountMapperTest.php
@@ -33,6 +33,9 @@ use Tests\TestCase;
/**
* Class AssetAccountMapperTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class AssetAccountMapperTest extends TestCase
{
diff --git a/tests/Unit/Support/Import/Routine/File/CSVProcessorTest.php b/tests/Unit/Support/Import/Routine/File/CSVProcessorTest.php
index 78281802a2..cb1d3c8f72 100644
--- a/tests/Unit/Support/Import/Routine/File/CSVProcessorTest.php
+++ b/tests/Unit/Support/Import/Routine/File/CSVProcessorTest.php
@@ -39,6 +39,9 @@ use Tests\TestCase;
* Do some end to end testing here, perhaps?
*
* Class CSVProcessorTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class CSVProcessorTest extends TestCase
{
diff --git a/tests/Unit/Support/Import/Routine/File/CurrencyMapperTest.php b/tests/Unit/Support/Import/Routine/File/CurrencyMapperTest.php
index 0c031dea1d..597dcade4b 100644
--- a/tests/Unit/Support/Import/Routine/File/CurrencyMapperTest.php
+++ b/tests/Unit/Support/Import/Routine/File/CurrencyMapperTest.php
@@ -32,6 +32,9 @@ use Tests\TestCase;
/**
* Class CurrencyMapperTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class CurrencyMapperTest extends TestCase
{
diff --git a/tests/Unit/Support/Import/Routine/File/ImportableConverterTest.php b/tests/Unit/Support/Import/Routine/File/ImportableConverterTest.php
index 3bdd9b0198..4371777029 100644
--- a/tests/Unit/Support/Import/Routine/File/ImportableConverterTest.php
+++ b/tests/Unit/Support/Import/Routine/File/ImportableConverterTest.php
@@ -45,6 +45,9 @@ use Tests\TestCase;
* todo test foreign currency
*
* Class ImportableConverterTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class ImportableConverterTest extends TestCase
{
diff --git a/tests/Unit/Support/Import/Routine/File/ImportableCreatorTest.php b/tests/Unit/Support/Import/Routine/File/ImportableCreatorTest.php
index 9fb8eaeee2..f3d5638a99 100644
--- a/tests/Unit/Support/Import/Routine/File/ImportableCreatorTest.php
+++ b/tests/Unit/Support/Import/Routine/File/ImportableCreatorTest.php
@@ -32,6 +32,9 @@ use Tests\TestCase;
/**
* Class ImportableCreatorTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class ImportableCreatorTest extends TestCase
{
diff --git a/tests/Unit/Support/Import/Routine/File/LineReaderTest.php b/tests/Unit/Support/Import/Routine/File/LineReaderTest.php
index db3cb35f10..f0563ba11d 100644
--- a/tests/Unit/Support/Import/Routine/File/LineReaderTest.php
+++ b/tests/Unit/Support/Import/Routine/File/LineReaderTest.php
@@ -36,6 +36,9 @@ use Tests\TestCase;
/**
* Class LineReaderTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class LineReaderTest extends TestCase
{
diff --git a/tests/Unit/Support/Import/Routine/File/MappedValuesValidatorTest.php b/tests/Unit/Support/Import/Routine/File/MappedValuesValidatorTest.php
index 4c5ab76849..9704f09553 100644
--- a/tests/Unit/Support/Import/Routine/File/MappedValuesValidatorTest.php
+++ b/tests/Unit/Support/Import/Routine/File/MappedValuesValidatorTest.php
@@ -39,6 +39,9 @@ use Tests\TestCase;
/**
* Class MappedValuesValidatorTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class MappedValuesValidatorTest extends TestCase
{
@@ -122,14 +125,14 @@ class MappedValuesValidatorTest extends TestCase
}
/**
- * @param int $id
+ * @param int $objectId
*
* @return stdClass
*/
- private function objectWithId(int $id): stdClass
+ private function objectWithId(int $objectId): stdClass
{
$obj = new stdClass();
- $obj->id = $id;
+ $obj->id = $objectId;
return $obj;
}
diff --git a/tests/Unit/Support/Import/Routine/File/MappingConvergerTest.php b/tests/Unit/Support/Import/Routine/File/MappingConvergerTest.php
index 856d5a2b5f..66caf7bb1b 100644
--- a/tests/Unit/Support/Import/Routine/File/MappingConvergerTest.php
+++ b/tests/Unit/Support/Import/Routine/File/MappingConvergerTest.php
@@ -33,6 +33,9 @@ use Tests\TestCase;
/**
* Class MappingConvergerTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class MappingConvergerTest extends TestCase
{
diff --git a/tests/Unit/Support/Import/Routine/File/OpposingAccountMapperTest.php b/tests/Unit/Support/Import/Routine/File/OpposingAccountMapperTest.php
index 631b071e74..68b5b0a9f7 100644
--- a/tests/Unit/Support/Import/Routine/File/OpposingAccountMapperTest.php
+++ b/tests/Unit/Support/Import/Routine/File/OpposingAccountMapperTest.php
@@ -33,6 +33,9 @@ use Tests\TestCase;
/**
* Class OpposingAccountMapperTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class OpposingAccountMapperTest extends TestCase
{
diff --git a/tests/Unit/Support/Import/Routine/Spectre/StageAuthenticatedHandlerTest.php b/tests/Unit/Support/Import/Routine/Spectre/StageAuthenticatedHandlerTest.php
index 5411fa8e80..ead700d96a 100644
--- a/tests/Unit/Support/Import/Routine/Spectre/StageAuthenticatedHandlerTest.php
+++ b/tests/Unit/Support/Import/Routine/Spectre/StageAuthenticatedHandlerTest.php
@@ -42,6 +42,9 @@ use Tests\TestCase;
/**
* Class StageAuthenticatedHandlerTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class StageAuthenticatedHandlerTest extends TestCase
{
diff --git a/tests/Unit/Support/Import/Routine/Spectre/StageImportDataHandlerTest.php b/tests/Unit/Support/Import/Routine/Spectre/StageImportDataHandlerTest.php
index b3a7d33e89..978f01cf78 100644
--- a/tests/Unit/Support/Import/Routine/Spectre/StageImportDataHandlerTest.php
+++ b/tests/Unit/Support/Import/Routine/Spectre/StageImportDataHandlerTest.php
@@ -40,6 +40,9 @@ use Tests\TestCase;
/**
* Class StageImportDataHandlerTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class StageImportDataHandlerTest extends TestCase
{
diff --git a/tests/Unit/Support/Import/Routine/Spectre/StageNewHandlerTest.php b/tests/Unit/Support/Import/Routine/Spectre/StageNewHandlerTest.php
index 8e72f72b49..f61c089d8d 100644
--- a/tests/Unit/Support/Import/Routine/Spectre/StageNewHandlerTest.php
+++ b/tests/Unit/Support/Import/Routine/Spectre/StageNewHandlerTest.php
@@ -43,6 +43,9 @@ use Tests\TestCase;
/**
* Class StageNewHandlerTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class StageNewHandlerTest extends TestCase
{
diff --git a/tests/Unit/Support/NavigationTest.php b/tests/Unit/Support/NavigationTest.php
index d551748eec..5665f5d43e 100644
--- a/tests/Unit/Support/NavigationTest.php
+++ b/tests/Unit/Support/NavigationTest.php
@@ -33,6 +33,9 @@ use Tests\TestCase;
/**
*
* Class NavigationTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class NavigationTest extends TestCase
{
@@ -105,32 +108,6 @@ class NavigationTest extends TestCase
}
}
- /**
- * @covers \FireflyIII\Support\Navigation
- */
- public function testAddPeriodError(): void
- {
- $tests = [
- // period, skip, start, expected end
- ['bla', 0, '2018-01-01', '2018-01-02'],
- ];
-
- /** @var array $test */
- foreach ($tests as $test) {
-
- $freq = $test[0];
- /** @noinspection MultiAssignmentUsageInspection */
- $skip = $test[1];
- $start = new Carbon($test[2]);
- $nav = new Navigation;
- try {
- $nav->addPeriod($start, $freq, $skip);
- } catch (FireflyException $e) {
- $this->assertEquals('Cannot do addPeriod for $repeat_freq "bla"', $e->getMessage());
- }
- }
- }
-
/**
* @covers \FireflyIII\Support\Navigation
*/
@@ -341,4 +318,4 @@ class NavigationTest extends TestCase
$this->assertEquals($expected->format('Y-m-d H:i:s'), $result->format('Y-m-d H:i:s'));
}
}
-}
\ No newline at end of file
+}
diff --git a/tests/Unit/TransactionRules/Actions/AddTagTest.php b/tests/Unit/TransactionRules/Actions/AddTagTest.php
index e59f426e0c..017f84b284 100644
--- a/tests/Unit/TransactionRules/Actions/AddTagTest.php
+++ b/tests/Unit/TransactionRules/Actions/AddTagTest.php
@@ -30,6 +30,10 @@ use Tests\TestCase;
/**
* Class AddTagTest
+ *
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class AddTagTest extends TestCase
{
diff --git a/tests/Unit/TransactionRules/Actions/AppendDescriptionTest.php b/tests/Unit/TransactionRules/Actions/AppendDescriptionTest.php
index ccd90bf204..841b1c3865 100644
--- a/tests/Unit/TransactionRules/Actions/AppendDescriptionTest.php
+++ b/tests/Unit/TransactionRules/Actions/AppendDescriptionTest.php
@@ -30,6 +30,9 @@ use Tests\TestCase;
/**
* Class AppendDescriptionTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class AppendDescriptionTest extends TestCase
{
diff --git a/tests/Unit/TransactionRules/Actions/AppendNotesTest.php b/tests/Unit/TransactionRules/Actions/AppendNotesTest.php
index 35cb34f279..fdacf21f68 100644
--- a/tests/Unit/TransactionRules/Actions/AppendNotesTest.php
+++ b/tests/Unit/TransactionRules/Actions/AppendNotesTest.php
@@ -31,6 +31,9 @@ use Tests\TestCase;
/**
* Class AppendNotesTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class AppendNotesTest extends TestCase
{
diff --git a/tests/Unit/TransactionRules/Actions/ClearBudgetTest.php b/tests/Unit/TransactionRules/Actions/ClearBudgetTest.php
index eb44a61107..4e0d9109d8 100644
--- a/tests/Unit/TransactionRules/Actions/ClearBudgetTest.php
+++ b/tests/Unit/TransactionRules/Actions/ClearBudgetTest.php
@@ -31,6 +31,9 @@ use Tests\TestCase;
/**
* Class ClearBudgetTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class ClearBudgetTest extends TestCase
{
diff --git a/tests/Unit/TransactionRules/Actions/ClearCategoryTest.php b/tests/Unit/TransactionRules/Actions/ClearCategoryTest.php
index dfbfd8904d..f840310aae 100644
--- a/tests/Unit/TransactionRules/Actions/ClearCategoryTest.php
+++ b/tests/Unit/TransactionRules/Actions/ClearCategoryTest.php
@@ -31,6 +31,9 @@ use Tests\TestCase;
/**
* Class ClearCategoryTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class ClearCategoryTest extends TestCase
{
diff --git a/tests/Unit/TransactionRules/Actions/ClearNotesTest.php b/tests/Unit/TransactionRules/Actions/ClearNotesTest.php
index 3379ef87b2..f36410fec0 100644
--- a/tests/Unit/TransactionRules/Actions/ClearNotesTest.php
+++ b/tests/Unit/TransactionRules/Actions/ClearNotesTest.php
@@ -33,6 +33,9 @@ use Tests\TestCase;
/**
* Class ClearNotesTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class ClearNotesTest extends TestCase
{
diff --git a/tests/Unit/TransactionRules/Actions/ConvertToDepositTest.php b/tests/Unit/TransactionRules/Actions/ConvertToDepositTest.php
index 79190b0d90..06369fa2ad 100644
--- a/tests/Unit/TransactionRules/Actions/ConvertToDepositTest.php
+++ b/tests/Unit/TransactionRules/Actions/ConvertToDepositTest.php
@@ -36,6 +36,9 @@ use Tests\TestCase;
/**
*
* Class ConvertToDepositTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class ConvertToDepositTest extends TestCase
{
diff --git a/tests/Unit/TransactionRules/Actions/ConvertToTransferTest.php b/tests/Unit/TransactionRules/Actions/ConvertToTransferTest.php
index d79fe0fd86..347d7de586 100644
--- a/tests/Unit/TransactionRules/Actions/ConvertToTransferTest.php
+++ b/tests/Unit/TransactionRules/Actions/ConvertToTransferTest.php
@@ -38,6 +38,9 @@ use Tests\TestCase;
/**
*
* Class ConvertToTransferTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class ConvertToTransferTest extends TestCase
{
diff --git a/tests/Unit/TransactionRules/Actions/ConvertToWithdrawalTest.php b/tests/Unit/TransactionRules/Actions/ConvertToWithdrawalTest.php
index d65c447d6c..1af20e7e26 100644
--- a/tests/Unit/TransactionRules/Actions/ConvertToWithdrawalTest.php
+++ b/tests/Unit/TransactionRules/Actions/ConvertToWithdrawalTest.php
@@ -36,6 +36,9 @@ use Tests\TestCase;
/**
*
* Class ConvertToWithdrawalTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class ConvertToWithdrawalTest extends TestCase
{
diff --git a/tests/Unit/TransactionRules/Actions/LinkToBillTest.php b/tests/Unit/TransactionRules/Actions/LinkToBillTest.php
index 92d0e4d80c..e515a4d180 100644
--- a/tests/Unit/TransactionRules/Actions/LinkToBillTest.php
+++ b/tests/Unit/TransactionRules/Actions/LinkToBillTest.php
@@ -1,4 +1,5 @@
set('end', new Carbon('2018-01-31'));
// mock some objects for the spent/earned lists.
- $expense = new Transaction;
- $expense->transaction_currency_code = 'EUR';
- $expense->transactionCurrency = $this->getEuro();
- $expense->transaction_amount = '-100';
- $income = new Transaction;
- $income->transaction_currency_code = 'EUR';
- $income->transactionCurrency = $this->getEuro();
- $income->transaction_amount = '100';
+ $expense = [
+ 'currency_id' => 1,
+ 'currency_code' => 'EUR',
+ 'currency_symbol' => '€',
+ 'currency_decimal_places' => 2,
+ 'amount' => -100,
+ ];
+ $income = [
+ 'currency_id' => 1,
+ 'currency_code' => 'EUR',
+ 'currency_symbol' => '€',
+ 'currency_decimal_places' => 2,
+ 'amount' => 100,
+ ];
$incomeCollection = [$income];
$expenseCollection = [$expense];
- $repository->shouldReceive('spentInPeriodCollection')->atLeast()->once()->andReturn($expenseCollection);
- $repository->shouldReceive('earnedInPeriodCollection')->atLeast()->once()->andReturn($incomeCollection);
+ $repository->shouldReceive('spentInPeriod')->atLeast()->once()->andReturn($expenseCollection);
+ $repository->shouldReceive('earnedInPeriod')->atLeast()->once()->andReturn($incomeCollection);
/** @var Category $category */
$category = Category::first();
diff --git a/tests/Unit/Transformers/CurrencyExchangeRateTransformerTest.php b/tests/Unit/Transformers/CurrencyExchangeRateTransformerTest.php
index d4d0a038ce..1f218c4047 100644
--- a/tests/Unit/Transformers/CurrencyExchangeRateTransformerTest.php
+++ b/tests/Unit/Transformers/CurrencyExchangeRateTransformerTest.php
@@ -35,6 +35,9 @@ use Tests\TestCase;
/**
*
* Class CurrencyExchangeRateTransformerTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class CurrencyExchangeRateTransformerTest extends TestCase
{
diff --git a/tests/Unit/Transformers/CurrencyTransformerTest.php b/tests/Unit/Transformers/CurrencyTransformerTest.php
index 6038cf9868..12f21f5d1e 100644
--- a/tests/Unit/Transformers/CurrencyTransformerTest.php
+++ b/tests/Unit/Transformers/CurrencyTransformerTest.php
@@ -32,6 +32,9 @@ use Tests\TestCase;
/**
* Class CurrencyTransformerTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class CurrencyTransformerTest extends TestCase
{
diff --git a/tests/Unit/Transformers/ImportJobTransformerTest.php b/tests/Unit/Transformers/ImportJobTransformerTest.php
index 546ac89195..953391d4f6 100644
--- a/tests/Unit/Transformers/ImportJobTransformerTest.php
+++ b/tests/Unit/Transformers/ImportJobTransformerTest.php
@@ -33,6 +33,9 @@ use Tests\TestCase;
/**
*
* Class ImportJobTransformerTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class ImportJobTransformerTest extends TestCase
{
diff --git a/tests/Unit/Transformers/LinkTypeTransformerTest.php b/tests/Unit/Transformers/LinkTypeTransformerTest.php
index 5988ce5a39..21dcd25c83 100644
--- a/tests/Unit/Transformers/LinkTypeTransformerTest.php
+++ b/tests/Unit/Transformers/LinkTypeTransformerTest.php
@@ -33,6 +33,9 @@ use Tests\TestCase;
/**
*
* Class LinkTypeTransformerTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class LinkTypeTransformerTest extends TestCase
{
diff --git a/tests/Unit/Transformers/PiggyBankEventTransformerTest.php b/tests/Unit/Transformers/PiggyBankEventTransformerTest.php
index 6bd8e234b7..c2ca10c1f6 100644
--- a/tests/Unit/Transformers/PiggyBankEventTransformerTest.php
+++ b/tests/Unit/Transformers/PiggyBankEventTransformerTest.php
@@ -37,6 +37,9 @@ use Tests\TestCase;
/**
* Class PiggyBankEventTransformerTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class PiggyBankEventTransformerTest extends TestCase
{
diff --git a/tests/Unit/Transformers/PiggyBankTransformerTest.php b/tests/Unit/Transformers/PiggyBankTransformerTest.php
index d66130a286..302612d106 100644
--- a/tests/Unit/Transformers/PiggyBankTransformerTest.php
+++ b/tests/Unit/Transformers/PiggyBankTransformerTest.php
@@ -37,6 +37,9 @@ use Tests\TestCase;
/**
* Class PiggyBankTransformerTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class PiggyBankTransformerTest extends TestCase
{
diff --git a/tests/Unit/Transformers/PreferenceTransformerTest.php b/tests/Unit/Transformers/PreferenceTransformerTest.php
index 4584b004a8..5c587d74d7 100644
--- a/tests/Unit/Transformers/PreferenceTransformerTest.php
+++ b/tests/Unit/Transformers/PreferenceTransformerTest.php
@@ -32,6 +32,9 @@ use Tests\TestCase;
/**
* Class PreferenceTransformerTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class PreferenceTransformerTest extends TestCase
{
diff --git a/tests/Unit/Transformers/RecurrenceTransformerTest.php b/tests/Unit/Transformers/RecurrenceTransformerTest.php
index 467b0f8bef..c20e508362 100644
--- a/tests/Unit/Transformers/RecurrenceTransformerTest.php
+++ b/tests/Unit/Transformers/RecurrenceTransformerTest.php
@@ -38,6 +38,9 @@ use Tests\TestCase;
/**
*
* Class RecurrenceTransformerTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class RecurrenceTransformerTest extends TestCase
{
diff --git a/tests/Unit/Transformers/RuleGroupTransformerTest.php b/tests/Unit/Transformers/RuleGroupTransformerTest.php
index c02ebe9aa5..103be10a60 100644
--- a/tests/Unit/Transformers/RuleGroupTransformerTest.php
+++ b/tests/Unit/Transformers/RuleGroupTransformerTest.php
@@ -31,6 +31,9 @@ use Tests\TestCase;
/**
* Class RuleGroupTransformerTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class RuleGroupTransformerTest extends TestCase
{
diff --git a/tests/Unit/Transformers/RuleTransformerTest.php b/tests/Unit/Transformers/RuleTransformerTest.php
index 447b6f132e..3489e453b0 100644
--- a/tests/Unit/Transformers/RuleTransformerTest.php
+++ b/tests/Unit/Transformers/RuleTransformerTest.php
@@ -35,6 +35,9 @@ use Tests\TestCase;
/**
* Class RuleTransformerTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class RuleTransformerTest extends TestCase
{
diff --git a/tests/Unit/Transformers/TagTransformerTest.php b/tests/Unit/Transformers/TagTransformerTest.php
index 34cdc02b0e..63e5624aa4 100644
--- a/tests/Unit/Transformers/TagTransformerTest.php
+++ b/tests/Unit/Transformers/TagTransformerTest.php
@@ -31,6 +31,9 @@ use Tests\TestCase;
/**
* Class TagTransformerTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class TagTransformerTest extends TestCase
{
diff --git a/tests/Unit/Transformers/TransactionGroupTransformerTest.php b/tests/Unit/Transformers/TransactionGroupTransformerTest.php
index 6f30836c9c..c3905bfced 100644
--- a/tests/Unit/Transformers/TransactionGroupTransformerTest.php
+++ b/tests/Unit/Transformers/TransactionGroupTransformerTest.php
@@ -1,4 +1,5 @@
transformObject($group);
}
-}
\ No newline at end of file
+}
diff --git a/tests/Unit/Transformers/TransactionLinkTransformerTest.php b/tests/Unit/Transformers/TransactionLinkTransformerTest.php
index 1ce10aae4b..06d7fc312c 100644
--- a/tests/Unit/Transformers/TransactionLinkTransformerTest.php
+++ b/tests/Unit/Transformers/TransactionLinkTransformerTest.php
@@ -32,6 +32,9 @@ use Tests\TestCase;
/**
* Class TransactionLinkTransformerTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class TransactionLinkTransformerTest extends TestCase
{
diff --git a/tests/Unit/Transformers/UserTransformerTest.php b/tests/Unit/Transformers/UserTransformerTest.php
index 9dfdcc3bb1..cd584341c8 100644
--- a/tests/Unit/Transformers/UserTransformerTest.php
+++ b/tests/Unit/Transformers/UserTransformerTest.php
@@ -31,6 +31,9 @@ use Tests\TestCase;
/**
* Class UserTransformerTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ * @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
class UserTransformerTest extends TestCase
{
diff --git a/webpack.mix.js b/webpack.mix.js
index 271a6fd2e8..9c043edcab 100644
--- a/webpack.mix.js
+++ b/webpack.mix.js
@@ -11,4 +11,4 @@ let mix = require('laravel-mix');
|
*/
-mix.js('resources/assets/js/app.js', 'public/v1/js');
\ No newline at end of file
+mix.js('resources/assets/js/app.js', 'public/v1/js');