mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 23:45:10 +00:00
Use PSR-12 code style
This commit is contained in:
@@ -59,9 +59,9 @@ class AttachmentHelper implements AttachmentHelperInterface
|
||||
{
|
||||
$this->maxUploadSize = (int) config('firefly.maxUploadSize');
|
||||
$this->allowedMimes = (array) config('firefly.allowedMimes');
|
||||
$this->errors = new MessageBag;
|
||||
$this->messages = new MessageBag;
|
||||
$this->attachments = new Collection;
|
||||
$this->errors = new MessageBag();
|
||||
$this->messages = new MessageBag();
|
||||
$this->attachments = new Collection();
|
||||
$this->uploadDisk = Storage::disk('upload');
|
||||
}
|
||||
|
||||
@@ -145,11 +145,9 @@ class AttachmentHelper implements AttachmentHelperInterface
|
||||
{
|
||||
$resource = tmpfile();
|
||||
if (false === $resource) {
|
||||
|
||||
Log::error('Cannot create temp-file for file upload.');
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
if ('' === $content) {
|
||||
@@ -239,7 +237,7 @@ class AttachmentHelper implements AttachmentHelperInterface
|
||||
$user = $model->account->user;
|
||||
}
|
||||
|
||||
$attachment = new Attachment; // create Attachment object.
|
||||
$attachment = new Attachment(); // create Attachment object.
|
||||
$attachment->user()->associate($user);
|
||||
$attachment->attachable()->associate($model);
|
||||
$attachment->md5 = md5_file($file->getRealPath());
|
||||
|
@@ -33,7 +33,6 @@ use Illuminate\Support\Collection;
|
||||
*/
|
||||
trait AccountCollection
|
||||
{
|
||||
|
||||
/**
|
||||
* These accounts must not be included.
|
||||
*
|
||||
|
@@ -32,7 +32,6 @@ use Illuminate\Database\Eloquent\Builder as EloquentBuilder;
|
||||
*/
|
||||
trait AmountCollection
|
||||
{
|
||||
|
||||
/**
|
||||
* Get transactions with a specific amount.
|
||||
*
|
||||
|
@@ -855,7 +855,7 @@ trait MetaCollection
|
||||
$filter = function (int $index, array $object) use ($list): bool {
|
||||
foreach ($object['transactions'] as $transaction) {
|
||||
foreach ($transaction['tags'] as $tag) {
|
||||
if (in_array($tag['name'], $list)) {
|
||||
if (in_array($tag['name'], $list, true)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@@ -100,7 +100,6 @@ trait TimeCollection
|
||||
$this->postFilters[] = $filter;
|
||||
|
||||
return $this;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -430,7 +429,6 @@ trait TimeCollection
|
||||
{
|
||||
$this->query->whereMonth('transaction_journals.date', '>=', $month);
|
||||
return $this;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -441,7 +439,6 @@ trait TimeCollection
|
||||
{
|
||||
$this->query->whereMonth('transaction_journals.date', '<=', $month);
|
||||
return $this;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -718,7 +715,6 @@ trait TimeCollection
|
||||
};
|
||||
$this->postFilters[] = $filter;
|
||||
return $this;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -841,5 +837,4 @@ trait TimeCollection
|
||||
$this->query->whereYear('transaction_journals.date', '!=', $year);
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -50,7 +50,12 @@ use Log;
|
||||
*/
|
||||
class GroupCollector implements GroupCollectorInterface
|
||||
{
|
||||
use CollectorProperties, AccountCollection, AmountCollection, TimeCollection, MetaCollection, AttachmentCollection;
|
||||
use CollectorProperties;
|
||||
use AccountCollection;
|
||||
use AmountCollection;
|
||||
use TimeCollection;
|
||||
use MetaCollection;
|
||||
use AttachmentCollection;
|
||||
|
||||
/**
|
||||
* Group collector constructor.
|
||||
@@ -352,7 +357,6 @@ class GroupCollector implements GroupCollectorInterface
|
||||
*/
|
||||
public function excludeIds(array $groupIds): GroupCollectorInterface
|
||||
{
|
||||
|
||||
$this->query->whereNotIn('transaction_groups.id', $groupIds);
|
||||
|
||||
return $this;
|
||||
@@ -767,7 +771,7 @@ class GroupCollector implements GroupCollectorInterface
|
||||
* @var Closure $function
|
||||
*/
|
||||
foreach ($this->postFilters as $function) {
|
||||
$nextCollection = new Collection;
|
||||
$nextCollection = new Collection();
|
||||
// loop everything in the current collection
|
||||
// and save it (or not) in the new collection.
|
||||
// that new collection is the next current collection
|
||||
@@ -874,7 +878,6 @@ class GroupCollector implements GroupCollectorInterface
|
||||
*/
|
||||
public function setIds(array $groupIds): GroupCollectorInterface
|
||||
{
|
||||
|
||||
$this->query->whereIn('transaction_groups.id', $groupIds);
|
||||
|
||||
return $this;
|
||||
@@ -992,7 +995,6 @@ class GroupCollector implements GroupCollectorInterface
|
||||
if (null === $this->user) {
|
||||
$this->user = $user;
|
||||
$this->startQuery();
|
||||
|
||||
}
|
||||
|
||||
return $this;
|
||||
|
@@ -1395,6 +1395,4 @@ interface GroupCollectorInterface
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function yearIsNot(string $year): GroupCollectorInterface;
|
||||
|
||||
|
||||
}
|
||||
|
@@ -67,7 +67,7 @@ class NetWorth implements NetWorthInterface
|
||||
public function getNetWorthByCurrency(Collection $accounts, Carbon $date): array
|
||||
{
|
||||
// start in the past, end in the future? use $date
|
||||
$cache = new CacheProperties;
|
||||
$cache = new CacheProperties();
|
||||
$cache->addProperty($date);
|
||||
$cache->addProperty('net-worth-by-currency');
|
||||
$cache->addProperty(implode(',', $accounts->pluck('id')->toArray()));
|
||||
@@ -184,7 +184,7 @@ class NetWorth implements NetWorthInterface
|
||||
private function getAccounts(): Collection
|
||||
{
|
||||
$accounts = $this->accountRepository->getAccountsByType([AccountType::ASSET, AccountType::LOAN, AccountType::DEBT, AccountType::MORTGAGE, AccountType::DEFAULT, AccountType::CREDITCARD]);
|
||||
$filtered = new Collection;
|
||||
$filtered = new Collection();
|
||||
/** @var Account $account */
|
||||
foreach ($accounts as $account) {
|
||||
if (1 === (int) $this->accountRepository->getMetaValue($account, 'include_net_worth')) {
|
||||
|
@@ -66,5 +66,4 @@ interface NetWorthInterface
|
||||
* @return array
|
||||
*/
|
||||
public function sumNetWorthByCurrency(Carbon $date): array;
|
||||
|
||||
}
|
||||
|
@@ -31,7 +31,6 @@ use FireflyIII\Models\Category;
|
||||
*/
|
||||
interface PopupReportInterface
|
||||
{
|
||||
|
||||
/**
|
||||
* Get balances for budget.
|
||||
*
|
||||
|
@@ -28,7 +28,6 @@ use FireflyIII\Models\WebhookMessage;
|
||||
use JsonException;
|
||||
use Log;
|
||||
|
||||
|
||||
/**
|
||||
* Class Sha3SignatureGenerator
|
||||
*/
|
||||
|
Reference in New Issue
Block a user