Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Fix all level 2 issues.
James Cole1b978d41e023
diff --git a/.ci/phpstan.neon b/.ci/phpstan.neonindex d72945c553..2f266733a7 100644--- a/.ci/phpstan.neon+++ b/.ci/phpstan.neon@@ -4,10 +4,8 @@ parameters:reportUnmatchedIgnoredErrors: falsecheckGenericClassInNonGenericObjectType: false # remove this rule when all other issues are solved.ignoreErrors:+ - '#Dynamic call to static method#' # all the Laravel ORM things depend on this.- '#Control structures using switch should not be used.#' # switch is fine insome cases.- - '#Use unique name to make classes easy to recognize#'- - '#Do not name "e", shorter than 2 chars#'- - '#Do not name "q", shorter than 2 chars#'- '#with no value type specified in iterable type array#' # remove this rule when all other issues are solved.- '#has no value type specified in iterable type array#' # remove this rule when all other issues are solved.- '#is not allowed to extend#'@@ -16,7 +14,6 @@ parameters:- '#has a nullable return type declaration#'- '#with a nullable type declaration#'- '#with null as default value#'- - '#is not covariant with PHPDoc type array#'-message: '#Constructor in [a-zA-Z0-9\\_]+ has parameter \$[a-zA-Z0-9\\_]+ with default value#'paths:@@ -56,5 +53,5 @@ parameters:- ../bootstrap/app.php# The level 8 is the highest level. original was 5- level: 1+ level: 2diff --git a/app/Console/Commands/Correction/DeleteOrphanedTransactions.php b/app/Console/Commands/Correction/DeleteOrphanedTransactions.phpindex 802609decd..333ff91fe1 100644--- a/app/Console/Commands/Correction/DeleteOrphanedTransactions.php+++ b/app/Console/Commands/Correction/DeleteOrphanedTransactions.php@@ -145,7 +145,7 @@ class DeleteOrphanedTransactions extends Commandforeach ($set as $transaction) {// delete journals$journal = TransactionJournal::find((int)$transaction->transaction_journal_id);- if ($journal) {+ if (null !== $journal) {$journal->delete();}Transaction::where('transaction_journal_id', (int)$transaction->transaction_journal_id)->delete();diff --git a/app/Console/Commands/Correction/FixUnevenAmount.php b/app/Console/Commands/Correction/FixUnevenAmount.phpindex 7f3668368c..62b95de6dd 100644--- a/app/Console/Commands/Correction/FixUnevenAmount.php+++ b/app/Console/Commands/Correction/FixUnevenAmount.php@@ -95,7 +95,7 @@ class FixUnevenAmount extends Command{// one of the transactions is bad.$journal = TransactionJournal::find($param);- if (!$journal) {+ if (null === $journal) {return;}/** @var Transaction|null $source */diff --git a/app/Console/Commands/Upgrade/UpgradeLiabilitiesEight.php b/app/Console/Commands/Upgrade/UpgradeLiabilitiesEight.phpindex 8e3699eaab..bd75d43ca9 100644--- a/app/Console/Commands/Upgrade/UpgradeLiabilitiesEight.php+++ b/app/Console/Commands/Upgrade/UpgradeLiabilitiesEight.php@@ -205,7 +205,7 @@ class UpgradeLiabilitiesEight extends Command$source = $openingJournal->transactions()->where('amount', '<', 0)->first();/** @var Transaction|null $dest */$dest = $openingJournal->transactions()->where('amount', '>', 0)->first();- if ($source && $dest) {+ if (null !== $source && null !== $dest) {$sourceId = $source->account_id;$destId = $dest->account_id;$dest->account_id = $sourceId;diff --git a/app/Helpers/Update/UpdateTrait.php b/app/Helpers/Update/UpdateTrait.phpindex b76eafc99d..832623daf9 100644--- a/app/Helpers/Update/UpdateTrait.php+++ b/app/Helpers/Update/UpdateTrait.php@@ -48,7 +48,7 @@ trait UpdateTrait/** @var UpdateRequestInterface $checker */$checker = app(UpdateRequestInterface::class);$channelConfig = app('fireflyconfig')->get('update_channel', 'stable');- $channel = $channelConfig ? $channelConfig->data : 'stable';+ $channel = (string)$channelConfig->data;return $checker->getUpdateInformation($channel);}diff --git a/app/Http/Controllers/Account/EditController.php b/app/Http/Controllers/Account/EditController.phpindex 292c00ec8c..384a6a2318 100644--- a/app/Http/Controllers/Account/EditController.php+++ b/app/Http/Controllers/Account/EditController.php@@ -88,15 +88,15 @@ class EditController extends Controller$roles = $this->getRoles();$liabilityTypes = $this->getLiabilityTypes();$location = $repository->getLocation($account);- $latitude = $location ? $location->latitude : config('firefly.default_location.latitude');- $longitude = $location ? $location->longitude : config('firefly.default_location.longitude');- $zoomLevel = $location ? $location->zoom_level : config('firefly.default_location.zoom_level');+ $latitude = null !== $location ? $location->latitude : config('firefly.default_location.latitude');+ $longitude = null !== $location ? $location->longitude : config('firefly.default_location.longitude');+ $zoomLevel = null !== $location ? $location->zoom_level : config('firefly.default_location.zoom_level');$hasLocation = null !== $location;$locations = ['location' => [- 'latitude' => old('location_latitude') ?? $latitude,- 'longitude' => old('location_longitude') ?? $longitude,- 'zoom_level' => old('location_zoom_level') ?? $zoomLevel,+ 'latitude' => null !== old('location_latitude') ? old('location_latitude'): $latitude,+ 'longitude' => null !== old('location_longitude') ? old('location_longitude') : $longitude,+ 'zoom_level' => null !== old('location_zoom_level') ? old('location_zoom_level') : $zoomLevel,'has_location' => $hasLocation || 'true' === old('location_has_location'),],];diff --git a/app/Http/Controllers/Bill/EditController.php b/app/Http/Controllers/Bill/EditController.phpindex f3f9e935cb..d9b692e825 100644--- a/app/Http/Controllers/Bill/EditController.php+++ b/app/Http/Controllers/Bill/EditController.php@@ -103,7 +103,7 @@ class EditController extends Controller'notes' => $this->repository->getNoteText($bill),'transaction_currency_id' => $bill->transaction_currency_id,'active' => $hasOldInput ? (bool)$request->old('active') : $bill->active,- 'object_group' => $bill->objectGroups->first() ? $bill->objectGroups->first()->title : '',+ 'object_group' => null !== $bill->objectGroups->first() ? $bill->objectGroups->first()->title : '',];$request->session()->flash('preFilled', $preFilled);diff --git a/app/Http/Controllers/Budget/EditController.php b/app/Http/Controllers/Budget/EditController.phpindex 76a2bedbcd..cba15a857d 100644--- a/app/Http/Controllers/Budget/EditController.php+++ b/app/Http/Controllers/Budget/EditController.php@@ -100,7 +100,7 @@ class EditController extends Controller'active' => $hasOldInput ? (bool)$request->old('active') : $budget->active,'auto_budget_currency_id' => $hasOldInput ? (int)$request->old('auto_budget_currency_id') : $currency->id,];- if ($autoBudget) {+ if (null !== $autoBudget) {$amount = $hasOldInput ? $request->old('auto_budget_amount') : $autoBudget->amount;$preFilled['auto_budget_amount'] = app('steam')->bcround($amount, $autoBudget->transactionCurrency->decimal_places);}diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.phpindex bccf11d3a2..6b89c0464b 100644--- a/app/Http/Controllers/Controller.php+++ b/app/Http/Controllers/Controller.php@@ -57,7 +57,7 @@ abstract class Controller extends BaseController{// is site a demo site?$isDemoSiteConfig = app('fireflyconfig')->get('is_demo_site', config('firefly.configuration.is_demo_site', false));- $isDemoSite = $isDemoSiteConfig ? $isDemoSiteConfig->data : false;+ $isDemoSite = (bool) $isDemoSiteConfig->data;app('view')->share('IS_DEMO_SITE', $isDemoSite);app('view')->share('DEMO_USERNAME', config('firefly.demo_username'));app('view')->share('DEMO_PASSWORD', config('firefly.demo_password'));diff --git a/app/Http/Controllers/DebugController.php b/app/Http/Controllers/DebugController.phpindex 002222f5ac..3badb00404 100644--- a/app/Http/Controllers/DebugController.php+++ b/app/Http/Controllers/DebugController.php@@ -314,7 +314,7 @@ class DebugController extends Controller// has stored reconciliations$type = TransactionType::whereType(TransactionType::RECONCILIATION)->first();- if ($user->transactionJournals()->where('transaction_type_id', $type->id)->count()) {+ if ($user->transactionJournals()->where('transaction_type_id', $type->id)->count() > 0) {$flags[] = '<span title="Has reconciled">:ledger:</span>';}diff --git a/app/Http/Controllers/PiggyBank/EditController.php b/app/Http/Controllers/PiggyBank/EditController.phpindex d6c11b841f..a8605716be 100644--- a/app/Http/Controllers/PiggyBank/EditController.php+++ b/app/Http/Controllers/PiggyBank/EditController.php@@ -93,7 +93,7 @@ class EditController extends Controller'targetamount' => app('steam')->bcround($piggyBank->targetamount, $currency->decimal_places),'targetdate' => $targetDate,'startdate' => $startDate,- 'object_group' => $piggyBank->objectGroups->first() ? $piggyBank->objectGroups->first()->title : '',+ 'object_group' => null !== $piggyBank->objectGroups->first() ? $piggyBank->objectGroups->first()->title : '','notes' => null === $note ? '' : $note->text,];if (0 === bccomp($piggyBank->targetamount, '0')) {diff --git a/app/Http/Controllers/Recurring/CreateController.php b/app/Http/Controllers/Recurring/CreateController.phpindex ac51114be3..71fe0dd453 100644--- a/app/Http/Controllers/Recurring/CreateController.php+++ b/app/Http/Controllers/Recurring/CreateController.php@@ -163,9 +163,9 @@ class CreateController extends Controller$source = $journal->transactions()->where('amount', '<', 0)->first();/** @var Transaction $dest */$dest = $journal->transactions()->where('amount', '>', 0)->first();- $category = $journal->categories()->first() ? $journal->categories()->first()->name : '';- $budget = $journal->budgets()->first() ? $journal->budgets()->first()->id : 0;- $bill = $journal->bill ? $journal->bill->id : 0;+ $category = null !== $journal->categories()->first() ? $journal->categories()->first()->name : '';+ $budget = null !== $journal->budgets()->first() ? $journal->budgets()->first()->id : 0;+ $bill = null !== $journal->bill ? $journal->bill->id : 0;$hasOldInput = null !== $request->old('_token'); // flash some data$preFilled = [];if (true === $hasOldInput) {diff --git a/app/Http/Controllers/Rule/CreateController.php b/app/Http/Controllers/Rule/CreateController.phpindex 9268c3f2b7..49dcf5ebc6 100644--- a/app/Http/Controllers/Rule/CreateController.php+++ b/app/Http/Controllers/Rule/CreateController.php@@ -106,7 +106,7 @@ class CreateController extends Controller}// restore actions and triggers from old input:- if ($request->old()) {+ if (null !== $request->old()) {$oldTriggers = $this->getPreviousTriggers($request);$oldActions = $this->getPreviousActions($request);}@@ -163,7 +163,7 @@ class CreateController extends Controller$oldActions = $this->getActionsForBill($bill);// restore actions and triggers from old input:- if ($request->old()) {+ if (null !== $request->old()) {$oldTriggers = $this->getPreviousTriggers($request);$oldActions = $this->getPreviousActions($request);}@@ -172,7 +172,7 @@ class CreateController extends Controller$actionCount = count($oldActions);$subTitleIcon = 'fa-clone';- // title depends on whether or not there is a rule group:+ // title depends on whether there is a rule group:$subTitle = (string)trans('firefly.make_new_rule_no_group');// flash old data@@ -218,7 +218,7 @@ class CreateController extends Controller];// restore actions and triggers from old input:- if ($request->old()) {+ if (null !== $request->old()) {$oldTriggers = $this->getPreviousTriggers($request);$oldActions = $this->getPreviousActions($request);}diff --git a/app/Http/Controllers/TagController.php b/app/Http/Controllers/TagController.phpindex c5a320e5d4..691b36446f 100644--- a/app/Http/Controllers/TagController.php+++ b/app/Http/Controllers/TagController.php@@ -129,9 +129,9 @@ class TagController extends Controller$subTitleIcon = 'fa-tag';$location = $this->repository->getLocation($tag);- $latitude = $location ? $location->latitude : config('firefly.default_location.latitude');- $longitude = $location ? $location->longitude : config('firefly.default_location.longitude');- $zoomLevel = $location ? $location->zoom_level : config('firefly.default_location.zoom_level');+ $latitude = null !== $location ? $location->latitude : config('firefly.default_location.latitude');+ $longitude = null !== $location ? $location->longitude : config('firefly.default_location.longitude');+ $zoomLevel = null !== $location ? $location->zoom_level : config('firefly.default_location.zoom_level');$hasLocation = null !== $location;$locations = ['location' => [diff --git a/app/Http/Controllers/Transaction/IndexController.php b/app/Http/Controllers/Transaction/IndexController.phpindex 74636f6fb2..895e2f5b93 100644--- a/app/Http/Controllers/Transaction/IndexController.php+++ b/app/Http/Controllers/Transaction/IndexController.php@@ -96,7 +96,7 @@ class IndexController extends Controllerif (null === $end) {// get last transaction ever?$last = $this->repository->getLast();- $end = $last ? $last->date : session('end');+ $end = null !== $last ? $last->date : session('end');}[$start, $end] = $end < $start ? [$end, $start] : [$start, $end];@@ -147,7 +147,7 @@ class IndexController extends Controller$first = $this->repository->firstNull();$start = null === $first ? new Carbon() : $first->date;$last = $this->repository->getLast();- $end = $last ? $last->date : today(config('app.timezone'));+ $end = null !== $last ? $last->date : today(config('app.timezone'));$subTitle = (string)trans('firefly.all_' . $objectType);/** @var GroupCollectorInterface $collector */diff --git a/app/Http/Middleware/Range.php b/app/Http/Middleware/Range.phpindex cea497895e..602ad020c6 100644--- a/app/Http/Middleware/Range.php+++ b/app/Http/Middleware/Range.php@@ -47,7 +47,7 @@ class Range*/public function handle(Request $request, Closure $next){- if ($request->user()) {+ if (null !== $request->user()) {// set start, end and finish:$this->setRange();diff --git a/app/Models/Account.php b/app/Models/Account.phpindex 85bf92b8c1..b44c7ecac2 100644--- a/app/Models/Account.php+++ b/app/Models/Account.php@@ -190,7 +190,7 @@ class Account extends Model->where('name', 'account_number')->first();- return $metaValue ? $metaValue->data : '';+ return null !== $metaValue ? $metaValue->data : '';}/**diff --git a/app/Models/TransactionJournalLink.php b/app/Models/TransactionJournalLink.phpindex fc7bcb5eae..69299ca605 100644--- a/app/Models/TransactionJournalLink.php+++ b/app/Models/TransactionJournalLink.php@@ -23,22 +23,22 @@ declare(strict_types=1);namespace FireflyIII\Models;+use Carbon\Carbon;use Eloquent;use Illuminate\Database\Eloquent\Builder;use Illuminate\Database\Eloquent\Collection;use Illuminate\Database\Eloquent\Model;use Illuminate\Database\Eloquent\Relations\BelongsTo;use Illuminate\Database\Eloquent\Relations\MorphMany;-use Carbon\Carbon;use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;/*** FireflyIII\Models\TransactionJournalLink*- * @property int|string $id+ * @property int|string $id* @property Carbon|null $created_at* @property Carbon|null $updated_at- * @property |stringint $link_type_id+ * @property string|int $link_type_id* @property int $source_id* @property int $destination_id* @property string|null $commentdiff --git a/app/Repositories/Account/AccountRepository.php b/app/Repositories/Account/AccountRepository.phpindex 52111fb3ee..e8d357ffe2 100644--- a/app/Repositories/Account/AccountRepository.php+++ b/app/Repositories/Account/AccountRepository.php@@ -250,7 +250,7 @@ class AccountRepository implements AccountRepositoryInterfacestatic function (Attachment $attachment) use ($disk) {$notes = $attachment->notes()->first();$attachment->file_exists = $disk->exists($attachment->fileName());- $attachment->notes_text = $notes ? $notes->text : '';+ $attachment->notes_text = null !== $notes ? $notes->text : '';return $attachment;}diff --git a/app/Repositories/Bill/BillRepository.php b/app/Repositories/Bill/BillRepository.phpindex df765dd005..59f212f5a0 100644--- a/app/Repositories/Bill/BillRepository.php+++ b/app/Repositories/Bill/BillRepository.php@@ -199,7 +199,7 @@ class BillRepository implements BillRepositoryInterfacestatic function (Attachment $attachment) use ($disk) {$notes = $attachment->notes()->first();$attachment->file_exists = $disk->exists($attachment->fileName());- $attachment->notes_text = $notes ? $notes->text : '';+ $attachment->notes_text = null !== $notes ? $notes->text : '';return $attachment;}@@ -373,12 +373,12 @@ class BillRepository implements BillRepositoryInterfacereturn $bill->transactionJournals()->before($end)->after($start)->get(- [+ ['transaction_journals.id','transaction_journals.date','transaction_journals.transaction_group_id',]- );+ );}/**diff --git a/app/Repositories/Budget/BudgetRepository.php b/app/Repositories/Budget/BudgetRepository.phpindex a99b8769f7..b2451853f8 100644--- a/app/Repositories/Budget/BudgetRepository.php+++ b/app/Repositories/Budget/BudgetRepository.php@@ -589,7 +589,7 @@ class BudgetRepository implements BudgetRepositoryInterfacestatic function (Attachment $attachment) use ($disk) {$notes = $attachment->notes()->first();$attachment->file_exists = $disk->exists($attachment->fileName());- $attachment->notes_text = $notes ? $notes->text : '';+ $attachment->notes_text = null !== $notes ? $notes->text : '';return $attachment;}diff --git a/app/Repositories/Category/CategoryRepository.php b/app/Repositories/Category/CategoryRepository.phpindex 06422c0bde..d3d67b281a 100644--- a/app/Repositories/Category/CategoryRepository.php+++ b/app/Repositories/Category/CategoryRepository.php@@ -306,7 +306,7 @@ class CategoryRepository implements CategoryRepositoryInterfacestatic function (Attachment $attachment) use ($disk) {$notes = $attachment->notes()->first();$attachment->file_exists = $disk->exists($attachment->fileName());- $attachment->notes_text = $notes ? $notes->text : '';+ $attachment->notes_text = null !== $notes ? $notes->text : '';return $attachment;}diff --git a/app/Repositories/Journal/JournalAPIRepository.php b/app/Repositories/Journal/JournalAPIRepository.phpindex b3d6e43710..55b3020092 100644--- a/app/Repositories/Journal/JournalAPIRepository.php+++ b/app/Repositories/Journal/JournalAPIRepository.php@@ -74,7 +74,7 @@ class JournalAPIRepository implements JournalAPIRepositoryInterfacestatic function (Attachment $attachment) use ($disk) {$notes = $attachment->notes()->first();$attachment->file_exists = $disk->exists($attachment->fileName());- $attachment->notes_text = $notes ? $notes->text : ''; // TODO should not set notes like this.+ $attachment->notes_text = null !== $notes ? $notes->text : ''; // TODO should not set notes like this.return $attachment;}diff --git a/app/Repositories/PiggyBank/PiggyBankRepository.php b/app/Repositories/PiggyBank/PiggyBankRepository.phpindex 7f8e943f06..a1e95044ba 100644--- a/app/Repositories/PiggyBank/PiggyBankRepository.php+++ b/app/Repositories/PiggyBank/PiggyBankRepository.php@@ -125,7 +125,7 @@ class PiggyBankRepository implements PiggyBankRepositoryInterfacestatic function (Attachment $attachment) use ($disk) {$notes = $attachment->notes()->first();$attachment->file_exists = $disk->exists($attachment->fileName());- $attachment->notes_text = $notes ? $notes->text : '';+ $attachment->notes_text = null !== $notes ? $notes->text : '';return $attachment;}diff --git a/app/Repositories/User/UserRepository.php b/app/Repositories/User/UserRepository.phpindex 08be427390..b2430d05ed 100644--- a/app/Repositories/User/UserRepository.php+++ b/app/Repositories/User/UserRepository.php@@ -335,7 +335,7 @@ class UserRepository implements UserRepositoryInterfacepublic function redeemCode(string $code): void{$obj = InvitedUser::where('invite_code', $code)->where('redeemed', 0)->first();- if ($obj) {+ if (null !== $obj) {$obj->redeemed = true;$obj->save();}diff --git a/app/Support/FireflyConfig.php b/app/Support/FireflyConfig.phpindex cc863b3c3f..5f5e7026a7 100644--- a/app/Support/FireflyConfig.php+++ b/app/Support/FireflyConfig.php@@ -136,7 +136,7 @@ class FireflyConfigpublic function getFresh(string $name, $default = null): ?Configuration{$config = Configuration::where('name', $name)->first(['id', 'name', 'data']);- if ($config) {+ if (null !== $config) {return $config;}// no preference found and default is null:diff --git a/app/Support/Request/AppendsLocationData.php b/app/Support/Request/AppendsLocationData.phpindex 0157c03fb7..2ab227f431 100644--- a/app/Support/Request/AppendsLocationData.php+++ b/app/Support/Request/AppendsLocationData.php@@ -134,7 +134,7 @@ trait AppendsLocationDatareturn true;}// if is POST and route does not contain API, must also have "has_location" = true- if ('POST' === $this->method() && $this->routeIs('*.store') && !$this->routeIs('api.v1.*') && $hasLocationKey) {+ if ('POST' === $this->method() && $this->routeIs('*.store') && !$this->routeIs('api.v1.*') && '' !== $hasLocationKey) {app('log')->debug('Is POST + store route.');$hasLocation = $this->boolean($hasLocationKey);if (true === $hasLocation) {@@ -205,7 +205,7 @@ trait AppendsLocationData}// if POST and not API route, must also have "has_location"// if is POST and route does not contain API, must also have "has_location" = true- if ('POST' === $this->method() && $this->routeIs('*.update') && !$this->routeIs('api.v1.*') && $hasLocationKey) {+ if ('POST' === $this->method() && $this->routeIs('*.update') && !$this->routeIs('api.v1.*') && '' !== $hasLocationKey) {app('log')->debug('Is POST + store route.');$hasLocation = $this->boolean($hasLocationKey);if (true === $hasLocation) {diff --git a/app/Support/Steam.php b/app/Support/Steam.phpindex 6461055fbb..c741f58a8e 100644--- a/app/Support/Steam.php+++ b/app/Support/Steam.php@@ -117,7 +117,7 @@ class Steam$cache = new CacheProperties();$cache->addProperty($account->id);$cache->addProperty('balance-in-range');- $cache->addProperty($currency ? $currency->id : 0);+ $cache->addProperty(null !== $currency ? $currency->id : 0);$cache->addProperty($start);$cache->addProperty($end);if ($cache->has()) {@@ -204,7 +204,7 @@ class Steam$cache->addProperty($account->id);$cache->addProperty('balance');$cache->addProperty($date);- $cache->addProperty($currency ? $currency->id : 0);+ $cache->addProperty(null !== $currency ? $currency->id : 0);if ($cache->has()) {return $cache->get();}diff --git a/app/Transformers/BillTransformer.php b/app/Transformers/BillTransformer.phpindex f5d13ec85a..a1ed960e7f 100644--- a/app/Transformers/BillTransformer.php+++ b/app/Transformers/BillTransformer.php@@ -123,7 +123,7 @@ class BillTransformer extends AbstractTransformer'active' => $bill->active,'order' => (int)$bill->order,'notes' => $notes,- 'object_group_id' => $objectGroupId ? (string)$objectGroupId : null,+ 'object_group_id' => null !== $objectGroupId ? (string)$objectGroupId : null,'object_group_order' => $objectGroupOrder,'object_group_title' => $objectGroupTitle,diff --git a/app/Transformers/PiggyBankEventTransformer.php b/app/Transformers/PiggyBankEventTransformer.phpindex 3706b1c362..f1e8511e4b 100644--- a/app/Transformers/PiggyBankEventTransformer.php+++ b/app/Transformers/PiggyBankEventTransformer.php@@ -86,8 +86,8 @@ class PiggyBankEventTransformer extends AbstractTransformer'currency_code' => $currency->code,'currency_symbol' => $currency->symbol,'currency_decimal_places' => (int)$currency->decimal_places,- 'transaction_journal_id' => $journalId ? (string)$journalId : null,- 'transaction_group_id' => $groupId ? (string)$groupId : null,+ 'transaction_journal_id' => null !== $journalId ? (string)$journalId : null,+ 'transaction_group_id' => null !== $groupId ? (string)$groupId : null,'links' => [['rel' => 'self',diff --git a/app/Transformers/PiggyBankTransformer.php b/app/Transformers/PiggyBankTransformer.phpindex de320841b2..33eb503b19 100644--- a/app/Transformers/PiggyBankTransformer.php+++ b/app/Transformers/PiggyBankTransformer.php@@ -123,7 +123,7 @@ class PiggyBankTransformer extends AbstractTransformer'order' => (int)$piggyBank->order,'active' => true,'notes' => $notes,- 'object_group_id' => $objectGroupId ? (string)$objectGroupId : null,+ 'object_group_id' => null !== $objectGroupId ? (string)$objectGroupId : null,'object_group_order' => $objectGroupOrder,'object_group_title' => $objectGroupTitle,'links' => [diff --git a/app/Validation/RecurrenceValidation.php b/app/Validation/RecurrenceValidation.phpindex 1e85e391e5..0c245d5c47 100644--- a/app/Validation/RecurrenceValidation.php+++ b/app/Validation/RecurrenceValidation.php@@ -61,7 +61,7 @@ trait RecurrenceValidation/** @var RecurrenceTransaction|null $first */$first = $recurrence->recurrenceTransactions()->first();if (null !== $first) {- $transactionType = $first->transactionType ? $first->transactionType->type : 'withdrawal';+ $transactionType = null !== $first->transactionType ? $first->transactionType->type : 'withdrawal';app('log')->debug(sprintf('Determined type to be %s.', $transactionType));}if (null === $first) {