Replace method calls.

This commit is contained in:
James Cole
2025-09-10 16:07:19 +02:00
parent a3674c4dfe
commit cb0b42e44b
51 changed files with 87 additions and 91 deletions

View File

@@ -90,7 +90,7 @@ class AccountEnrichment implements EnrichmentInterface
public function enrichSingle(array|Model $model): Account|array
{
Log::debug(__METHOD__);
$collection = new Collection([$model]);
$collection = new Collection()->push($model);
$collection = $this->enrich($collection);
return $collection->first();

View File

@@ -73,7 +73,7 @@ class BudgetEnrichment implements EnrichmentInterface
public function enrichSingle(array|Model $model): array|Model
{
Log::debug(__METHOD__);
$collection = new Collection([$model]);
$collection = new Collection()->push($model);
$collection = $this->enrich($collection);
return $collection->first();
@@ -167,7 +167,7 @@ class BudgetEnrichment implements EnrichmentInterface
$opsRepository->setUser($this->user);
$opsRepository->setUserGroup($this->userGroup);
// $spent = $this->beautify();
// $set = $this->opsRepository->sumExpenses($start, $end, null, new Collection([$budget]))
// $set = $this->opsRepository->sumExpenses($start, $end, null, new Collection()->push($budget))
$expenses = $opsRepository->collectExpenses($this->start, $this->end, null, $this->collection, null);
foreach ($this->collection as $item) {
$id = (int)$item->id;

View File

@@ -65,7 +65,7 @@ class CategoryEnrichment implements EnrichmentInterface
public function enrichSingle(array|Model $model): array|Model
{
Log::debug(__METHOD__);
$collection = new Collection([$model]);
$collection = new Collection()->push($model);
$collection = $this->enrich($collection);
return $collection->first();

View File

@@ -80,7 +80,7 @@ class PiggyBankEnrichment implements EnrichmentInterface
public function enrichSingle(array|Model $model): array|Model
{
Log::debug(__METHOD__);
$collection = new Collection([$model]);
$collection = new Collection()->push($model);
$collection = $this->enrich($collection);
return $collection->first();

View File

@@ -69,7 +69,7 @@ class PiggyBankEventEnrichment implements EnrichmentInterface
public function enrichSingle(array|Model $model): array|Model
{
Log::debug(__METHOD__);
$collection = new Collection([$model]);
$collection = new Collection()->push($model);
$collection = $this->enrich($collection);
return $collection->first();

View File

@@ -101,7 +101,7 @@ class RecurringEnrichment implements EnrichmentInterface
public function enrichSingle(array|Model $model): array|Model
{
Log::debug(__METHOD__);
$collection = new Collection([$model]);
$collection = new Collection()->push($model);
$collection = $this->enrich($collection);
return $collection->first();

View File

@@ -145,7 +145,7 @@ class SubscriptionEnrichment implements EnrichmentInterface
public function enrichSingle(array|Model $model): array|Model
{
Log::debug(__METHOD__);
$collection = new Collection([$model]);
$collection = new Collection()->push($model);
$collection = $this->enrich($collection);
return $collection->first();

View File

@@ -68,7 +68,7 @@ class TransactionGroupEnrichment implements EnrichmentInterface
{
Log::debug(__METHOD__);
if (is_array($model)) {
$collection = new Collection([$model]);
$collection = new Collection()->push($model);
$collection = $this->enrich($collection);
return $collection->first();

View File

@@ -70,7 +70,7 @@ class WebhookEnrichment implements EnrichmentInterface
public function enrichSingle(array|Model $model): array|Model
{
Log::debug(__METHOD__);
$collection = new Collection([$model]);
$collection = new Collection()->push($model);
$collection = $this->enrich($collection);
return $collection->first();