remove old inspections

This commit is contained in:
James Cole 2022-10-30 12:12:35 +01:00
parent 6b64a39182
commit 914dc8596b
No known key found for this signature in database
GPG Key ID: B49A324B7EAD6D80
34 changed files with 1 additions and 61 deletions

View File

@ -6,27 +6,11 @@ includes:
parameters:
ignoreErrors:
- '#is not allowed to extend#'
- '#is neither abstract nor final#'
- '#Control structures using switch should not be used\.#'
- '#has a nullable return type declaration#'
- '#with a nullable type declaration#'
- '#with null as default value#'
- '#Constructor in [a-zA-Z0-9\\_]+ has parameter \$[a-zA-Z0-9\\_]+ with default value#'
-
message: '#Function compact\(\) should not be used.#'
paths:
- ../app/Http/Controllers
- ../app/Support/Http/Controllers/RenderPartialViews.php
- ../app/Support/Form/FormSupport.php
- ../app/Support/Form/CurrencyForm.php
- ../app/Support/Form/AccountForm.php
- ../app/Support/ExpandedForm.php
- ../app/Generator/Report
paths:
- ../app
- ../database
- ../routes
- ../tests
- ../bootstrap/app.php
# The level 8 is the highest level. original was 5

View File

@ -232,7 +232,6 @@ class BackToJournals extends Command
$set = DB::table('transactions') // @phpstan-ignore-line
->whereIn('transactions.id', $chunk)
->get(['transaction_journal_id'])->pluck('transaction_journal_id')->toArray();
/** @noinspection SlowArrayOperationsInLoopInspection */
$array = array_merge($array, $set);
}

View File

@ -20,8 +20,6 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/** @noinspection MultipleReturnStatementsInspection */
declare(strict_types=1);
namespace FireflyIII\Exceptions;

View File

@ -18,7 +18,6 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/** @noinspection MultipleReturnStatementsInspection */
declare(strict_types=1);
namespace FireflyIII\Factory;

View File

@ -18,7 +18,6 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/** @noinspection MultipleReturnStatementsInspection */
declare(strict_types=1);
namespace FireflyIII\Factory;

View File

@ -18,7 +18,6 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/** @noinspection MultipleReturnStatementsInspection */
declare(strict_types=1);
namespace FireflyIII\Factory;

View File

@ -18,7 +18,6 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/** @noinspection MultipleReturnStatementsInspection */
declare(strict_types=1);
namespace FireflyIII\Factory;

View File

@ -18,7 +18,6 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/** @noinspection MultipleReturnStatementsInspection */
declare(strict_types=1);

View File

@ -18,7 +18,6 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/** @noinspection MultipleReturnStatementsInspection */
declare(strict_types=1);

View File

@ -19,8 +19,6 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/** @noinspection MultipleReturnStatementsInspection */
declare(strict_types=1);
namespace FireflyIII\Factory;

View File

@ -18,7 +18,6 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/** @noinspection MultipleReturnStatementsInspection */
declare(strict_types=1);

View File

@ -18,7 +18,6 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/** @noinspection MultipleReturnStatementsInspection */
declare(strict_types=1);
namespace FireflyIII\Generator\Report\Budget;

View File

@ -18,7 +18,6 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/** @noinspection MultipleReturnStatementsInspection */
declare(strict_types=1);
namespace FireflyIII\Generator\Report\Category;

View File

@ -19,7 +19,6 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/** @noinspection MultipleReturnStatementsInspection */
declare(strict_types=1);
namespace FireflyIII\Generator\Report\Tag;

View File

@ -18,7 +18,6 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/** @noinspection NullPointerExceptionInspection */
declare(strict_types=1);
namespace FireflyIII\Handlers\Events;

View File

@ -18,8 +18,6 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/** @noinspection MultipleReturnStatementsInspection */
/** @noinspection NullPointerExceptionInspection */
declare(strict_types=1);
namespace FireflyIII\Handlers\Events;

View File

@ -18,7 +18,6 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/** @noinspection CallableParameterUseCaseInTypeContextInspection */
declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Account;

View File

@ -18,7 +18,6 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/** @noinspection CallableParameterUseCaseInTypeContextInspection */
declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Account;

View File

@ -144,7 +144,6 @@ class ResetPasswordController extends Controller
$allowRegistration = false;
}
/** @noinspection PhpUndefinedFieldInspection */
return view('auth.passwords.reset')->with(
['token' => $token, 'email' => $request->email, 'allowRegistration' => $allowRegistration, 'pageTitle' => $pageTitle]
);

View File

@ -19,7 +19,6 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/** @noinspection MoreThanThreeArgumentsInspection */
declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Chart;

View File

@ -120,7 +120,6 @@ class HomeController extends Controller
$start = session('start', Carbon::now()->startOfMonth());
/** @var Carbon $end */
$end = session('end', Carbon::now()->endOfMonth());
/** @noinspection NullPointerExceptionInspection */
$accounts = $repository->getAccountsById($frontPage->data);
$today = today(config('app.timezone'));

View File

