chore: fix various small sonacloud issues to see if the actions run correctly.

This commit is contained in:
James Cole
2023-05-29 14:17:10 +02:00
parent 023a3fdade
commit 6ed5892cf9
5 changed files with 10 additions and 11 deletions

View File

@@ -41,7 +41,7 @@ use Symfony\Component\HttpFoundation\ParameterBag;
*/
class ShowController extends Controller
{
private ALERepositoryInterface $ALERepository;
private ALERepositoryInterface $aleRepository;
private TransactionGroupRepositoryInterface $repository;
/**
@@ -55,7 +55,7 @@ class ShowController extends Controller
$this->middleware(
function ($request, $next) {
$this->repository = app(TransactionGroupRepositoryInterface::class);
$this->ALERepository = app(ALERepositoryInterface::class);
$this->aleRepository = app(ALERepositoryInterface::class);
app('view')->share('title', (string)trans('firefly.transactions'));
app('view')->share('mainTitleIcon', 'fa-exchange');
@@ -112,7 +112,7 @@ class ShowController extends Controller
// get audit log entries:
$logEntries = [];
foreach ($transactionGroup->transactionJournals as $journal) {
$logEntries[$journal->id] = $this->ALERepository->getForObject($journal);
$logEntries[$journal->id] = $this->aleRepository->getForObject($journal);
}
$events = $this->repository->getPiggyEvents($transactionGroup);

View File

@@ -212,7 +212,7 @@ class LinkTypeRepository implements LinkTypeRepositoryInterface
return $merged->filter(
function (TransactionJournalLink $link) {
return (null !== $link->source && null !== $link->destination);
return null !== $link->source && null !== $link->destination;
}
);
}

View File

@@ -125,9 +125,8 @@ class RecurrenceUpdateService
$originalCount = $recurrence->recurrenceRepetitions()->count();
if (1 === $originalCount) {
Log::debug('Return the first one');
/** @var RecurrenceRepetition $result */
$result = $recurrence->recurrenceRepetitions()->first();
return $result;
/** @var RecurrenceRepetition|null */
return $recurrence->recurrenceRepetitions()->first();
}
// find it:
$fields = [

View File

@@ -437,7 +437,7 @@ class OperatorQuerySearch implements SearchInterface
$stringMethod = 'str_contains';
}
if (4 === $stringPosition) {
$stringMethod = 'str_is_equal';
$stringMethod = 'stringIsEqual';
}
// get accounts:
@@ -515,7 +515,7 @@ class OperatorQuerySearch implements SearchInterface
$stringMethod = 'str_contains';
}
if (4 === $stringPosition) {
$stringMethod = 'str_is_equal';
$stringMethod = 'stringIsEqual';
}
// search for accounts:

View File

@@ -52,14 +52,14 @@ if (!function_exists('envNonEmpty')) {
}
}
if (!function_exists('str_is_equal')) {
if (!function_exists('stringIsEqual')) {
/**
* @param string $left
* @param string $right
*
* @return bool
*/
function str_is_equal(string $left, string $right): bool
function stringIsEqual(string $left, string $right): bool
{
return $left === $right;
}