mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-12-12 01:42:32 +00:00
Various PSR12 code cleanup
This commit is contained in:
@@ -52,7 +52,7 @@ class AccountTransformer extends AbstractTransformer
|
||||
/**
|
||||
* Transform the account.
|
||||
*
|
||||
* @param Account $account
|
||||
* @param Account $account
|
||||
*
|
||||
* @return array
|
||||
* @throws JsonException
|
||||
@@ -63,8 +63,8 @@ class AccountTransformer extends AbstractTransformer
|
||||
|
||||
// get account type:
|
||||
$fullType = $account->accountType->type;
|
||||
$accountType = (string) config(sprintf('firefly.shortNamesByFullName.%s', $fullType));
|
||||
$liabilityType = (string) config(sprintf('firefly.shortLiabilityNameByFullName.%s', $fullType));
|
||||
$accountType = (string)config(sprintf('firefly.shortNamesByFullName.%s', $fullType));
|
||||
$liabilityType = (string)config(sprintf('firefly.shortLiabilityNameByFullName.%s', $fullType));
|
||||
$liabilityType = '' === $liabilityType ? null : strtolower($liabilityType);
|
||||
$liabilityDirection = $this->repository->getMetaValue($account, 'liability_direction');
|
||||
|
||||
@@ -87,17 +87,17 @@ class AccountTransformer extends AbstractTransformer
|
||||
if (null !== $location) {
|
||||
$longitude = $location->longitude;
|
||||
$latitude = $location->latitude;
|
||||
$zoomLevel = (int) $location->zoom_level;
|
||||
$zoomLevel = (int)$location->zoom_level;
|
||||
}
|
||||
|
||||
// no order for some accounts:
|
||||
$order = (int) $account->order;
|
||||
$order = (int)$account->order;
|
||||
if (!in_array(strtolower($accountType), ['liability', 'liabilities', 'asset'], true)) {
|
||||
$order = null;
|
||||
}
|
||||
|
||||
return [
|
||||
'id' => (string) $account->id,
|
||||
'id' => (string)$account->id,
|
||||
'created_at' => $account->created_at->toAtomString(),
|
||||
'updated_at' => $account->updated_at->toAtomString(),
|
||||
'active' => $account->active,
|
||||
@@ -132,23 +132,23 @@ class AccountTransformer extends AbstractTransformer
|
||||
'links' => [
|
||||
[
|
||||
'rel' => 'self',
|
||||
'uri' => '/accounts/' . $account->id,
|
||||
'uri' => '/accounts/'.$account->id,
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Account $account
|
||||
* @param Account $account
|
||||
*
|
||||
* @param string $accountType
|
||||
* @param string $accountType
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
private function getAccountRole(Account $account, string $accountType): ?string
|
||||
{
|
||||
$accountRole = $this->repository->getMetaValue($account, 'account_role');
|
||||
if ('asset' !== $accountType || '' === (string) $accountRole) {
|
||||
if ('asset' !== $accountType || '' === (string)$accountRole) {
|
||||
$accountRole = null;
|
||||
}
|
||||
|
||||
@@ -170,7 +170,7 @@ class AccountTransformer extends AbstractTransformer
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Account $account
|
||||
* @param Account $account
|
||||
*
|
||||
* @return array
|
||||
* @throws FireflyException
|
||||
@@ -184,7 +184,7 @@ class AccountTransformer extends AbstractTransformer
|
||||
if (null === $currency) {
|
||||
$currency = app('amount')->getDefaultCurrencyByUser($account->user);
|
||||
}
|
||||
$currencyId = (string) $currency->id;
|
||||
$currencyId = (string)$currency->id;
|
||||
$currencyCode = $currency->code;
|
||||
$decimalPlaces = $currency->decimal_places;
|
||||
$currencySymbol = $currency->symbol;
|
||||
@@ -193,9 +193,9 @@ class AccountTransformer extends AbstractTransformer
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Account $account
|
||||
* @param string|null $accountRole
|
||||
* @param string $accountType
|
||||
* @param Account $account
|
||||
* @param string|null $accountRole
|
||||
* @param string $accountType
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@@ -215,8 +215,8 @@ class AccountTransformer extends AbstractTransformer
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Account $account
|
||||
* @param string $accountType
|
||||
* @param Account $account
|
||||
* @param string $accountType
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
@@ -239,8 +239,8 @@ class AccountTransformer extends AbstractTransformer
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Account $account
|
||||
* @param string $accountType
|
||||
* @param Account $account
|
||||
* @param string $accountType
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user