Various PSR12 code cleanup

This commit is contained in:
James Cole
2022-12-29 19:41:57 +01:00
parent 0022009dd5
commit dbf3e76ecc
340 changed files with 4079 additions and 3816 deletions

View File

@@ -1,4 +1,5 @@
<?php
/**
* ChartJsGenerator.php
* Copyright (c) 2019 james@firefly-iii.org
@@ -34,7 +35,7 @@ class ChartJsGenerator implements GeneratorInterface
*
* key => [value => x, 'currency_symbol' => 'x']
*
* @param array $data
* @param array $data
*
* @return array
*/
@@ -50,7 +51,7 @@ class ChartJsGenerator implements GeneratorInterface
$amounts = array_column($data, 'amount');
$next = next($amounts);
$sortFlag = SORT_ASC;
if (!is_bool($next) && 1 === bccomp((string) $next, '0')) {
if (!is_bool($next) && 1 === bccomp((string)$next, '0')) {
$sortFlag = SORT_DESC;
}
array_multisort($amounts, $sortFlag, $data);
@@ -59,7 +60,7 @@ class ChartJsGenerator implements GeneratorInterface
$index = 0;
foreach ($data as $key => $valueArray) {
// make larger than 0
$chartData['datasets'][0]['data'][] = app('steam')->positive((string) $valueArray['amount']);
$chartData['datasets'][0]['data'][] = app('steam')->positive((string)$valueArray['amount']);
$chartData['datasets'][0]['backgroundColor'][] = ChartColour::getColour($index);
$chartData['datasets'][0]['currency_symbol'][] = $valueArray['currency_symbol'];
$chartData['labels'][] = $key;
@@ -99,7 +100,7 @@ class ChartJsGenerator implements GeneratorInterface
*
* // it's five.
*
* @param array $data
* @param array $data
*
* @return array
*/
@@ -148,7 +149,7 @@ class ChartJsGenerator implements GeneratorInterface
*
* key => value
*
* @param array $data
* @param array $data
*
* @return array
*/
@@ -165,7 +166,7 @@ class ChartJsGenerator implements GeneratorInterface
// different sort when values are positive and when they're negative.
asort($data);
$next = next($data);
if (!is_bool($next) && 1 === bccomp((string) $next, '0')) {
if (!is_bool($next) && 1 === bccomp((string)$next, '0')) {
// next is positive, sort other way around.
arsort($data);
}
@@ -174,7 +175,7 @@ class ChartJsGenerator implements GeneratorInterface
$index = 0;
foreach ($data as $key => $value) {
// make larger than 0
$chartData['datasets'][0]['data'][] = app('steam')->positive((string) $value);
$chartData['datasets'][0]['data'][] = app('steam')->positive((string)$value);
$chartData['datasets'][0]['backgroundColor'][] = ChartColour::getColour($index);
$chartData['labels'][] = $key;
@@ -189,8 +190,8 @@ class ChartJsGenerator implements GeneratorInterface
*
* 'label-of-entry' => value
*
* @param string $setLabel
* @param array $data
* @param string $setLabel
* @param array $data
*
* @return array
*/

View File

@@ -1,4 +1,5 @@
<?php
/**
* GeneratorInterface.php
* Copyright (c) 2019 james@firefly-iii.org
@@ -28,7 +29,7 @@ namespace FireflyIII\Generator\Chart\Basic;
interface GeneratorInterface
{
/**
* @param array $data
* @param array $data
*
* @return array
*/
@@ -62,7 +63,7 @@ interface GeneratorInterface
*
* // it's five.
*
* @param array $data
* @param array $data
*
* @return array
*/
@@ -73,7 +74,7 @@ interface GeneratorInterface
*
* key => value
*
* @param array $data
* @param array $data
*
* @return array
*/
@@ -84,8 +85,8 @@ interface GeneratorInterface
*
* 'label-of-entry' => value
*
* @param string $setLabel
* @param array $data
* @param string $setLabel
* @param array $data
*
* @return array
*/

View File

@@ -1,4 +1,5 @@
<?php
/**
* MonthReportGenerator.php
* Copyright (c) 2019 james@firefly-iii.org
@@ -43,8 +44,8 @@ class MonthReportGenerator implements ReportGeneratorInterface
/**
* Generate the report.
* @throws FireflyException
* @return string
* @throws FireflyException
*/
public function generate(): string
{
@@ -80,7 +81,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
/**
* Set accounts.
*
* @param Collection $accounts
* @param Collection $accounts
*
* @return ReportGeneratorInterface
*/
@@ -94,7 +95,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
/**
* Set budgets.
*
* @param Collection $budgets
* @param Collection $budgets
*
* @return ReportGeneratorInterface
*/
@@ -106,7 +107,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
/**
* Set categories.
*
* @param Collection $categories
* @param Collection $categories
*
* @return ReportGeneratorInterface
*/
@@ -118,7 +119,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
/**
* Set end date.
*
* @param Carbon $date
* @param Carbon $date
*
* @return ReportGeneratorInterface
*/
@@ -132,7 +133,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
/**
* Set expense collection.
*
* @param Collection $expense
* @param Collection $expense
*
* @return ReportGeneratorInterface
*/
@@ -146,7 +147,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
/**
* Set start date.
*
* @param Carbon $date
* @param Carbon $date
*
* @return ReportGeneratorInterface
*/
@@ -160,7 +161,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
/**
* Set collection of tags.
*
* @param Collection $tags
* @param Collection $tags
*
* @return ReportGeneratorInterface
*/

View File

@@ -1,4 +1,5 @@
<?php
/**
* MultiYearReportGenerator.php
* Copyright (c) 2019 james@firefly-iii.org

View File

@@ -1,4 +1,5 @@
<?php
/**
* YearReportGenerator.php
* Copyright (c) 2019 james@firefly-iii.org

View File

@@ -67,16 +67,32 @@ class MonthReportGenerator implements ReportGeneratorInterface
$defaultShow = ['icon', 'description', 'balance_before', 'amount', 'balance_after', 'date', 'to'];
$reportType = 'audit';
$accountIds = implode(',', $this->accounts->pluck('id')->toArray());
$hideable = ['buttons', 'icon', 'description', 'balance_before', 'amount', 'balance_after', 'date',
$hideable = [
'buttons',
'icon',
'description',
'balance_before',
'amount',
'balance_after',
'date',
'from', 'to', 'budget', 'category', 'bill',
'from',
'to',
'budget',
'category',
'bill',
// more new optional fields
'create_date', 'update_date',
// more new optional fields
'create_date',
'update_date',
// date fields.
'interest_date', 'book_date', 'process_date',
'due_date', 'payment_date', 'invoice_date',
// date fields.
'interest_date',
'book_date',
'process_date',
'due_date',
'payment_date',
'invoice_date',
];
try {
$result = view('reports.audit.report', compact('reportType', 'accountIds', 'auditData', 'hideable', 'defaultShow'))
@@ -95,8 +111,8 @@ class MonthReportGenerator implements ReportGeneratorInterface
/**
* Get the audit report.
*
* @param Account $account
* @param Carbon $date
* @param Account $account
* @param Carbon $date
*
* @return array
* @throws FireflyException
@@ -157,9 +173,9 @@ class MonthReportGenerator implements ReportGeneratorInterface
'journals' => $journals,
'currency' => $currency,
'exists' => 0 !== count($journals),
'end' => $this->end->isoFormat((string) trans('config.month_and_day_moment_js', [], $locale)),
'end' => $this->end->isoFormat((string)trans('config.month_and_day_moment_js', [], $locale)),
'endBalance' => app('steam')->balance($account, $this->end),
'dayBefore' => $date->isoFormat((string) trans('config.month_and_day_moment_js', [], $locale)),
'dayBefore' => $date->isoFormat((string)trans('config.month_and_day_moment_js', [], $locale)),
'dayBeforeBalance' => $dayBeforeBalance,
];
}
@@ -167,7 +183,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
/**
* Account collection setter.
*
* @param Collection $accounts
* @param Collection $accounts
*
* @return ReportGeneratorInterface
* @codeCoverageIgnore
@@ -182,7 +198,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
/**
* Budget collection setter.
*
* @param Collection $budgets
* @param Collection $budgets
*
* @return ReportGeneratorInterface
* @codeCoverageIgnore
@@ -195,7 +211,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
/**
* Category collection setter.
*
* @param Collection $categories
* @param Collection $categories
*
* @return ReportGeneratorInterface
* @codeCoverageIgnore
@@ -208,7 +224,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
/**
* End date setter.
*
* @param Carbon $date
* @param Carbon $date
*
* @return ReportGeneratorInterface
* @codeCoverageIgnore
@@ -223,7 +239,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
/**
* Expenses collection setter.
*
* @param Collection $expense
* @param Collection $expense
*
* @return ReportGeneratorInterface
* @codeCoverageIgnore
@@ -237,7 +253,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
/**
* Start date collection setter.
*
* @param Carbon $date
* @param Carbon $date
*
* @return ReportGeneratorInterface
* @codeCoverageIgnore
@@ -252,7 +268,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
/**
* Tags collection setter.
*
* @param Collection $tags
* @param Collection $tags
*
* @return ReportGeneratorInterface
* @codeCoverageIgnore

View File

@@ -1,4 +1,5 @@
<?php
/**
* MultiYearReportGenerator.php
* Copyright (c) 2019 james@firefly-iii.org

View File

@@ -1,4 +1,5 @@
<?php
/**
* YearReportGenerator.php
* Copyright (c) 2019 james@firefly-iii.org

View File

@@ -1,4 +1,5 @@
<?php
/**
* MonthReportGenerator.php
* Copyright (c) 2019 james@firefly-iii.org
@@ -81,38 +82,10 @@ class MonthReportGenerator implements ReportGeneratorInterface
return $result;
}
/**
* Set the involved accounts.
*
* @param Collection $accounts
*
* @return ReportGeneratorInterface
*/
public function setAccounts(Collection $accounts): ReportGeneratorInterface
{
$this->accounts = $accounts;
return $this;
}
/**
* Set the involved budgets.
*
* @param Collection $budgets
*
* @return ReportGeneratorInterface
*/
public function setBudgets(Collection $budgets): ReportGeneratorInterface
{
$this->budgets = $budgets;
return $this;
}
/**
* Unused category setter.
*
* @param Collection $categories
* @param Collection $categories
*
* @return ReportGeneratorInterface
*/
@@ -124,7 +97,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
/**
* Set the end date of the report.
*
* @param Carbon $date
* @param Carbon $date
*
* @return ReportGeneratorInterface
*/
@@ -138,7 +111,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
/**
* Unused expense setter.
*
* @param Collection $expense
* @param Collection $expense
*
* @return ReportGeneratorInterface
*/
@@ -150,7 +123,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
/**
* Set the start date of the report.
*
* @param Carbon $date
* @param Carbon $date
*
* @return ReportGeneratorInterface
*/
@@ -164,7 +137,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
/**
* Unused tags setter.
*
* @param Collection $tags
* @param Collection $tags
*
* @return ReportGeneratorInterface
*/
@@ -199,4 +172,32 @@ class MonthReportGenerator implements ReportGeneratorInterface
return $journals;
}
/**
* Set the involved budgets.
*
* @param Collection $budgets
*
* @return ReportGeneratorInterface
*/
public function setBudgets(Collection $budgets): ReportGeneratorInterface
{
$this->budgets = $budgets;
return $this;
}
/**
* Set the involved accounts.
*
* @param Collection $accounts
*
* @return ReportGeneratorInterface
*/
public function setAccounts(Collection $accounts): ReportGeneratorInterface
{
$this->accounts = $accounts;
return $this;
}
}

View File

@@ -1,4 +1,5 @@
<?php
/**
* MultiYearReportGenerator.php
* Copyright (c) 2019 james@firefly-iii.org

View File

@@ -1,4 +1,5 @@
<?php
/**
* YearReportGenerator.php
* Copyright (c) 2019 james@firefly-iii.org

View File

@@ -1,4 +1,5 @@
<?php
/**
* MonthReportGenerator.php
* Copyright (c) 2019 james@firefly-iii.org
@@ -89,24 +90,10 @@ class MonthReportGenerator implements ReportGeneratorInterface
return $result;
}
/**
* Set the involved accounts.
*
* @param Collection $accounts
*
* @return ReportGeneratorInterface
*/
public function setAccounts(Collection $accounts): ReportGeneratorInterface
{
$this->accounts = $accounts;
return $this;
}
/**
* Empty budget setter.
*
* @param Collection $budgets
* @param Collection $budgets
*
* @return ReportGeneratorInterface
*/
@@ -115,24 +102,10 @@ class MonthReportGenerator implements ReportGeneratorInterface
return $this;
}
/**
* Set the categories involved in this report.
*
* @param Collection $categories
*
* @return ReportGeneratorInterface
*/
public function setCategories(Collection $categories): ReportGeneratorInterface
{
$this->categories = $categories;
return $this;
}
/**
* Set the end date for this report.
*
* @param Carbon $date
* @param Carbon $date
*
* @return ReportGeneratorInterface
*/
@@ -146,7 +119,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
/**
* Set the expenses involved in this report.
*
* @param Collection $expense
* @param Collection $expense
*
* @return ReportGeneratorInterface
*/
@@ -158,7 +131,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
/**
* Set the start date for this report.
*
* @param Carbon $date
* @param Carbon $date
*
* @return ReportGeneratorInterface
*/
@@ -172,7 +145,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
/**
* Unused tag setter.
*
* @param Collection $tags
* @param Collection $tags
*
* @return ReportGeneratorInterface
*/
@@ -206,6 +179,34 @@ class MonthReportGenerator implements ReportGeneratorInterface
return $transactions;
}
/**
* Set the categories involved in this report.
*
* @param Collection $categories
*
* @return ReportGeneratorInterface
*/
public function setCategories(Collection $categories): ReportGeneratorInterface
{
$this->categories = $categories;
return $this;
}
/**
* Set the involved accounts.
*
* @param Collection $accounts
*
* @return ReportGeneratorInterface
*/
public function setAccounts(Collection $accounts): ReportGeneratorInterface
{
$this->accounts = $accounts;
return $this;
}
/**
* Get the income for this report.
*

View File

@@ -1,4 +1,5 @@
<?php
/**
* MultiYearReportGenerator.php
* Copyright (c) 2019 james@firefly-iii.org

View File

@@ -1,4 +1,5 @@
<?php
/**
* YearReportGenerator.php
* Copyright (c) 2019 james@firefly-iii.org

View File

@@ -1,4 +1,5 @@
<?php
/**
* ReportGeneratorFactory.php
* Copyright (c) 2019 james@firefly-iii.org
@@ -35,9 +36,9 @@ class ReportGeneratorFactory
/**
* Static report generator class.
*
* @param string $type
* @param Carbon $start
* @param Carbon $end
* @param string $type
* @param Carbon $start
* @param Carbon $end
*
* @return ReportGeneratorInterface
*

View File

@@ -1,4 +1,5 @@
<?php
/**
* ReportGeneratorInterface.php
* Copyright (c) 2019 james@firefly-iii.org
@@ -40,7 +41,7 @@ interface ReportGeneratorInterface
/**
* Set the involved accounts.
*
* @param Collection $accounts
* @param Collection $accounts
*
* @return ReportGeneratorInterface
*/
@@ -49,7 +50,7 @@ interface ReportGeneratorInterface
/**
* Set the involved budgets.
*
* @param Collection $budgets
* @param Collection $budgets
*
* @return ReportGeneratorInterface
*/
@@ -58,7 +59,7 @@ interface ReportGeneratorInterface
/**
* Set the involved categories.
*
* @param Collection $categories
* @param Collection $categories
*
* @return ReportGeneratorInterface
*/
@@ -67,7 +68,7 @@ interface ReportGeneratorInterface
/**
* Set the end date.
*
* @param Carbon $date
* @param Carbon $date
*
* @return ReportGeneratorInterface
*/
@@ -76,7 +77,7 @@ interface ReportGeneratorInterface
/**
* Set the expense accounts.
*
* @param Collection $expense
* @param Collection $expense
*
* @return ReportGeneratorInterface
*/
@@ -85,7 +86,7 @@ interface ReportGeneratorInterface
/**
* Set the start date.
*
* @param Carbon $date
* @param Carbon $date
*
* @return ReportGeneratorInterface
*/
@@ -94,7 +95,7 @@ interface ReportGeneratorInterface
/**
* Set the tags.
*
* @param Collection $tags
* @param Collection $tags
*
* @return ReportGeneratorInterface
*/

View File

@@ -1,4 +1,5 @@
<?php
/**
* MonthReportGenerator.php
* Copyright (c) 2019 james@firefly-iii.org
@@ -67,7 +68,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
/**
* Sets the accounts involved in the report.
*
* @param Collection $accounts
* @param Collection $accounts
*
* @return ReportGeneratorInterface
*/
@@ -81,7 +82,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
/**
* Unused budget setter.
*
* @param Collection $budgets
* @param Collection $budgets
*
* @return ReportGeneratorInterface
*/
@@ -93,7 +94,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
/**
* Unused category setter.
*
* @param Collection $categories
* @param Collection $categories
*
* @return ReportGeneratorInterface
*/
@@ -105,7 +106,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
/**
* Set the end date of the report.
*
* @param Carbon $date
* @param Carbon $date
*
* @return ReportGeneratorInterface
*/
@@ -119,7 +120,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
/**
* Set the expenses used in this report.
*
* @param Collection $expense
* @param Collection $expense
*
* @return ReportGeneratorInterface
*/
@@ -131,7 +132,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
/**
* Set the start date of this report.
*
* @param Carbon $date
* @param Carbon $date
*
* @return ReportGeneratorInterface
*/
@@ -145,7 +146,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
/**
* Set the tags used in this report.
*
* @param Collection $tags
* @param Collection $tags
*
* @return ReportGeneratorInterface
*/

View File

@@ -1,4 +1,5 @@
<?php
/**
* MultiYearReportGenerator.php
* Copyright (c) 2019 james@firefly-iii.org
@@ -71,7 +72,7 @@ class MultiYearReportGenerator implements ReportGeneratorInterface
/**
* Sets the accounts used in the report.
*
* @param Collection $accounts
* @param Collection $accounts
*
* @return ReportGeneratorInterface
*/
@@ -85,7 +86,7 @@ class MultiYearReportGenerator implements ReportGeneratorInterface
/**
* Sets the budgets used in the report.
*
* @param Collection $budgets
* @param Collection $budgets
*
* @return ReportGeneratorInterface
*/
@@ -97,7 +98,7 @@ class MultiYearReportGenerator implements ReportGeneratorInterface
/**
* Sets the categories used in the report.
*
* @param Collection $categories
* @param Collection $categories
*
* @return ReportGeneratorInterface
*/
@@ -109,7 +110,7 @@ class MultiYearReportGenerator implements ReportGeneratorInterface
/**
* Sets the end date used in the report.
*
* @param Carbon $date
* @param Carbon $date
*
* @return ReportGeneratorInterface
*/
@@ -123,7 +124,7 @@ class MultiYearReportGenerator implements ReportGeneratorInterface
/**
* Unused setter for expenses.
*
* @param Collection $expense
* @param Collection $expense
*
* @return ReportGeneratorInterface
*/
@@ -135,7 +136,7 @@ class MultiYearReportGenerator implements ReportGeneratorInterface
/**
* Set the start date of the report.
*
* @param Carbon $date
* @param Carbon $date
*
* @return ReportGeneratorInterface
*/
@@ -149,7 +150,7 @@ class MultiYearReportGenerator implements ReportGeneratorInterface
/**
* Set the tags for the report.
*
* @param Collection $tags
* @param Collection $tags
*
* @return ReportGeneratorInterface
*/

View File

@@ -1,4 +1,5 @@
<?php
/**
* YearReportGenerator.php
* Copyright (c) 2019 james@firefly-iii.org
@@ -71,7 +72,7 @@ class YearReportGenerator implements ReportGeneratorInterface
/**
* Set the accounts.
*
* @param Collection $accounts
* @param Collection $accounts
*
* @return ReportGeneratorInterface
*/
@@ -85,7 +86,7 @@ class YearReportGenerator implements ReportGeneratorInterface
/**
* Unused budget setter.
*
* @param Collection $budgets
* @param Collection $budgets
*
* @return ReportGeneratorInterface
*/
@@ -97,7 +98,7 @@ class YearReportGenerator implements ReportGeneratorInterface
/**
* Unused categories setter.
*
* @param Collection $categories
* @param Collection $categories
*
* @return ReportGeneratorInterface
*/
@@ -109,7 +110,7 @@ class YearReportGenerator implements ReportGeneratorInterface
/**
* Set the end date.
*
* @param Carbon $date
* @param Carbon $date
*
* @return ReportGeneratorInterface
*/
@@ -123,7 +124,7 @@ class YearReportGenerator implements ReportGeneratorInterface
/**
* Set the expenses used.
*
* @param Collection $expense
* @param Collection $expense
*
* @return ReportGeneratorInterface
*/
@@ -135,7 +136,7 @@ class YearReportGenerator implements ReportGeneratorInterface
/**
* Set the start date.
*
* @param Carbon $date
* @param Carbon $date
*
* @return ReportGeneratorInterface
*/
@@ -149,7 +150,7 @@ class YearReportGenerator implements ReportGeneratorInterface
/**
* Unused tags setter.
*
* @param Collection $tags
* @param Collection $tags
*
* @return ReportGeneratorInterface
*/

View File

@@ -90,7 +90,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
/**
* Set the accounts.
*
* @param Collection $accounts
* @param Collection $accounts
*
* @return ReportGeneratorInterface
*/
@@ -104,7 +104,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
/**
* Unused budget setter.
*
* @param Collection $budgets
* @param Collection $budgets
*
* @return ReportGeneratorInterface
*/
@@ -116,7 +116,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
/**
* Unused category setter.
*
* @param Collection $categories
* @param Collection $categories
*
* @return ReportGeneratorInterface
*/
@@ -128,7 +128,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
/**
* Set the end date of the report.
*
* @param Carbon $date
* @param Carbon $date
*
* @return ReportGeneratorInterface
*/
@@ -142,7 +142,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
/**
* Set the expenses in this report.
*
* @param Collection $expense
* @param Collection $expense
*
* @return ReportGeneratorInterface
*/
@@ -154,7 +154,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
/**
* Set the start date.
*
* @param Carbon $date
* @param Carbon $date
*
* @return ReportGeneratorInterface
*/
@@ -168,7 +168,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
/**
* Set the tags used in this report.
*
* @param Collection $tags
* @param Collection $tags
*
* @return ReportGeneratorInterface
*/

View File

@@ -1,4 +1,5 @@
<?php
/**
* MultiYearReportGenerator.php
* Copyright (c) 2019 james@firefly-iii.org

View File

@@ -1,4 +1,5 @@
<?php
/**
* YearReportGenerator.php
* Copyright (c) 2019 james@firefly-iii.org

View File

@@ -42,17 +42,17 @@ interface MessageGeneratorInterface
public function getVersion(): int;
/**
* @param Collection $objects
* @param Collection $objects
*/
public function setObjects(Collection $objects): void;
/**
* @param int $trigger
* @param int $trigger
*/
public function setTrigger(int $trigger): void;
/**
* @param User $user
* @param User $user
*/
public function setUser(User $user): void;
}

