mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-08-19 01:14:43 -05:00
Fix various phpstan issues.
This commit is contained in:
@@ -34,10 +34,6 @@ parameters:
|
||||
reportUnmatchedIgnoredErrors: true
|
||||
ignoreErrors:
|
||||
# these are actually interesting but not right now:
|
||||
- identifier: larastan.noUnnecessaryCollectionCall
|
||||
- identifier: varTag.differentVariable
|
||||
- identifier: identical.alwaysTrue
|
||||
- identifier: assign.propertyReadOnly
|
||||
- identifier: varTag.nativeType
|
||||
- identifier: property.onlyWritten
|
||||
- identifier: parameter.phpDocType
|
||||
|
||||
@@ -224,7 +224,8 @@ abstract class Controller extends BaseController
|
||||
$value = min(max(1, $value), 2 ** 16);
|
||||
$bag->set($integer, $value);
|
||||
}
|
||||
if (null === $value && 'limit' === $integer && auth()->check()) {
|
||||
// && 'limit' === $integer
|
||||
if (null === $value && auth()->check()) {
|
||||
// set default for user:
|
||||
/** @var User $user */
|
||||
$user = auth()->user();
|
||||
|
||||
@@ -48,6 +48,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
final class UpdateController extends Controller
|
||||
{
|
||||
private TransactionGroupRepositoryInterface $groupRepository;
|
||||
protected array $acceptedRoles = [];
|
||||
|
||||
/**
|
||||
* TransactionController constructor.
|
||||
|
||||
@@ -64,10 +64,6 @@ class RemovesDatabaseDecryption extends Command
|
||||
'journal_links' => ['comment'],
|
||||
];
|
||||
|
||||
/**
|
||||
* @var string $table
|
||||
* @var array $fields
|
||||
*/
|
||||
foreach ($tables as $table => $fields) {
|
||||
$this->decryptTable($table, $fields);
|
||||
}
|
||||
|
||||
@@ -52,13 +52,13 @@ class DeletedAccountObserver
|
||||
$journalIds = Transaction::where('account_id', $account->id)
|
||||
->get(['transactions.transaction_journal_id'])
|
||||
->pluck('transaction_journal_id')
|
||||
->toArray()
|
||||
;
|
||||
$groupIds = TransactionJournal::whereIn('id', $journalIds)
|
||||
->toArray();
|
||||
|
||||
$groupIds = array_map(function (array $item) {
|
||||
return $item['transaction_group_id'];
|
||||
}, TransactionJournal::whereIn('id', $journalIds)
|
||||
->get(['transaction_journals.transaction_group_id'])
|
||||
->pluck('transaction_group_id')
|
||||
->toArray()
|
||||
;
|
||||
->toArray());
|
||||
|
||||
if (count($journalIds) > 0) {
|
||||
Transaction::whereIn('transaction_journal_id', $journalIds)->delete();
|
||||
|
||||
@@ -224,7 +224,7 @@ final class IndexController extends Controller
|
||||
Log::debug(sprintf('(getAllBudgets) Start is "%s", end is "%s"', $start->format('Y-m-d H:i:s'), $end->format('Y-m-d H:i:s')));
|
||||
|
||||
// complement budget with budget limits in range, and expenses in currency X in range.
|
||||
/** @var Budget $current */
|
||||
/** @var Budget $budget */
|
||||
foreach ($collection as $budget) {
|
||||
Log::debug(sprintf('Working on budget #%d ("%s")', $budget->id, $budget->name));
|
||||
$array = $budget->toArray();
|
||||
|
||||
@@ -31,6 +31,7 @@ use FireflyIII\Events\Security\System\SystemRequestedVersionCheck;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Helpers\Collector\GroupCollectorInterface;
|
||||
use FireflyIII\Http\Middleware\Installer;
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
|
||||
use FireflyIII\Repositories\Bill\BillRepositoryInterface;
|
||||
use FireflyIII\Support\Facades\Preferences;
|
||||
|
||||
@@ -42,6 +42,9 @@ use Illuminate\Database\Eloquent\Relations\MorphToMany;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
|
||||
/**
|
||||
* @property AccountType $accountType
|
||||
*/
|
||||
#[ObservedBy([DeletedAccountObserver::class])]
|
||||
class Account extends Model
|
||||
{
|
||||
|
||||
@@ -34,6 +34,7 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* @property Carbon $date
|
||||
* @property PiggyBank $piggyBank
|
||||
*/
|
||||
#[ObservedBy([PiggyBankEventObserver::class])]
|
||||
class PiggyBankEvent extends Model
|
||||
|
||||
@@ -33,10 +33,12 @@ use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Illuminate\Support\Collection;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
|
||||
/**
|
||||
* @property User $user
|
||||
* @property Collection<RuleTrigger> $ruleTriggers
|
||||
*/
|
||||
#[ObservedBy([DeletedRuleObserver::class])]
|
||||
class Rule extends Model
|
||||
|
||||
@@ -30,7 +30,6 @@ use GuzzleHttp\Client;
|
||||
use GuzzleHttp\Exception\ClientException;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Override;
|
||||
|
||||
use function Safe\file_get_contents;
|
||||
use function Safe\json_decode;
|
||||
|
||||
@@ -103,15 +102,11 @@ class GitHubUpdateRequest implements UpdateRequestInterface
|
||||
|
||||
return $response;
|
||||
}
|
||||
if (1 === $res) {
|
||||
$response->setNewVersionAvailable(true);
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
// return $response;
|
||||
}
|
||||
|
||||
private function filterReleases(array $releases): array
|
||||
{
|
||||
$return = [];
|
||||
|
||||
Reference in New Issue
Block a user