Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Remove unnecessary slash from in_array()
James Cole956ec23d3c73
diff --git a/app/Helpers/Attachments/AttachmentHelper.php b/app/Helpers/Attachments/AttachmentHelper.phpindex 7e2cdaef77..7ef3ce9a05 100644--- a/app/Helpers/Attachments/AttachmentHelper.php+++ b/app/Helpers/Attachments/AttachmentHelper.php@@ -196,7 +196,7 @@ class AttachmentHelper implements AttachmentHelperInterfacereturn false; // @codeCoverageIgnore}Log::debug(sprintf('Now in saveAttachmentsForModel for model %s', get_class($model)));- if (\is_array($files)) {+ if (is_array($files)) {Log::debug('$files is an array.');/** @var UploadedFile $entry */foreach ($files as $entry) {@@ -206,7 +206,7 @@ class AttachmentHelper implements AttachmentHelperInterface}Log::debug('Done processing uploads.');}- if (!\is_array($files) || (\is_array($files) && 0 === count($files))) {+ if (!is_array($files) || (is_array($files) && 0 === count($files))) {Log::debug('Array of files is not an array. Probably nothing uploaded. Will not store attachments.');}diff --git a/app/Http/Controllers/Json/IntroController.php b/app/Http/Controllers/Json/IntroController.phpindex acd0dcb637..3d43810b4d 100644--- a/app/Http/Controllers/Json/IntroController.php+++ b/app/Http/Controllers/Json/IntroController.php@@ -82,7 +82,7 @@ class IntroController$routeKey = str_replace('.', '_', $route);Log::debug(sprintf('Has outro step for route %s', $routeKey));$elements = config(sprintf('intro.%s', $routeKey));- if (!\is_array($elements)) {+ if (!is_array($elements)) {return false;}diff --git a/app/Http/Controllers/PreferencesController.php b/app/Http/Controllers/PreferencesController.phpindex 00d98419a0..e4238c03c0 100644--- a/app/Http/Controllers/PreferencesController.php+++ b/app/Http/Controllers/PreferencesController.php@@ -105,7 +105,7 @@ class PreferencesController extends Controller{// front page accounts$frontPageAccounts = [];- if (\is_array($request->get('frontPageAccounts')) && count($request->get('frontPageAccounts')) > 0) {+ if (is_array($request->get('frontPageAccounts')) && count($request->get('frontPageAccounts')) > 0) {foreach ($request->get('frontPageAccounts') as $id) {$frontPageAccounts[] = (int)$id;}diff --git a/app/Http/Controllers/Rule/IndexController.php b/app/Http/Controllers/Rule/IndexController.phpindex 13a6d21978..53831990c1 100644--- a/app/Http/Controllers/Rule/IndexController.php+++ b/app/Http/Controllers/Rule/IndexController.php@@ -102,7 +102,7 @@ class IndexController extends Controllerpublic function reorderRuleActions(Request $request, Rule $rule): JsonResponse{$ids = $request->get('actions');- if (\is_array($ids)) {+ if (is_array($ids)) {$this->ruleRepos->reorderRuleActions($rule, $ids);}@@ -120,7 +120,7 @@ class IndexController extends Controllerpublic function reorderRuleTriggers(Request $request, Rule $rule): JsonResponse{$ids = $request->get('triggers');- if (\is_array($ids)) {+ if (is_array($ids)) {$this->ruleRepos->reorderRuleTriggers($rule, $ids);}diff --git a/app/Http/Controllers/Transaction/BulkController.php b/app/Http/Controllers/Transaction/BulkController.phpindex c4c28cdc83..a19012351d 100644--- a/app/Http/Controllers/Transaction/BulkController.php+++ b/app/Http/Controllers/Transaction/BulkController.php@@ -97,7 +97,7 @@ class BulkController extends Controllerpublic function update(BulkEditJournalRequest $request){$journalIds = $request->get('journals');- $journalIds = \is_array($journalIds) ? $journalIds : [];+ $journalIds = is_array($journalIds) ? $journalIds : [];$ignoreCategory = 1 === (int)$request->get('ignore_category');$ignoreBudget = 1 === (int)$request->get('ignore_budget');$ignoreTags = 1 === (int)$request->get('ignore_tags');diff --git a/app/Http/Controllers/Transaction/MassController.php b/app/Http/Controllers/Transaction/MassController.phpindex 5c5fda5422..371794873f 100644--- a/app/Http/Controllers/Transaction/MassController.php+++ b/app/Http/Controllers/Transaction/MassController.php@@ -100,7 +100,7 @@ class MassController extends Controller{$ids = $request->get('confirm_mass_delete');$count = 0;- if (\is_array($ids)) {+ if (is_array($ids)) {/** @var string $journalId */foreach ($ids as $journalId) {/** @var TransactionJournal $journal */@@ -190,7 +190,7 @@ class MassController extends Controllerthrow new FireflyException('Needs refactor');$journalIds = $request->get('journals');$count = 0;- if (\is_array($journalIds)) {+ if (is_array($journalIds)) {foreach ($journalIds as $journalId) {$journal = $repository->findNull((int)$journalId);if (null !== $journal) {diff --git a/app/Http/Requests/ReconciliationStoreRequest.php b/app/Http/Requests/ReconciliationStoreRequest.phpindex 3e1fc096f9..67765f6728 100644--- a/app/Http/Requests/ReconciliationStoreRequest.php+++ b/app/Http/Requests/ReconciliationStoreRequest.php@@ -49,8 +49,8 @@ class ReconciliationStoreRequest extends Request*/public function getAll(): array{- $transactions = $this->get('transactions');- if (!\is_array($transactions)) {+ $transactions = $this->get('journals');+ if (!is_array($transactions)) {$transactions = []; // @codeCoverageIgnore}$data = [@@ -59,7 +59,7 @@ class ReconciliationStoreRequest extends Request'start_balance' => $this->string('startBalance'),'end_balance' => $this->string('endBalance'),'difference' => $this->string('difference'),- 'transactions' => $transactions,+ 'journals' => $transactions,'reconcile' => $this->string('reconcile'),];Log::debug('In ReconciliationStoreRequest::getAll(). Will now return data.');@@ -80,7 +80,7 @@ class ReconciliationStoreRequest extends Request'startBalance' => 'numeric','endBalance' => 'numeric','difference' => 'required|numeric',- 'transactions' => [new ValidTransactions],+ 'journals' => [new ValidJournals],'reconcile' => 'required|in:create,nothing',];}diff --git a/app/Http/Requests/ReportFormRequest.php b/app/Http/Requests/ReportFormRequest.phpindex a63dee1f99..1402033232 100644--- a/app/Http/Requests/ReportFormRequest.php+++ b/app/Http/Requests/ReportFormRequest.php@@ -60,7 +60,7 @@ class ReportFormRequest extends Request$repository = app(AccountRepositoryInterface::class);$set = $this->get('accounts');$collection = new Collection;- if (\is_array($set)) {+ if (is_array($set)) {foreach ($set as $accountId) {$account = $repository->findNull((int)$accountId);if (null !== $account) {@@ -83,7 +83,7 @@ class ReportFormRequest extends Request$repository = app(BudgetRepositoryInterface::class);$set = $this->get('budget');$collection = new Collection;- if (\is_array($set)) {+ if (is_array($set)) {foreach ($set as $budgetId) {$budget = $repository->findNull((int)$budgetId);if (null !== $budget) {@@ -106,7 +106,7 @@ class ReportFormRequest extends Request$repository = app(CategoryRepositoryInterface::class);$set = $this->get('category');$collection = new Collection;- if (\is_array($set)) {+ if (is_array($set)) {foreach ($set as $categoryId) {$category = $repository->findNull((int)$categoryId);if (null !== $category) {@@ -157,7 +157,7 @@ class ReportFormRequest extends Request$repository = app(AccountRepositoryInterface::class);$set = $this->get('exp_rev');$collection = new Collection;- if (\is_array($set)) {+ if (is_array($set)) {foreach ($set as $accountId) {$account = $repository->findNull((int)$accountId);if (null !== $account) {@@ -208,7 +208,7 @@ class ReportFormRequest extends Request$set = $this->get('tag');$collection = new Collection;Log::debug('Set is:', $set ?? []);- if (\is_array($set)) {+ if (is_array($set)) {foreach ($set as $tagTag) {Log::debug(sprintf('Now searching for "%s"', $tagTag));$tag = $repository->findByTag($tagTag);diff --git a/app/Http/Requests/RuleFormRequest.php b/app/Http/Requests/RuleFormRequest.phpindex 38e4ad8ac2..da90a90ba9 100644--- a/app/Http/Requests/RuleFormRequest.php+++ b/app/Http/Requests/RuleFormRequest.php@@ -112,7 +112,7 @@ class RuleFormRequest extends Request{$return = [];$actionData = $this->get('actions');- if (\is_array($actionData)) {+ if (is_array($actionData)) {foreach ($actionData as $action) {$stopProcessing = $action['stop_processing'] ?? '0';$return[] = [@@ -133,7 +133,7 @@ class RuleFormRequest extends Request{$return = [];$triggerData = $this->get('triggers');- if (\is_array($triggerData)) {+ if (is_array($triggerData)) {foreach ($triggerData as $trigger) {$stopProcessing = $trigger['stop_processing'] ?? '0';$return[] = [diff --git a/app/Import/Specifics/AbnAmroDescription.php b/app/Import/Specifics/AbnAmroDescription.phpindex 2c4296a119..058402d7d5 100644--- a/app/Import/Specifics/AbnAmroDescription.php+++ b/app/Import/Specifics/AbnAmroDescription.php@@ -147,7 +147,7 @@ class AbnAmroDescription implements SpecificInterface// SEPA plain descriptions contain several key-value pairs, split by a colonpreg_match_all('/([A-Za-z]+(?=:\s)):\s([A-Za-z 0-9._#-]+(?=\s|$))/', $this->row[7], $matches, PREG_SET_ORDER);- if (\is_array($matches)) {+ if (is_array($matches)) {foreach ($matches as $match) {$key = $match[1];$value = trim($match[2]);@@ -203,7 +203,7 @@ class AbnAmroDescription implements SpecificInterface// Search for properties specified in the TRTP format. If no description// is provided, use the type, name and reference as new description- if (\is_array($matches)) {+ if (is_array($matches)) {foreach ($matches as $match) {$key = $match[1];$value = trim($match[2]);diff --git a/app/Repositories/ImportJob/ImportJobRepository.php b/app/Repositories/ImportJob/ImportJobRepository.phpindex e2e9430caa..f393e9b7be 100644--- a/app/Repositories/ImportJob/ImportJobRepository.php+++ b/app/Repositories/ImportJob/ImportJobRepository.php@@ -224,7 +224,7 @@ class ImportJobRepository implements ImportJobRepositoryInterfacepublic function getExtendedStatus(ImportJob $job): array{$status = $job->extended_status;- if (\is_array($status)) {+ if (is_array($status)) {return $status;}diff --git a/app/Repositories/Journal/JournalRepository.php b/app/Repositories/Journal/JournalRepository.phpindex c16a27a98c..103b7d86c3 100644--- a/app/Repositories/Journal/JournalRepository.php+++ b/app/Repositories/Journal/JournalRepository.php@@ -563,7 +563,7 @@ class JournalRepository implements JournalRepositoryInterface$value = $entry->data;- if (\is_array($value)) {+ if (is_array($value)) {$return = implode(',', $value);$cache->store($return);diff --git a/app/Services/Internal/Support/JournalServiceTrait.php b/app/Services/Internal/Support/JournalServiceTrait.phpindex c866196aa2..8c50c460ab 100644--- a/app/Services/Internal/Support/JournalServiceTrait.php+++ b/app/Services/Internal/Support/JournalServiceTrait.php@@ -291,7 +291,7 @@ trait JournalServiceTrait// $factory = app(TagFactory::class);// $factory->setUser($journal->user);// $set = [];- // if (!\is_array($data['tags'])) {+ // if (!is_array($data['tags'])) {// return; // @codeCoverageIgnore// }// foreach ($data['tags'] as $string) {diff --git a/app/Services/Spectre/Object/Account.php b/app/Services/Spectre/Object/Account.phpindex e8069f99f1..5270360736 100644--- a/app/Services/Spectre/Object/Account.php+++ b/app/Services/Spectre/Object/Account.php@@ -67,7 +67,7 @@ class Account extends SpectreObject$this->nature = $data['nature'];$this->createdAt = new Carbon($data['created_at']);$this->updatedAt = new Carbon($data['updated_at']);- $extraArray = \is_array($data['extra']) ? $data['extra'] : [];+ $extraArray = is_array($data['extra']) ? $data['extra'] : [];foreach ($extraArray as $key => $value) {$this->extra[$key] = $value;}diff --git a/app/Support/Http/Controllers/GetConfigurationData.php b/app/Support/Http/Controllers/GetConfigurationData.phpindex 78872404de..291f828a5a 100644--- a/app/Support/Http/Controllers/GetConfigurationData.php+++ b/app/Support/Http/Controllers/GetConfigurationData.php@@ -68,7 +68,7 @@ trait GetConfigurationData$routeKey = str_replace('.', '_', $route);$elements = config(sprintf('intro.%s', $routeKey));$steps = [];- if (\is_array($elements) && count($elements) > 0) {+ if (is_array($elements) && count($elements) > 0) {foreach ($elements as $key => $options) {$currentStep = $options;@@ -188,7 +188,7 @@ trait GetConfigurationDataif ('' !== $specificPage) {$routeKey = str_replace('.', '_', $route);$elements = config(sprintf('intro.%s', $routeKey . '_' . $specificPage));- if (\is_array($elements) && count($elements) > 0) {+ if (is_array($elements) && count($elements) > 0) {foreach ($elements as $key => $options) {$currentStep = $options;diff --git a/app/Support/Http/Controllers/RequestInformation.php b/app/Support/Http/Controllers/RequestInformation.phpindex db94115e7a..062d79f1fc 100644--- a/app/Support/Http/Controllers/RequestInformation.php+++ b/app/Support/Http/Controllers/RequestInformation.php@@ -144,7 +144,7 @@ trait RequestInformation{$triggers = [];$data = $request->get('triggers');- if (\is_array($data)) {+ if (is_array($data)) {foreach ($data as $index => $triggerInfo) {$triggers[] = ['type' => $triggerInfo['type'] ?? '',diff --git a/app/Support/Http/Controllers/RuleManagement.php b/app/Support/Http/Controllers/RuleManagement.phpindex 60851e30b3..5d500fcb73 100644--- a/app/Support/Http/Controllers/RuleManagement.php+++ b/app/Support/Http/Controllers/RuleManagement.php@@ -96,7 +96,7 @@ trait RuleManagement$index = 0;$triggers = [];$oldInput = $request->old('actions');- if (\is_array($oldInput)) {+ if (is_array($oldInput)) {foreach ($oldInput as $oldAction) {try {$triggers[] = view(@@ -129,7 +129,7 @@ trait RuleManagement$index = 0;$triggers = [];$oldInput = $request->old('triggers');- if (\is_array($oldInput)) {+ if (is_array($oldInput)) {foreach ($oldInput as $oldTrigger) {try {$triggers[] = view(diff --git a/app/Support/Import/JobConfiguration/File/ConfigureMappingHandler.php b/app/Support/Import/JobConfiguration/File/ConfigureMappingHandler.phpindex 5f22e4f010..de924873c8 100644--- a/app/Support/Import/JobConfiguration/File/ConfigureMappingHandler.php+++ b/app/Support/Import/JobConfiguration/File/ConfigureMappingHandler.php@@ -92,7 +92,7 @@ class ConfigureMappingHandler implements FileConfigurationInterface{$config = $this->importJob->configuration;- if (isset($data['mapping']) && \is_array($data['mapping'])) {+ if (isset($data['mapping']) && is_array($data['mapping'])) {foreach ($data['mapping'] as $index => $array) {$config['column-mapping-config'][$index] = [];foreach ($array as $value => $mapId) {diff --git a/app/Support/Import/JobConfiguration/File/ConfigureUploadHandler.php b/app/Support/Import/JobConfiguration/File/ConfigureUploadHandler.phpindex 0c205ca4a2..473e6b9bfc 100644--- a/app/Support/Import/JobConfiguration/File/ConfigureUploadHandler.php+++ b/app/Support/Import/JobConfiguration/File/ConfigureUploadHandler.php@@ -131,7 +131,7 @@ class ConfigureUploadHandler implements FileConfigurationInterface{$return = [];// check if specifics given are correct:- if (isset($data['specifics']) && \is_array($data['specifics'])) {+ if (isset($data['specifics']) && is_array($data['specifics'])) {foreach ($data['specifics'] as $name) {// verify their content.diff --git a/app/Support/Preferences.php b/app/Support/Preferences.phpindex 98806823b6..c61aebf183 100644--- a/app/Support/Preferences.php+++ b/app/Support/Preferences.php@@ -190,7 +190,7 @@ class Preferencesif (null !== $preference && null !== $preference->data) {$lastActivity = $preference->data;}- if (\is_array($lastActivity)) {+ if (is_array($lastActivity)) {$lastActivity = implode(',', $lastActivity);}