View File

@@ -37,6 +37,7 @@ use FireflyIII\Transformers\TransactionGroupTransformer;
use FireflyIII\User;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Collection;
use JsonException;
use Log;
use Ramsey\Uuid\Uuid;
use Symfony\Component\HttpFoundation\ParameterBag;
@@ -90,7 +91,7 @@ class StandardMessageGenerator implements MessageGeneratorInterface
}
/**
* @param Webhook $webhook
* @param Webhook $webhook
*/
private function runWebhook(Webhook $webhook): void
{
@@ -102,10 +103,10 @@ class StandardMessageGenerator implements MessageGeneratorInterface
}
/**
* @param Webhook $webhook
* @param Model $model
* @param Webhook $webhook
* @param Model $model
* @throws FireflyException
* @throws \JsonException
* @throws JsonException
*/
private function generateMessage(Webhook $webhook, Model $model): void
{
@@ -178,7 +179,7 @@ class StandardMessageGenerator implements MessageGeneratorInterface
}
/**
* @param TransactionGroup $transactionGroup
* @param TransactionGroup $transactionGroup
*
* @return Collection
*/
@@ -197,8 +198,8 @@ class StandardMessageGenerator implements MessageGeneratorInterface
}
/**
* @param Webhook $webhook
* @param array $message
* @param Webhook $webhook
* @param array $message
*
* @return void
*/
@@ -215,7 +216,7 @@ class StandardMessageGenerator implements MessageGeneratorInterface
}
/**
* @param Collection $objects
* @param Collection $objects
*/
public function setObjects(Collection $objects): void
{
@@ -223,7 +224,7 @@ class StandardMessageGenerator implements MessageGeneratorInterface
}
/**
* @param int $trigger
* @param int $trigger
*/
public function setTrigger(int $trigger): void
{
@@ -231,7 +232,7 @@ class StandardMessageGenerator implements MessageGeneratorInterface
}
/**
* @param User $user
* @param User $user
*/
public function setUser(User $user): void
{