@ -57,7 +57,6 @@ class JavascriptController extends Controller
[AccountType::DEFAULT, AccountType::ASSET, AccountType::DEBT, AccountType::LOAN, AccountType::MORTGAGE, AccountType::CREDITCARD]
);
$preference = app('preferences')->get('currencyPreference', config('firefly.default_currency', 'EUR'));
/** @noinspection NullPointerExceptionInspection */
$default = $currencyRepository->findByCodeNull((string) $preference->data);
$data = ['accounts' => []];
@ -66,7 +65,6 @@ class JavascriptController extends Controller
foreach ($accounts as $account) {
$accountId = $account->id;
$currency = (int) $repository->getMetaValue($account, 'currency_id');
/** @noinspection NullPointerExceptionInspection */
$currency = 0 === $currency ? $default->id : $currency;
$entry = ['preferredCurrency' => $currency, 'name' => $account->name];
$data['accounts'][$accountId] = $entry;
@ -124,7 +122,6 @@ class JavascriptController extends Controller
$accounting = app('amount')->getJsConfig();
$accounting['frac_digits'] = $currency->decimal_places;
$pref = app('preferences')->get('language', config('firefly.default_language', 'en_US'));
/** @noinspection NullPointerExceptionInspection */
$lang = $pref->data;
$dateRange = $this->getDateRangeConfig();
$uid = substr(hash('sha256', sprintf('%s-%s-%s', (string) config('app.key'), auth()->user()->id, auth()->user()->email)), 0, 12);

View File

@ -18,7 +18,6 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/** @noinspection CallableParameterUseCaseInTypeContextInspection */
declare(strict_types=1);
namespace FireflyIII\Http\Controllers;

View File

@ -52,8 +52,6 @@ class InstallController extends Controller
public const OTHER_ERROR = 'An unknown error prevented Firefly III from executing the upgrade commands. Sorry.';
private string $lastError;
private array $upgradeCommands;
/** @noinspection MagicMethodsValidityInspection */
/** @noinspection PhpMissingParentConstructorInspection */
/**
* InstallController constructor.

View File

@ -91,11 +91,9 @@ class Authenticate
if (empty($guards)) {
try {
// go for default guard:
/** @noinspection PhpUndefinedMethodInspection */
if ($this->auth->check()) {
// do an extra check on user object.
/** @noinspection PhpUndefinedMethodInspection */
/** @var User $user */
$user = $this->auth->authenticate();
if (1 === (int) $user->blocked) {
@ -104,7 +102,6 @@ class Authenticate
$message = (string) trans('firefly.email_changed_logout');
}
app('session')->flash('logoutMessage', $message);
/** @noinspection PhpUndefinedMethodInspection */
$this->auth->logout();
throw new AuthenticationException('Blocked account.', $guards);
@ -121,14 +118,12 @@ class Authenticate
}
/** @noinspection PhpUndefinedMethodInspection */
return $this->auth->authenticate();
}
foreach ($guards as $guard) {
if ($this->auth->guard($guard)->check()) {
/** @noinspection PhpVoidFunctionResultUsedInspection */
return $this->auth->shouldUse($guard); // @phpstan-ignore-line
}
}

View File

@ -145,7 +145,6 @@ class NoBudgetRepository implements NoBudgetRepositoryInterface
return $return;
}
/** @noinspection MoreThanThreeArgumentsInspection */
/**
* TODO this method does not include multi currency. It just counts.
* TODO this probably also applies to the other "sumExpenses" methods.

View File

@ -58,7 +58,6 @@ interface NoBudgetRepositoryInterface
*/
public function spentInPeriodWoBudgetMc(Collection $accounts, Carbon $start, Carbon $end): array;
/** @noinspection MoreThanThreeArgumentsInspection */
/**
* @param Carbon $start
* @param Carbon $end

View File

@ -211,7 +211,6 @@ class OperationsRepository implements OperationsRepositoryInterface
return $repos->getActiveBudgets();
}
/** @noinspection MoreThanThreeArgumentsInspection */
/**
* @param User $user

View File

@ -74,7 +74,6 @@ interface OperationsRepositoryInterface
*/
public function setUser(User $user): void;
/** @noinspection MoreThanThreeArgumentsInspection */
/**
* Return multi-currency spent information.

View File

@ -70,7 +70,6 @@ class JournalCLIRepository implements JournalCLIRepositoryInterface
if (null !== $budget) {
return $budget->id;
}
/** @noinspection NullPointerExceptionInspection */
$budget = $journal->transactions()->first()->budgets()->first();
if (null !== $budget) {
return $budget->id;
@ -92,7 +91,6 @@ class JournalCLIRepository implements JournalCLIRepositoryInterface
if (null !== $category) {
return $category->id;
}
/** @noinspection NullPointerExceptionInspection */
$category = $journal->transactions()->first()->categories()->first();
if (null !== $category) {
return $category->id;

View File

@ -66,7 +66,6 @@ class Amount
* @return string
*
* @throws FireflyException
* @noinspection MoreThanThreeArgumentsInspection
*/
public function formatFlat(string $symbol, int $decimalPlaces, string $amount, bool $coloured = null): string
{

View File

@ -81,7 +81,6 @@ trait ModelInformation
$debt = $repository->getAccountTypeByType(AccountType::DEBT);
$loan = $repository->getAccountTypeByType(AccountType::LOAN);
$mortgage = $repository->getAccountTypeByType(AccountType::MORTGAGE);
/** @noinspection NullPointerExceptionInspection */
$liabilityTypes = [
$debt->id => (string) trans(sprintf('firefly.account_type_%s', AccountType::DEBT)),
$loan->id => (string) trans(sprintf('firefly.account_type_%s', AccountType::LOAN)),

View File

@ -37,7 +37,6 @@ use Twig\TwigFunction;
*/
class TransactionGroupTwig extends AbstractExtension
{
/** @noinspection PhpMissingParentCallCommonInspection */
/**
* @return array
*

View File

@ -54,7 +54,6 @@ require __DIR__ . '/../vendor/autoload.php';
|
*/
/** @noinspection UsingInclusionOnceReturnValueInspection */
$app = require_once __DIR__ . '/../bootstrap/app.php';