PHPStorm can order methods by alphabet, who knew.

This commit is contained in:
James Cole
2024-02-22 20:11:09 +01:00
parent f9d4a43e05
commit 68c9c4ec3c
221 changed files with 5840 additions and 5843 deletions

View File

@@ -41,7 +41,7 @@ class DoubleController extends Controller
{
use AugumentData;
protected AccountRepositoryInterface $accountRepository;
protected AccountRepositoryInterface $accountRepository;
private OperationsRepositoryInterface $opsRepository;
/**
@@ -278,6 +278,24 @@ class DoubleController extends Controller
return view('reports.double.partials.accounts', compact('sums', 'report'));
}
/**
* TODO this method is duplicated.
*/
private function getCounterpartName(Collection $accounts, int $id, string $name, ?string $iban): string
{
/** @var Account $account */
foreach ($accounts as $account) {
if ($account->name === $name && $account->id !== $id) {
return $account->name;
}
if (null !== $account->iban && $account->iban === $iban && $account->id !== $id) {
return $account->iban;
}
}
return $name;
}
/**
* @return Factory|View
*/
@@ -468,22 +486,4 @@ class DoubleController extends Controller
return $result;
}
/**
* TODO this method is duplicated.
*/
private function getCounterpartName(Collection $accounts, int $id, string $name, ?string $iban): string
{
/** @var Account $account */
foreach ($accounts as $account) {
if ($account->name === $name && $account->id !== $id) {
return $account->name;
}
if (null !== $account->iban && $account->iban === $iban && $account->id !== $id) {
return $account->iban;
}
}
return $name;
}
}