mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2024-12-27 09:21:04 -06:00
Remove unnecessary slash from in_array()
This commit is contained in:
parent
940a730827
commit
956ec23d3c
@ -196,7 +196,7 @@ class AttachmentHelper implements AttachmentHelperInterface
|
||||
return 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.');
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -102,7 +102,7 @@ class IndexController extends Controller
|
||||
public 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 Controller
|
||||
public function reorderRuleTriggers(Request $request, Rule $rule): JsonResponse
|
||||
{
|
||||
$ids = $request->get('triggers');
|
||||
if (\is_array($ids)) {
|
||||
if (is_array($ids)) {
|
||||
$this->ruleRepos->reorderRuleTriggers($rule, $ids);
|
||||
}
|
||||
|
||||
|
@ -97,7 +97,7 @@ class BulkController extends Controller
|
||||
public 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');
|
||||
|
@ -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 Controller
|
||||
throw 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) {
|
||||
|
@ -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',
|
||||
];
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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[] = [
|
||||
|
@ -147,7 +147,7 @@ class AbnAmroDescription implements SpecificInterface
|
||||
// SEPA plain descriptions contain several key-value pairs, split by a colon
|
||||
preg_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]);
|
||||
|
@ -224,7 +224,7 @@ class ImportJobRepository implements ImportJobRepositoryInterface
|
||||
public function getExtendedStatus(ImportJob $job): array
|
||||
{
|
||||
$status = $job->extended_status;
|
||||
if (\is_array($status)) {
|
||||
if (is_array($status)) {
|
||||
return $status;
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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) {
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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 GetConfigurationData
|
||||
if ('' !== $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;
|
||||
|
||||
|
@ -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'] ?? '',
|
||||
|
@ -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(
|
||||
|
@ -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) {
|
||||
|
@ -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.
|
||||
|
@ -190,7 +190,7 @@ class Preferences
|
||||
if (null !== $preference && null !== $preference->data) {
|
||||
$lastActivity = $preference->data;
|
||||
}
|
||||
if (\is_array($lastActivity)) {
|
||||
if (is_array($lastActivity)) {
|
||||
$lastActivity = implode(',', $lastActivity);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user