@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | $set = [ |
214 | 214 | 'journal' => $journal, |
215 | 215 | 'name' => $field, |
216 | - 'data' => (string) ($data[$field] ?? ''), |
|
216 | + 'data' => (string)($data[$field] ?? ''), |
|
217 | 217 | ]; |
218 | 218 | |
219 | 219 | Log::debug(sprintf('Going to store meta-field "%s", with value "%s".', $set['name'], $set['data'])); |
@@ -260,11 +260,11 @@ discard block |
||
260 | 260 | $type = $this->typeRepository->findTransactionType(null, $row['type']); |
261 | 261 | $carbon = $row['date'] ?? today(config('app.timezone')); |
262 | 262 | $order = $row['order'] ?? 0; |
263 | - $currency = $this->currencyRepository->findCurrency((int) $row['currency_id'], $row['currency_code']); |
|
263 | + $currency = $this->currencyRepository->findCurrency((int)$row['currency_id'], $row['currency_code']); |
|
264 | 264 | $foreignCurrency = $this->currencyRepository->findCurrencyNull($row['foreign_currency_id'], $row['foreign_currency_code']); |
265 | - $bill = $this->billRepository->findBill((int) $row['bill_id'], $row['bill_name']); |
|
265 | + $bill = $this->billRepository->findBill((int)$row['bill_id'], $row['bill_name']); |
|
266 | 266 | $billId = TransactionType::WITHDRAWAL === $type->type && null !== $bill ? $bill->id : null; |
267 | - $description = app('steam')->cleanString((string) $row['description']); |
|
267 | + $description = app('steam')->cleanString((string)$row['description']); |
|
268 | 268 | |
269 | 269 | /** Manipulate basic fields */ |
270 | 270 | $carbon->setTimezone(config('app.timezone')); |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | |
284 | 284 | /** create or get source and destination accounts */ |
285 | 285 | $sourceInfo = [ |
286 | - 'id' => (int) $row['source_id'], |
|
286 | + 'id' => (int)$row['source_id'], |
|
287 | 287 | 'name' => $row['source_name'], |
288 | 288 | 'iban' => $row['source_iban'], |
289 | 289 | 'number' => $row['source_number'], |
@@ -292,7 +292,7 @@ discard block |
||
292 | 292 | ]; |
293 | 293 | |
294 | 294 | $destInfo = [ |
295 | - 'id' => (int) $row['destination_id'], |
|
295 | + 'id' => (int)$row['destination_id'], |
|
296 | 296 | 'name' => $row['destination_name'], |
297 | 297 | 'iban' => $row['destination_iban'], |
298 | 298 | 'number' => $row['destination_number'], |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | $transactionFactory->setForeignCurrency($foreignCurrency); |
338 | 338 | $transactionFactory->setReconciled($row['reconciled'] ?? false); |
339 | 339 | try { |
340 | - $negative = $transactionFactory->createNegative((string) $row['amount'], (string) $row['foreign_amount']); |
|
340 | + $negative = $transactionFactory->createNegative((string)$row['amount'], (string)$row['foreign_amount']); |
|
341 | 341 | } catch (FireflyException $e) { |
342 | 342 | Log::error('Exception creating negative transaction.'); |
343 | 343 | Log::error($e->getMessage()); |
@@ -356,7 +356,7 @@ discard block |
||
356 | 356 | $transactionFactory->setForeignCurrency($foreignCurrency); |
357 | 357 | $transactionFactory->setReconciled($row['reconciled'] ?? false); |
358 | 358 | try { |
359 | - $transactionFactory->createPositive((string) $row['amount'], (string) $row['foreign_amount']); |
|
359 | + $transactionFactory->createPositive((string)$row['amount'], (string)$row['foreign_amount']); |
|
360 | 360 | } catch (FireflyException $e) { |
361 | 361 | Log::error('Exception creating positive transaction.'); |
362 | 362 | Log::error($e->getMessage()); |
@@ -537,7 +537,7 @@ discard block |
||
537 | 537 | $json = json_encode($dataRow, JSON_THROW_ON_ERROR, 512); |
538 | 538 | if (false === $json) { |
539 | 539 | // @codeCoverageIgnoreStart |
540 | - $json = json_encode((string) microtime(), JSON_THROW_ON_ERROR, 512); |
|
540 | + $json = json_encode((string)microtime(), JSON_THROW_ON_ERROR, 512); |
|
541 | 541 | Log::error(sprintf('Could not hash the original row! %s', json_last_error_msg()), $dataRow); |
542 | 542 | // @codeCoverageIgnoreEnd |
543 | 543 | } |
@@ -573,7 +573,7 @@ discard block |
||
573 | 573 | return; |
574 | 574 | } |
575 | 575 | |
576 | - $piggyBank = $this->piggyRepository->findPiggyBank((int) $data['piggy_bank_id'], $data['piggy_bank_name']); |
|
576 | + $piggyBank = $this->piggyRepository->findPiggyBank((int)$data['piggy_bank_id'], $data['piggy_bank_name']); |
|
577 | 577 | |
578 | 578 | if (null !== $piggyBank) { |
579 | 579 | $this->piggyEventFactory->create($journal, $piggyBank); |
@@ -596,8 +596,8 @@ discard block |
||
596 | 596 | $this->accountValidator->setTransactionType($transactionType); |
597 | 597 | |
598 | 598 | // validate source account. |
599 | - $sourceId = $data['source_id'] ? (int) $data['source_id'] : null; |
|
600 | - $sourceName = $data['source_name'] ? (string) $data['source_name'] : null; |
|
599 | + $sourceId = $data['source_id'] ? (int)$data['source_id'] : null; |
|
600 | + $sourceName = $data['source_name'] ? (string)$data['source_name'] : null; |
|
601 | 601 | $validSource = $this->accountValidator->validateSource($sourceId, $sourceName, null); |
602 | 602 | |
603 | 603 | // do something with result: |
@@ -606,8 +606,8 @@ discard block |
||
606 | 606 | } |
607 | 607 | Log::debug('Source seems valid.'); |
608 | 608 | // validate destination account |
609 | - $destinationId = $data['destination_id'] ? (int) $data['destination_id'] : null; |
|
610 | - $destinationName = $data['destination_name'] ? (string) $data['destination_name'] : null; |
|
609 | + $destinationId = $data['destination_id'] ? (int)$data['destination_id'] : null; |
|
610 | + $destinationName = $data['destination_name'] ? (string)$data['destination_name'] : null; |
|
611 | 611 | $validDestination = $this->accountValidator->validateDestination($destinationId, $destinationName, null); |
612 | 612 | // do something with result: |
613 | 613 | if (false === $validDestination) { |
@@ -102,9 +102,9 @@ discard block |
||
102 | 102 | public function canAddAmount(PiggyBank $piggyBank, string $amount): bool |
103 | 103 | { |
104 | 104 | $leftOnAccount = $this->leftOnAccount($piggyBank, today(config('app.timezone'))); |
105 | - $savedSoFar = (string) $this->getRepetition($piggyBank)->currentamount; |
|
105 | + $savedSoFar = (string)$this->getRepetition($piggyBank)->currentamount; |
|
106 | 106 | $leftToSave = bcsub($piggyBank->targetamount, $savedSoFar); |
107 | - $maxAmount = (string) min(round($leftOnAccount, 12), round($leftToSave, 12)); |
|
107 | + $maxAmount = (string)min(round($leftOnAccount, 12), round($leftToSave, 12)); |
|
108 | 108 | $compare = bccomp($amount, $maxAmount); |
109 | 109 | $result = $compare <= 0; |
110 | 110 | |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | $set = $this->user->piggyBanks()->orderBy('order', 'ASC')->get(); |
143 | 143 | $current = 1; |
144 | 144 | foreach ($set as $piggyBank) { |
145 | - if ((int) $piggyBank->order !== $current) { |
|
145 | + if ((int)$piggyBank->order !== $current) { |
|
146 | 146 | $piggyBank->order = $current; |
147 | 147 | $piggyBank->save(); |
148 | 148 | } |
@@ -316,7 +316,7 @@ discard block |
||
316 | 316 | } |
317 | 317 | } |
318 | 318 | // try also with ID: |
319 | - $objectGroupId = (int) ($data['object_group_id'] ?? 0); |
|
319 | + $objectGroupId = (int)($data['object_group_id'] ?? 0); |
|
320 | 320 | if (0 !== $objectGroupId) { |
321 | 321 | $objectGroup = $this->findObjectGroupById($objectGroupId); |
322 | 322 | if (null !== $objectGroup) { |
@@ -340,7 +340,7 @@ discard block |
||
340 | 340 | $piggyBank->name = $data['name']; |
341 | 341 | } |
342 | 342 | if (isset($data['account_id']) && 0 !== $data['account_id']) { |
343 | - $piggyBank->account_id = (int) $data['account_id']; |
|
343 | + $piggyBank->account_id = (int)$data['account_id']; |
|
344 | 344 | } |
345 | 345 | if (isset($data['targetamount']) && '' !== $data['targetamount']) { |
346 | 346 | $piggyBank->targetamount = $data['targetamount']; |
@@ -354,8 +354,8 @@ discard block |
||
354 | 354 | $this->updateNote($piggyBank, $data['notes'] ?? ''); |
355 | 355 | |
356 | 356 | // update the order of the piggy bank: |
357 | - $oldOrder = (int) $piggyBank->order; |
|
358 | - $newOrder = (int) ($data['order'] ?? $oldOrder); |
|
357 | + $oldOrder = (int)$piggyBank->order; |
|
358 | + $newOrder = (int)($data['order'] ?? $oldOrder); |
|
359 | 359 | if ($oldOrder !== $newOrder) { |
360 | 360 | $this->updateOrder($piggyBank, $oldOrder, $newOrder); |
361 | 361 | } |
@@ -382,7 +382,7 @@ discard block |
||
382 | 382 | } |
383 | 383 | } |
384 | 384 | // try also with ID: |
385 | - $objectGroupId = (int) ($data['object_group_id'] ?? 0); |
|
385 | + $objectGroupId = (int)($data['object_group_id'] ?? 0); |
|
386 | 386 | if (0 !== $objectGroupId) { |
387 | 387 | $objectGroup = $this->findObjectGroupById($objectGroupId); |
388 | 388 | if (null !== $objectGroup) { |
@@ -66,10 +66,10 @@ discard block |
||
66 | 66 | Log::warning('Twig TransactionGroup::journalGetMetaDate should NOT be called in the TEST environment!'); |
67 | 67 | } |
68 | 68 | $entry = DB::table('journal_meta') |
69 | - ->where('name', $metaField) |
|
70 | - ->where('transaction_journal_id', $journalId) |
|
71 | - ->whereNull('deleted_at') |
|
72 | - ->first(); |
|
69 | + ->where('name', $metaField) |
|
70 | + ->where('transaction_journal_id', $journalId) |
|
71 | + ->whereNull('deleted_at') |
|
72 | + ->first(); |
|
73 | 73 | if (null === $entry) { |
74 | 74 | return today(config('app.timezone')); |
75 | 75 | } |
@@ -91,10 +91,10 @@ discard block |
||
91 | 91 | Log::warning('Twig TransactionGroup::journalGetMetaField should NOT be called in the TEST environment!'); |
92 | 92 | } |
93 | 93 | $entry = DB::table('journal_meta') |
94 | - ->where('name', $metaField) |
|
95 | - ->where('transaction_journal_id', $journalId) |
|
96 | - ->whereNull('deleted_at') |
|
97 | - ->first(); |
|
94 | + ->where('name', $metaField) |
|
95 | + ->where('transaction_journal_id', $journalId) |
|
96 | + ->whereNull('deleted_at') |
|
97 | + ->first(); |
|
98 | 98 | if (null === $entry) { |
99 | 99 | return ''; |
100 | 100 | } |
@@ -113,10 +113,10 @@ discard block |
||
113 | 113 | 'journalHasMeta', |
114 | 114 | static function (int $journalId, string $metaField) { |
115 | 115 | $count = DB::table('journal_meta') |
116 | - ->where('name', $metaField) |
|
117 | - ->where('transaction_journal_id', $journalId) |
|
118 | - ->whereNull('deleted_at') |
|
119 | - ->count(); |
|
116 | + ->where('name', $metaField) |
|
117 | + ->where('transaction_journal_id', $journalId) |
|
118 | + ->whereNull('deleted_at') |
|
119 | + ->count(); |
|
120 | 120 | |
121 | 121 | return 1 === $count; |
122 | 122 | } |
@@ -102,13 +102,13 @@ discard block |
||
102 | 102 | ]; |
103 | 103 | try { |
104 | 104 | $result = $client->post($url, $options); |
105 | - } catch (GuzzleException|Exception $e) { |
|
105 | + } catch (GuzzleException | Exception $e) { |
|
106 | 106 | Log::error($e->getMessage()); |
107 | 107 | Log::error($e->getTraceAsString()); |
108 | 108 | Log::error('Could not submit telemetry.'); |
109 | 109 | throw new FireflyException(sprintf('Could not submit telemetry: %s', $e->getMessage())); |
110 | 110 | } |
111 | - $body = (string) $result->getBody(); |
|
111 | + $body = (string)$result->getBody(); |
|
112 | 112 | $statusCode = $result->getStatusCode(); |
113 | 113 | Log::info(sprintf('Result of submission [%d]: %s', $statusCode, $body)); |
114 | 114 | if (200 === $statusCode) { |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | private function markAsSubmitted(Collection $telemetry): void |
151 | 151 | { |
152 | 152 | $telemetry->each( |
153 | - static function (Telemetry $entry) { |
|
153 | + static function(Telemetry $entry) { |
|
154 | 154 | $entry->submitted = today(config('app.timezone')); |
155 | 155 | $entry->save(); |
156 | 156 | } |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | $collection = new Collection; |
64 | 64 | if (is_array($set)) { |
65 | 65 | foreach ($set as $accountId) { |
66 | - $account = $repository->findNull((int) $accountId); |
|
66 | + $account = $repository->findNull((int)$accountId); |
|
67 | 67 | if (null !== $account) { |
68 | 68 | $collection->push($account); |
69 | 69 | } |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | $collection = new Collection; |
87 | 87 | if (is_array($set)) { |
88 | 88 | foreach ($set as $budgetId) { |
89 | - $budget = $repository->findNull((int) $budgetId); |
|
89 | + $budget = $repository->findNull((int)$budgetId); |
|
90 | 90 | if (null !== $budget) { |
91 | 91 | $collection->push($budget); |
92 | 92 | } |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | $collection = new Collection; |
110 | 110 | if (is_array($set)) { |
111 | 111 | foreach ($set as $categoryId) { |
112 | - $category = $repository->findNull((int) $categoryId); |
|
112 | + $category = $repository->findNull((int)$categoryId); |
|
113 | 113 | if (null !== $category) { |
114 | 114 | $collection->push($category); |
115 | 115 | } |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | $collection = new Collection; |
133 | 133 | if (is_array($set)) { |
134 | 134 | foreach ($set as $accountId) { |
135 | - $account = $repository->findNull((int) $accountId); |
|
135 | + $account = $repository->findNull((int)$accountId); |
|
136 | 136 | if (null !== $account) { |
137 | 137 | $collection->push($account); |
138 | 138 | } |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | { |
154 | 154 | $date = today(config('app.timezone')); |
155 | 155 | $range = $this->get('daterange'); |
156 | - $parts = explode(' - ', (string) $range); |
|
156 | + $parts = explode(' - ', (string)$range); |
|
157 | 157 | if (2 === count($parts)) { |
158 | 158 | try { |
159 | 159 | $date = new Carbon($parts[1]); |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | { |
182 | 182 | $date = today(config('app.timezone')); |
183 | 183 | $range = $this->get('daterange'); |
184 | - $parts = explode(' - ', (string) $range); |
|
184 | + $parts = explode(' - ', (string)$range); |
|
185 | 185 | if (2 === count($parts)) { |
186 | 186 | try { |
187 | 187 | $date = new Carbon($parts[0]); |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | $collection->push($tag); |
218 | 218 | continue; |
219 | 219 | } |
220 | - $tag = $repository->findNull((int) $tagTag); |
|
220 | + $tag = $repository->findNull((int)$tagTag); |
|
221 | 221 | if (null !== $tag) { |
222 | 222 | $collection->push($tag); |
223 | 223 | continue; |
@@ -62,9 +62,9 @@ discard block |
||
62 | 62 | |
63 | 63 | // translations: |
64 | 64 | $this->middleware( |
65 | - function ($request, $next) { |
|
65 | + function($request, $next) { |
|
66 | 66 | app('view')->share('mainTitleIcon', 'fa-credit-card'); |
67 | - app('view')->share('title', (string) trans('firefly.accounts')); |
|
67 | + app('view')->share('title', (string)trans('firefly.accounts')); |
|
68 | 68 | |
69 | 69 | $this->repository = app(AccountRepositoryInterface::class); |
70 | 70 | $this->currencyRepos = app(CurrencyRepositoryInterface::class); |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | */ |
91 | 91 | public function show(Request $request, Account $account, Carbon $start = null, Carbon $end = null) |
92 | 92 | { |
93 | - $objectType = config(sprintf('firefly.shortNamesByFullName.%s', $account->accountType->type)); |
|
93 | + $objectType = config(sprintf('firefly.shortNamesByFullName.%s', $account->accountType->type)); |
|
94 | 94 | |
95 | 95 | if (!$this->isEditableAccount($account)) { |
96 | 96 | return $this->redirectAccountToAccount($account); // @codeCoverageIgnore |
@@ -108,12 +108,12 @@ discard block |
||
108 | 108 | $attachments = $this->repository->getAttachments($account); |
109 | 109 | $today = today(config('app.timezone')); |
110 | 110 | $subTitleIcon = config(sprintf('firefly.subIconsByIdentifier.%s', $account->accountType->type)); |
111 | - $page = (int) $request->get('page'); |
|
112 | - $pageSize = (int) app('preferences')->get('listPageSize', 50)->data; |
|
111 | + $page = (int)$request->get('page'); |
|
112 | + $pageSize = (int)app('preferences')->get('listPageSize', 50)->data; |
|
113 | 113 | $currency = $this->repository->getAccountCurrency($account) ?? app('amount')->getDefaultCurrency(); |
114 | 114 | $fStart = $start->formatLocalized($this->monthAndDayFormat); |
115 | 115 | $fEnd = $end->formatLocalized($this->monthAndDayFormat); |
116 | - $subTitle = (string) trans('firefly.journals_in_period_for_account', ['name' => $account->name, 'start' => $fStart, 'end' => $fEnd]); |
|
116 | + $subTitle = (string)trans('firefly.journals_in_period_for_account', ['name' => $account->name, 'start' => $fStart, 'end' => $fEnd]); |
|
117 | 117 | $chartUri = route('chart.account.period', [$account->id, $start->format('Y-m-d'), $end->format('Y-m-d')]); |
118 | 118 | $firstTransaction = $this->repository->oldestJournalDate($account) ?? $start; |
119 | 119 | $periods = $this->getAccountPeriodOverview($account, $firstTransaction, $end); |
@@ -171,16 +171,16 @@ discard block |
||
171 | 171 | |
172 | 172 | $location = $this->repository->getLocation($account); |
173 | 173 | $isLiability = $this->repository->isLiability($account); |
174 | - $attachments = $this->repository->getAttachments($account); |
|
174 | + $attachments = $this->repository->getAttachments($account); |
|
175 | 175 | $objectType = config(sprintf('firefly.shortNamesByFullName.%s', $account->accountType->type)); |
176 | 176 | $end = today(config('app.timezone')); |
177 | 177 | $today = today(config('app.timezone')); |
178 | 178 | $start = $this->repository->oldestJournalDate($account) ?? Carbon::now()->startOfMonth(); |
179 | 179 | $subTitleIcon = config('firefly.subIconsByIdentifier.' . $account->accountType->type); |
180 | - $page = (int) $request->get('page'); |
|
181 | - $pageSize = (int) app('preferences')->get('listPageSize', 50)->data; |
|
180 | + $page = (int)$request->get('page'); |
|
181 | + $pageSize = (int)app('preferences')->get('listPageSize', 50)->data; |
|
182 | 182 | $currency = $this->repository->getAccountCurrency($account) ?? app('amount')->getDefaultCurrency(); |
183 | - $subTitle = (string) trans('firefly.all_journals_for_account', ['name' => $account->name]); |
|
183 | + $subTitle = (string)trans('firefly.all_journals_for_account', ['name' => $account->name]); |
|
184 | 184 | $periods = new Collection; |
185 | 185 | /** @var GroupCollectorInterface $collector */ |
186 | 186 | $collector = app(GroupCollectorInterface::class); |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | /** @var GroupCollectorInterface $collector */ |
104 | 104 | $collector = app(GroupCollectorInterface::class); |
105 | 105 | $collector->setRange($start, $end)->setTypes([TransactionType::WITHDRAWAL])->setLimit($pageSize)->setPage($page) |
106 | - ->withoutBudget()->withAccountInformation()->withCategoryInformation(); |
|
106 | + ->withoutBudget()->withAccountInformation()->withCategoryInformation(); |
|
107 | 107 | $groups = $collector->getPaginatedGroups(); |
108 | 108 | $groups->setPath(route('budgets.no-budget')); |
109 | 109 | |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | /** @var GroupCollectorInterface $collector */ |
131 | 131 | $collector = app(GroupCollectorInterface::class); |
132 | 132 | $collector->setRange($start, $end)->setTypes([TransactionType::WITHDRAWAL])->setLimit($pageSize)->setPage($page) |
133 | - ->withoutBudget()->withAccountInformation()->withCategoryInformation(); |
|
133 | + ->withoutBudget()->withAccountInformation()->withCategoryInformation(); |
|
134 | 134 | $groups = $collector->getPaginatedGroups(); |
135 | 135 | $groups->setPath(route('budgets.no-budget')); |
136 | 136 | |
@@ -163,8 +163,8 @@ discard block |
||
163 | 163 | /** @var GroupCollectorInterface $collector */ |
164 | 164 | $collector = app(GroupCollectorInterface::class); |
165 | 165 | $collector->setRange($allStart, $allEnd)->setBudget($budget) |
166 | - ->withAccountInformation() |
|
167 | - ->setLimit($pageSize)->setPage($page)->withBudgetInformation()->withCategoryInformation(); |
|
166 | + ->withAccountInformation() |
|
167 | + ->setLimit($pageSize)->setPage($page)->withBudgetInformation()->withCategoryInformation(); |
|
168 | 168 | $groups = $collector->getPaginatedGroups(); |
169 | 169 | $groups->setPath(route('budgets.show', [$budget->id])); |
170 | 170 | |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | $collector = app(GroupCollectorInterface::class); |
207 | 207 | |
208 | 208 | $collector->setRange($budgetLimit->start_date, $budgetLimit->end_date)->withAccountInformation() |
209 | - ->setBudget($budget)->setLimit($pageSize)->setPage($page)->withBudgetInformation()->withCategoryInformation(); |
|
209 | + ->setBudget($budget)->setLimit($pageSize)->setPage($page)->withBudgetInformation()->withCategoryInformation(); |
|
210 | 210 | $groups = $collector->getPaginatedGroups(); |
211 | 211 | $groups->setPath(route('budgets.show', [$budget->id, $budgetLimit->id])); |
212 | 212 | /** @var Carbon $start */ |
@@ -62,8 +62,8 @@ discard block |
||
62 | 62 | app('view')->share('showCategory', true); |
63 | 63 | parent::__construct(); |
64 | 64 | $this->middleware( |
65 | - function ($request, $next) { |
|
66 | - app('view')->share('title', (string) trans('firefly.budgets')); |
|
65 | + function($request, $next) { |
|
66 | + app('view')->share('title', (string)trans('firefly.budgets')); |
|
67 | 67 | app('view')->share('mainTitleIcon', 'fa-pie-chart'); |
68 | 68 | $this->journalRepos = app(JournalRepositoryInterface::class); |
69 | 69 | $this->repository = app(BudgetRepositoryInterface::class); |
@@ -97,8 +97,8 @@ discard block |
||
97 | 97 | $first = $this->journalRepos->firstNull(); |
98 | 98 | $firstDate = null !== $first ? $first->date : $start; |
99 | 99 | $periods = $this->getNoBudgetPeriodOverview($firstDate, $end); |
100 | - $page = (int) $request->get('page'); |
|
101 | - $pageSize = (int) app('preferences')->get('listPageSize', 50)->data; |
|
100 | + $page = (int)$request->get('page'); |
|
101 | + $pageSize = (int)app('preferences')->get('listPageSize', 50)->data; |
|
102 | 102 | |
103 | 103 | /** @var GroupCollectorInterface $collector */ |
104 | 104 | $collector = app(GroupCollectorInterface::class); |
@@ -120,12 +120,12 @@ discard block |
||
120 | 120 | public function noBudgetAll(Request $request) |
121 | 121 | { |
122 | 122 | |
123 | - $subTitle = (string) trans('firefly.all_journals_without_budget'); |
|
123 | + $subTitle = (string)trans('firefly.all_journals_without_budget'); |
|
124 | 124 | $first = $this->journalRepos->firstNull(); |
125 | 125 | $start = null === $first ? new Carbon : $first->date; |
126 | 126 | $end = today(config('app.timezone')); |
127 | - $page = (int) $request->get('page'); |
|
128 | - $pageSize = (int) app('preferences')->get('listPageSize', 50)->data; |
|
127 | + $page = (int)$request->get('page'); |
|
128 | + $pageSize = (int)app('preferences')->get('listPageSize', 50)->data; |
|
129 | 129 | |
130 | 130 | /** @var GroupCollectorInterface $collector */ |
131 | 131 | $collector = app(GroupCollectorInterface::class); |
@@ -153,8 +153,8 @@ discard block |
||
153 | 153 | $allEnd = today(); |
154 | 154 | |
155 | 155 | |
156 | - $page = (int) $request->get('page'); |
|
157 | - $pageSize = (int) app('preferences')->get('listPageSize', 50)->data; |
|
156 | + $page = (int)$request->get('page'); |
|
157 | + $pageSize = (int)app('preferences')->get('listPageSize', 50)->data; |
|
158 | 158 | $limits = $this->getLimits($budget, $allStart, $allEnd); |
159 | 159 | $repetition = null; |
160 | 160 | $attachments = $this->repository->getAttachments($budget); |
@@ -168,9 +168,9 @@ discard block |
||
168 | 168 | $groups = $collector->getPaginatedGroups(); |
169 | 169 | $groups->setPath(route('budgets.show', [$budget->id])); |
170 | 170 | |
171 | - $subTitle = (string) trans('firefly.all_journals_for_budget', ['name' => $budget->name]); |
|
171 | + $subTitle = (string)trans('firefly.all_journals_for_budget', ['name' => $budget->name]); |
|
172 | 172 | |
173 | - return view('budgets.show', compact('limits','attachments', 'budget', 'repetition', 'groups', 'subTitle')); |
|
173 | + return view('budgets.show', compact('limits', 'attachments', 'budget', 'repetition', 'groups', 'subTitle')); |
|
174 | 174 | } |
175 | 175 | |
176 | 176 | /** |
@@ -189,8 +189,8 @@ discard block |
||
189 | 189 | throw new FireflyException('This budget limit is not part of this budget.'); // @codeCoverageIgnore |
190 | 190 | } |
191 | 191 | |
192 | - $page = (int) $request->get('page'); |
|
193 | - $pageSize = (int) app('preferences')->get('listPageSize', 50)->data; |
|
192 | + $page = (int)$request->get('page'); |
|
193 | + $pageSize = (int)app('preferences')->get('listPageSize', 50)->data; |
|
194 | 194 | $subTitle = trans( |
195 | 195 | 'firefly.budget_in_period', |
196 | 196 | [ |
@@ -215,6 +215,6 @@ discard block |
||
215 | 215 | $attachments = $this->repository->getAttachments($budget); |
216 | 216 | $limits = $this->getLimits($budget, $start, $end); |
217 | 217 | |
218 | - return view('budgets.show', compact('limits','attachments', 'budget', 'budgetLimit', 'groups', 'subTitle')); |
|
218 | + return view('budgets.show', compact('limits', 'attachments', 'budget', 'budgetLimit', 'groups', 'subTitle')); |
|
219 | 219 | } |
220 | 220 | } |
@@ -57,8 +57,8 @@ discard block |
||
57 | 57 | app('view')->share('showBudget', true); |
58 | 58 | |
59 | 59 | $this->middleware( |
60 | - function ($request, $next) { |
|
61 | - app('view')->share('title', (string) trans('firefly.categories')); |
|
60 | + function($request, $next) { |
|
61 | + app('view')->share('title', (string)trans('firefly.categories')); |
|
62 | 62 | app('view')->share('mainTitleIcon', 'fa-bookmark'); |
63 | 63 | $this->journalRepos = app(JournalRepositoryInterface::class); |
64 | 64 | |
@@ -83,13 +83,13 @@ discard block |
||
83 | 83 | $start = $start ?? session('start'); |
84 | 84 | /** @var Carbon $end */ |
85 | 85 | $end = $end ?? session('end'); |
86 | - $page = (int) $request->get('page'); |
|
87 | - $pageSize = (int) app('preferences')->get('listPageSize', 50)->data; |
|
86 | + $page = (int)$request->get('page'); |
|
87 | + $pageSize = (int)app('preferences')->get('listPageSize', 50)->data; |
|
88 | 88 | $subTitle = trans( |
89 | 89 | 'firefly.without_category_between', |
90 | 90 | ['start' => $start->formatLocalized($this->monthAndDayFormat), 'end' => $end->formatLocalized($this->monthAndDayFormat)] |
91 | 91 | ); |
92 | - $periods = $this->getNoCategoryPeriodOverview($start); |
|
92 | + $periods = $this->getNoCategoryPeriodOverview($start); |
|
93 | 93 | |
94 | 94 | Log::debug(sprintf('Start for noCategory() is %s', $start->format('Y-m-d'))); |
95 | 95 | Log::debug(sprintf('End for noCategory() is %s', $end->format('Y-m-d'))); |
@@ -120,10 +120,10 @@ discard block |
||
120 | 120 | $start = null; |
121 | 121 | $end = null; |
122 | 122 | $periods = new Collection; |
123 | - $page = (int) $request->get('page'); |
|
124 | - $pageSize = (int) app('preferences')->get('listPageSize', 50)->data; |
|
123 | + $page = (int)$request->get('page'); |
|
124 | + $pageSize = (int)app('preferences')->get('listPageSize', 50)->data; |
|
125 | 125 | Log::debug('Start of noCategory()'); |
126 | - $subTitle = (string) trans('firefly.all_journals_without_category'); |
|
126 | + $subTitle = (string)trans('firefly.all_journals_without_category'); |
|
127 | 127 | $first = $this->journalRepos->firstNull(); |
128 | 128 | $start = null === $first ? new Carbon : $first->date; |
129 | 129 | $end = today(config('app.timezone')); |
@@ -56,8 +56,8 @@ discard block |
||
56 | 56 | app('view')->share('showBudget', true); |
57 | 57 | |
58 | 58 | $this->middleware( |
59 | - function ($request, $next) { |
|
60 | - app('view')->share('title', (string) trans('firefly.categories')); |
|
59 | + function($request, $next) { |
|
60 | + app('view')->share('title', (string)trans('firefly.categories')); |
|
61 | 61 | app('view')->share('mainTitleIcon', 'fa-bookmark'); |
62 | 62 | $this->repository = app(CategoryRepositoryInterface::class); |
63 | 63 | |
@@ -84,16 +84,16 @@ discard block |
||
84 | 84 | /** @var Carbon $end */ |
85 | 85 | $end = $end ?? session('end', Carbon::now()->endOfMonth()); |
86 | 86 | $subTitleIcon = 'fa-bookmark'; |
87 | - $page = (int) $request->get('page'); |
|
87 | + $page = (int)$request->get('page'); |
|
88 | 88 | $attachments = $this->repository->getAttachments($category); |
89 | - $pageSize = (int) app('preferences')->get('listPageSize', 50)->data; |
|
89 | + $pageSize = (int)app('preferences')->get('listPageSize', 50)->data; |
|
90 | 90 | $oldest = $this->repository->firstUseDate($category) ?? Carbon::now()->startOfYear(); |
91 | 91 | $periods = $this->getCategoryPeriodOverview($category, $oldest, $end); |
92 | 92 | $path = route('categories.show', [$category->id, $start->format('Y-m-d'), $end->format('Y-m-d')]); |
93 | 93 | $subTitle = trans( |
94 | 94 | 'firefly.journals_in_period_for_category', |
95 | 95 | ['name' => $category->name, 'start' => $start->formatLocalized($this->monthAndDayFormat), |
96 | - 'end' => $end->formatLocalized($this->monthAndDayFormat),] |
|
96 | + 'end' => $end->formatLocalized($this->monthAndDayFormat), ] |
|
97 | 97 | ); |
98 | 98 | |
99 | 99 | /** @var GroupCollectorInterface $collector */ |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | $groups = $collector->getPaginatedGroups(); |
106 | 106 | $groups->setPath($path); |
107 | 107 | |
108 | - return view('categories.show', compact('category','attachments', 'groups', 'periods', 'subTitle', 'subTitleIcon', 'start', 'end')); |
|
108 | + return view('categories.show', compact('category', 'attachments', 'groups', 'periods', 'subTitle', 'subTitleIcon', 'start', 'end')); |
|
109 | 109 | } |
110 | 110 | |
111 | 111 | /** |
@@ -120,19 +120,19 @@ discard block |
||
120 | 120 | { |
121 | 121 | // default values: |
122 | 122 | $subTitleIcon = 'fa-bookmark'; |
123 | - $page = (int) $request->get('page'); |
|
124 | - $pageSize = (int) app('preferences')->get('listPageSize', 50)->data; |
|
123 | + $page = (int)$request->get('page'); |
|
124 | + $pageSize = (int)app('preferences')->get('listPageSize', 50)->data; |
|
125 | 125 | $start = null; |
126 | 126 | $end = null; |
127 | 127 | $periods = new Collection; |
128 | 128 | |
129 | - $subTitle = (string) trans('firefly.all_journals_for_category', ['name' => $category->name]); |
|
129 | + $subTitle = (string)trans('firefly.all_journals_for_category', ['name' => $category->name]); |
|
130 | 130 | $first = $this->repository->firstUseDate($category); |
131 | 131 | /** @var Carbon $start */ |
132 | 132 | $start = $first ?? today(config('app.timezone')); |
133 | 133 | $end = today(config('app.timezone')); |
134 | 134 | $path = route('categories.show.all', [$category->id]); |
135 | - $attachments = $this->repository->getAttachments($category); |
|
135 | + $attachments = $this->repository->getAttachments($category); |
|
136 | 136 | |
137 | 137 | /** @var GroupCollectorInterface $collector */ |
138 | 138 | $collector = app(GroupCollectorInterface::class); |
@@ -143,6 +143,6 @@ discard block |
||
143 | 143 | $groups = $collector->getPaginatedGroups(); |
144 | 144 | $groups->setPath($path); |
145 | 145 | |
146 | - return view('categories.show', compact('category','attachments', 'groups', 'periods', 'subTitle', 'subTitleIcon', 'start', 'end')); |
|
146 | + return view('categories.show', compact('category', 'attachments', 'groups', 'periods', 'subTitle', 'subTitleIcon', 'start', 'end')); |
|
147 | 147 | } |
148 | 148 | } |