Fix code structure

This commit is contained in:
James Cole 2023-10-06 18:23:32 +02:00
parent 0ce34048cd
commit 8e183d8cad
No known key found for this signature in database
GPG Key ID: B49A324B7EAD6D80
7 changed files with 36 additions and 37 deletions

View File

@ -226,16 +226,16 @@
},
{
"name": "friendsofphp/php-cs-fixer",
"version": "v3.28.0",
"version": "v3.34.1",
"source": {
"type": "git",
"url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git",
"reference": "113e09fea3d2306319ffaa2423fe3de768b28cff"
"reference": "98bf1b1068b4ceddbbc2a2b70b67a5e380add9e3"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/113e09fea3d2306319ffaa2423fe3de768b28cff",
"reference": "113e09fea3d2306319ffaa2423fe3de768b28cff",
"url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/98bf1b1068b4ceddbbc2a2b70b67a5e380add9e3",
"reference": "98bf1b1068b4ceddbbc2a2b70b67a5e380add9e3",
"shasum": ""
},
"require": {
@ -309,7 +309,7 @@
],
"support": {
"issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues",
"source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.28.0"
"source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.34.1"
},
"funding": [
{
@ -317,7 +317,7 @@
"type": "github"
}
],
"time": "2023-09-22T20:43:40+00:00"
"time": "2023-10-03T23:51:05+00:00"
},
{
"name": "psr/container",
@ -917,16 +917,16 @@
},
{
"name": "symfony/finder",
"version": "v6.3.3",
"version": "v6.3.5",
"source": {
"type": "git",
"url": "https://github.com/symfony/finder.git",
"reference": "9915db259f67d21eefee768c1abcf1cc61b1fc9e"
"reference": "a1b31d88c0e998168ca7792f222cbecee47428c4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/finder/zipball/9915db259f67d21eefee768c1abcf1cc61b1fc9e",
"reference": "9915db259f67d21eefee768c1abcf1cc61b1fc9e",
"url": "https://api.github.com/repos/symfony/finder/zipball/a1b31d88c0e998168ca7792f222cbecee47428c4",
"reference": "a1b31d88c0e998168ca7792f222cbecee47428c4",
"shasum": ""
},
"require": {
@ -961,7 +961,7 @@
"description": "Finds files and directories via an intuitive fluent interface",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/finder/tree/v6.3.3"
"source": "https://github.com/symfony/finder/tree/v6.3.5"
},
"funding": [
{
@ -977,7 +977,7 @@
"type": "tidelift"
}
],
"time": "2023-07-31T08:31:44+00:00"
"time": "2023-09-26T12:56:25+00:00"
},
{
"name": "symfony/options-resolver",
@ -1745,16 +1745,16 @@
},
{
"name": "symfony/string",
"version": "v6.3.2",
"version": "v6.3.5",
"source": {
"type": "git",
"url": "https://github.com/symfony/string.git",
"reference": "53d1a83225002635bca3482fcbf963001313fb68"
"reference": "13d76d0fb049051ed12a04bef4f9de8715bea339"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/string/zipball/53d1a83225002635bca3482fcbf963001313fb68",
"reference": "53d1a83225002635bca3482fcbf963001313fb68",
"url": "https://api.github.com/repos/symfony/string/zipball/13d76d0fb049051ed12a04bef4f9de8715bea339",
"reference": "13d76d0fb049051ed12a04bef4f9de8715bea339",
"shasum": ""
},
"require": {
@ -1811,7 +1811,7 @@
"utf8"
],
"support": {
"source": "https://github.com/symfony/string/tree/v6.3.2"
"source": "https://github.com/symfony/string/tree/v6.3.5"
},
"funding": [
{
@ -1827,7 +1827,7 @@
"type": "tidelift"
}
],
"time": "2023-07-05T08:41:27+00:00"
"time": "2023-09-18T10:38:32+00:00"
}
],
"packages-dev": [],

View File

