Use PSR-12 code style

This commit is contained in:
James Cole
2022-10-30 14:24:19 +01:00
parent 64ff5eed27
commit 2eebcb21f1
60 changed files with 103 additions and 158 deletions

View File

@@ -33,7 +33,6 @@ use Illuminate\Support\Collection;
*/
trait AccountCollection
{
/**
* These accounts must not be included.
*

View File

@@ -32,7 +32,6 @@ use Illuminate\Database\Eloquent\Builder as EloquentBuilder;
*/
trait AmountCollection
{
/**
* Get transactions with a specific amount.
*

View File

@@ -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;
}
}

View File

@@ -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;
}
}

View File

@@ -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;

View File

@@ -1395,6 +1395,4 @@ interface GroupCollectorInterface
* @return GroupCollectorInterface
*/
public function yearIsNot(string $year): GroupCollectorInterface;
}