@ -43,8 +43,8 @@ class FixAccountTypes extends Command
{
use ShowsFriendlyMessages;
protected $description = 'Make sure all journals have the correct from/to account types.';
protected $signature = 'firefly-iii:fix-account-types';
protected $description = 'Make sure all journals have the correct from/to account types.';
protected $signature = 'firefly-iii:fix-account-types';
private int $count;
private array $expected;
private AccountFactory $factory;
@ -62,8 +62,7 @@ class FixAccountTypes extends Command
$this->expected = config('firefly.source_dests');
$expected = config('firefly.source_dests');
$query = TransactionJournal::
leftJoin('transaction_types', 'transaction_journals.transaction_type_id', '=', 'transaction_types.id')
$query = TransactionJournal::leftJoin('transaction_types', 'transaction_journals.transaction_type_id', '=', 'transaction_types.id')
->leftJoin(
'transactions as source',
static function (JoinClause $join) {

View File

@ -88,10 +88,10 @@ class Navigation
if (!array_key_exists($repeatFreq, $functionMap)) {
Log::error(sprintf(
'The periodicity %s is unknown. Choose one of available periodicity: %s',
$repeatFreq,
join(', ', array_keys($functionMap))
));
'The periodicity %s is unknown. Choose one of available periodicity: %s',
$repeatFreq,
join(', ', array_keys($functionMap))
));
return $theDate;
}

View File

@ -72,17 +72,17 @@ class RecurrenceTransformer extends AbstractTransformer
*/
public function transform(Recurrence $recurrence): array
{
Log::debug('Now in Recurrence::transform()');
app('log')->debug('Now in Recurrence::transform()');
$this->repository->setUser($recurrence->user);
$this->piggyRepos->setUser($recurrence->user);
$this->factory->setUser($recurrence->user);
$this->budgetRepos->setUser($recurrence->user);
Log::debug('Set user.');
app('log')->debug('Set user.');
$shortType = (string)config(sprintf('firefly.transactionTypesToShort.%s', $recurrence->transactionType->type));
$notes = $this->repository->getNoteText($recurrence);
$reps = 0 === (int)$recurrence->repetitions ? null : (int)$recurrence->repetitions;
Log::debug('Get basic data.');
app('log')->debug('Get basic data.');
// basic data.
return [
@ -118,7 +118,7 @@ class RecurrenceTransformer extends AbstractTransformer
*/
private function getRepetitions(Recurrence $recurrence): array
{
Log::debug('Now in getRepetitions().');
app('log')->debug('Now in getRepetitions().');
$fromDate = $recurrence->latest_date ?? $recurrence->first_date;
$return = [];
@ -157,7 +157,7 @@ class RecurrenceTransformer extends AbstractTransformer
*/
private function getTransactions(Recurrence $recurrence): array
{
Log::debug(sprintf('Now in %s', __METHOD__));
app('log')->debug(sprintf('Now in %s', __METHOD__));
$return = [];
// get all transactions:
/** @var RecurrenceTransaction $transaction */
@ -246,7 +246,7 @@ class RecurrenceTransformer extends AbstractTransformer
*/
private function getTransactionMeta(RecurrenceTransaction $transaction, array $array): array
{
Log::debug(sprintf('Now in %s', __METHOD__));
app('log')->debug(sprintf('Now in %s', __METHOD__));
$array['tags'] = [];
$array['category_id'] = null;
$array['category_name'] = null;

View File

@ -344,8 +344,8 @@ class TransactionGroupTransformer extends AbstractTransformer
],
];
} catch (FireflyException $e) {
Log::error($e->getMessage());
Log::error($e->getTraceAsString());
app('log')->error($e->getMessage());
app('log')->error($e->getTraceAsString());
throw new FireflyException(sprintf('Transaction group #%d is broken. Please check out your log files.', $group->id), 0, $e);
}

View File

@ -270,7 +270,7 @@ class TransactionGroupTransformer extends AbstractTransformer
*/
private function stringFromArray(NullArrayObject $array, string $key, ?string $default): ?string
{
//Log::debug(sprintf('%s: %s', $key, var_export($array[$key], true)));
//app('log')->debug(sprintf('%s: %s', $key, var_export($array[$key], true)));
if (null === $array[$key] && null === $default) {
return null;
}
@ -301,7 +301,7 @@ class TransactionGroupTransformer extends AbstractTransformer
if (null === $string) {
return null;
}
// Log::debug(sprintf('Now in date("%s")', $string));
// app('log')->debug(sprintf('Now in date("%s")', $string));
if (10 === strlen($string)) {
return Carbon::createFromFormat('Y-m-d', $string, config('app.timezone'));
}

View File

@ -45,7 +45,7 @@ class WebhookMessageTransformer extends AbstractTransformer
try {
$json = json_encode($message->message, JSON_THROW_ON_ERROR);
} catch (JsonException $e) {
Log::error(sprintf('Could not encode webhook message #%d: %s', $message->id, $e->getMessage()));
app('log')->error(sprintf('Could not encode webhook message #%d: %s', $message->id, $e->getMessage()));
}
return [