Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Remove unnecessary backslash
James Colefba3cb6d9069
diff --git a/app/Helpers/Attachments/AttachmentHelper.php b/app/Helpers/Attachments/AttachmentHelper.phpindex 06e8cf0f79..bf3a66378f 100644--- a/app/Helpers/Attachments/AttachmentHelper.php+++ b/app/Helpers/Attachments/AttachmentHelper.php@@ -172,7 +172,7 @@ class AttachmentHelper implements AttachmentHelperInterface// update attachment.$attachment->md5 = md5_file($path);$attachment->mime = $mime;- $attachment->size = \strlen($content);+ $attachment->size = strlen($content);$attachment->uploaded = true;$attachment->save();@@ -274,8 +274,8 @@ class AttachmentHelper implements AttachmentHelperInterface$content = $fileObject->fread($file->getSize());$encrypted = Crypt::encrypt($content);- Log::debug(sprintf('Full file length is %d and upload size is %d.', \strlen($content), $file->getSize()));- Log::debug(sprintf('Encrypted content is %d', \strlen($encrypted)));+ Log::debug(sprintf('Full file length is %d and upload size is %d.', strlen($content), $file->getSize()));+ Log::debug(sprintf('Encrypted content is %d', strlen($encrypted)));// store it:$this->uploadDisk->put($attachment->fileName(), $encrypted);diff --git a/app/Http/Controllers/AttachmentController.php b/app/Http/Controllers/AttachmentController.phpindex 7b58dbaf23..dc3ca4ce74 100644--- a/app/Http/Controllers/AttachmentController.php+++ b/app/Http/Controllers/AttachmentController.php@@ -121,7 +121,7 @@ class AttachmentController extends Controller->header('Expires', '0')->header('Cache-Control', 'must-revalidate, post-check=0, pre-check=0')->header('Pragma', 'public')- ->header('Content-Length', \strlen($content));+ ->header('Content-Length', strlen($content));return $response;}diff --git a/app/Http/Controllers/ExportController.php b/app/Http/Controllers/ExportController.phpindex 687be4e2b3..6d744049f3 100644--- a/app/Http/Controllers/ExportController.php+++ b/app/Http/Controllers/ExportController.php@@ -90,7 +90,7 @@ class ExportController extends Controller->header('Expires', '0')->header('Cache-Control', 'must-revalidate, post-check=0, pre-check=0')->header('Pragma', 'public')- ->header('Content-Length', \strlen($content));+ ->header('Content-Length', strlen($content));return $response;}diff --git a/app/Http/Controllers/Import/IndexController.php b/app/Http/Controllers/Import/IndexController.phpindex 372c4c0a3f..f851e8c04d 100644--- a/app/Http/Controllers/Import/IndexController.php+++ b/app/Http/Controllers/Import/IndexController.php@@ -173,7 +173,7 @@ class IndexController extends Controller->header('Expires', '0')->header('Cache-Control', 'must-revalidate, post-check=0, pre-check=0')->header('Pragma', 'public')- ->header('Content-Length', \strlen($result));+ ->header('Content-Length', strlen($result));return $response;}diff --git a/app/Http/Requests/Request.php b/app/Http/Requests/Request.phpindex 829699115f..d531c6f7a1 100644--- a/app/Http/Requests/Request.php+++ b/app/Http/Requests/Request.php@@ -241,7 +241,7 @@ class Request extends FormRequestreturn null;}$value = (string)$this->get($field);- if (10 === \strlen($value)) {+ if (10 === strlen($value)) {// probably a date format.try {$result = Carbon::createFromFormat('Y-m-d', $value);diff --git a/app/Import/Converter/Amount.php b/app/Import/Converter/Amount.phpindex a2ee082264..637867f32d 100644--- a/app/Import/Converter/Amount.php+++ b/app/Import/Converter/Amount.php@@ -110,7 +110,7 @@ class Amount implements ConverterInterface*/private function alternativeDecimalSign(string $value): bool{- $length = \strlen($value);+ $length = strlen($value);$altPosition = $length - 2;return $length > 1 && ('.' === $value[$altPosition] || ',' === $value[$altPosition]);@@ -125,7 +125,7 @@ class Amount implements ConverterInterface*/private function decimalIsComma(string $value): bool{- $length = \strlen($value);+ $length = strlen($value);$decimalPosition = $length - 3;return $length > 2 && ',' === $value[$decimalPosition];@@ -140,7 +140,7 @@ class Amount implements ConverterInterface*/private function decimalIsDot(string $value): bool{- $length = \strlen($value);+ $length = strlen($value);$decimalPosition = $length - 3;return ($length > 2 && '.' === $value[$decimalPosition]) || ($length > 2 && strpos($value, '.') > $decimalPosition);@@ -177,7 +177,7 @@ class Amount implements ConverterInterface*/private function getAlternativeDecimalSign(string $value): string{- $length = \strlen($value);+ $length = strlen($value);$altPosition = $length - 2;return $value[$altPosition];@@ -222,7 +222,7 @@ class Amount implements ConverterInterface// have to strip the € because apparantly the Postbank (DE) thinks "1.000,00 €" is a normal way to format a number.$value = trim((string)str_replace(['€'], '', $value));$str = preg_replace('/[^\-\(\)\.\,0-9 ]/', '', $value);- $len = \strlen($str);+ $len = strlen($str);if ('(' === $str[0] && ')' === $str[$len - 1]) {$str = '-' . substr($str, 1, $len - 2);}diff --git a/app/Import/Prerequisites/FakePrerequisites.php b/app/Import/Prerequisites/FakePrerequisites.phpindex 39dbec4762..0a9576d620 100644--- a/app/Import/Prerequisites/FakePrerequisites.php+++ b/app/Import/Prerequisites/FakePrerequisites.php@@ -97,7 +97,7 @@ class FakePrerequisites implements PrerequisitesInterface{$apiKey = $data['api_key'] ?? '';$messageBag = new MessageBag();- if (32 !== \strlen($apiKey)) {+ if (32 !== strlen($apiKey)) {$messageBag->add('api_key', 'API key must be 32 chars.');return $messageBag;@@ -122,7 +122,7 @@ class FakePrerequisites implements PrerequisitesInterfaceif (null === $apiKey->data) {return false;}- if (32 === \strlen((string)$apiKey->data)) {+ if (32 === strlen((string)$apiKey->data)) {return true;}diff --git a/app/Repositories/ImportJob/ImportJobRepository.php b/app/Repositories/ImportJob/ImportJobRepository.phpindex 19bff4e24c..5f11c87010 100644--- a/app/Repositories/ImportJob/ImportJobRepository.php+++ b/app/Repositories/ImportJob/ImportJobRepository.php@@ -386,7 +386,7 @@ class ImportJobRepository implements ImportJobRepositoryInterface$attachment->md5 = md5($content);$attachment->filename = $name;$attachment->mime = 'plain/txt';- $attachment->size = \strlen($content);+ $attachment->size = strlen($content);$attachment->uploaded = false;$attachment->save();$encrypted = Crypt::encrypt($content);diff --git a/app/Repositories/Rule/RuleRepository.php b/app/Repositories/Rule/RuleRepository.phpindex 46ac34376c..718d95eb17 100644--- a/app/Repositories/Rule/RuleRepository.php+++ b/app/Repositories/Rule/RuleRepository.php@@ -325,7 +325,7 @@ class RuleRepository implements RuleRepositoryInterface$rule->strict = $data['strict'];$rule->stop_processing = $data['stop_processing'];$rule->title = $data['title'];- $rule->description = \strlen($data['description']) > 0 ? $data['description'] : null;+ $rule->description = strlen($data['description']) > 0 ? $data['description'] : null;$rule->save();diff --git a/app/Rules/IsDateOrTime.php b/app/Rules/IsDateOrTime.phpindex a8c76eb604..be3d3b7f45 100644--- a/app/Rules/IsDateOrTime.php+++ b/app/Rules/IsDateOrTime.php@@ -56,7 +56,7 @@ class IsDateOrTime implements Rulepublic function passes($attribute, $value): bool{$value = (string)$value;- if (10 === \strlen($value)) {+ if (10 === strlen($value)) {// probably a date format.try {Carbon::createFromFormat('Y-m-d', $value);diff --git a/app/Support/Amount.php b/app/Support/Amount.phpindex bf887c3eb1..ded6728df5 100644--- a/app/Support/Amount.php+++ b/app/Support/Amount.php@@ -289,7 +289,7 @@ class Amount$currencyCode = $this->tryDecrypt((string)$currencyPreference->data);// could still be json encoded:- if (\strlen($currencyCode) > 3) {+ if (strlen($currencyCode) > 3) {$currencyCode = json_decode($currencyCode) ?? 'EUR';}diff --git a/app/TransactionRules/Triggers/DescriptionEnds.php b/app/TransactionRules/Triggers/DescriptionEnds.phpindex 71bb7e5f2f..d9215798ce 100644--- a/app/TransactionRules/Triggers/DescriptionEnds.php+++ b/app/TransactionRules/Triggers/DescriptionEnds.php@@ -72,9 +72,9 @@ final class DescriptionEnds extends AbstractTrigger implements TriggerInterfacepublic function triggered(TransactionJournal $journal): bool{$description = strtolower($journal->description ?? '');- $descriptionLength = \strlen($description);+ $descriptionLength = strlen($description);$search = strtolower($this->triggerValue);- $searchLength = \strlen($search);+ $searchLength = strlen($search);// if the string to search for is longer than the description,// return false.diff --git a/app/TransactionRules/Triggers/DescriptionStarts.php b/app/TransactionRules/Triggers/DescriptionStarts.phpindex 250f0ae3e3..77c665c711 100644--- a/app/TransactionRules/Triggers/DescriptionStarts.php+++ b/app/TransactionRules/Triggers/DescriptionStarts.php@@ -74,7 +74,7 @@ final class DescriptionStarts extends AbstractTrigger implements TriggerInterfac$description = strtolower($journal->description ?? '');$search = strtolower($this->triggerValue);- $part = substr($description, 0, \strlen($search));+ $part = substr($description, 0, strlen($search));if ($part === $search) {Log::debug(sprintf('RuleTrigger DescriptionStarts for journal #%d: "%s" starts with "%s", return true.', $journal->id, $description, $search));diff --git a/app/TransactionRules/Triggers/FromAccountEnds.php b/app/TransactionRules/Triggers/FromAccountEnds.phpindex 8aa5a253d6..2dc567e935 100644--- a/app/TransactionRules/Triggers/FromAccountEnds.php+++ b/app/TransactionRules/Triggers/FromAccountEnds.php@@ -82,9 +82,9 @@ final class FromAccountEnds extends AbstractTrigger implements TriggerInterface$name .= strtolower($account->name);}- $nameLength = \strlen($name);+ $nameLength = strlen($name);$search = strtolower($this->triggerValue);- $searchLength = \strlen($search);+ $searchLength = strlen($search);// if the string to search for is longer than the account name,// it will never be in the account name.diff --git a/app/TransactionRules/Triggers/FromAccountStarts.php b/app/TransactionRules/Triggers/FromAccountStarts.phpindex 25b916b439..7cdc74e752 100644--- a/app/TransactionRules/Triggers/FromAccountStarts.php+++ b/app/TransactionRules/Triggers/FromAccountStarts.php@@ -83,7 +83,7 @@ final class FromAccountStarts extends AbstractTrigger implements TriggerInterfac}$search = strtolower($this->triggerValue);- $part = substr($name, 0, \strlen($search));+ $part = substr($name, 0, strlen($search));if ($part === $search) {Log::debug(sprintf('RuleTrigger FromAccountStarts for journal #%d: "%s" starts with "%s", return true.', $journal->id, $name, $search));diff --git a/app/TransactionRules/Triggers/NotesEnd.php b/app/TransactionRules/Triggers/NotesEnd.phpindex 3eb265ab5c..ebead68e0f 100644--- a/app/TransactionRules/Triggers/NotesEnd.php+++ b/app/TransactionRules/Triggers/NotesEnd.php@@ -78,9 +78,9 @@ final class NotesEnd extends AbstractTrigger implements TriggerInterfaceif (null !== $note) {$text = strtolower($note->text);}- $notesLength = \strlen($text);+ $notesLength = strlen($text);$search = strtolower($this->triggerValue);- $searchLength = \strlen($search);+ $searchLength = strlen($search);// if the string to search for is longer than the description,// return falsediff --git a/app/TransactionRules/Triggers/NotesStart.php b/app/TransactionRules/Triggers/NotesStart.phpindex 4bef3f85e2..2ba1d5df11 100644--- a/app/TransactionRules/Triggers/NotesStart.php+++ b/app/TransactionRules/Triggers/NotesStart.php@@ -80,7 +80,7 @@ final class NotesStart extends AbstractTrigger implements TriggerInterface}$search = strtolower($this->triggerValue);- $part = substr($text, 0, \strlen($search));+ $part = substr($text, 0, strlen($search));if ($part === $search) {Log::debug(sprintf('RuleTrigger NotesStart for journal #%d: "%s" starts with "%s", return true.', $journal->id, $text, $search));diff --git a/app/TransactionRules/Triggers/ToAccountEnds.php b/app/TransactionRules/Triggers/ToAccountEnds.phpindex a9474e32c0..3026ea6afa 100644--- a/app/TransactionRules/Triggers/ToAccountEnds.php+++ b/app/TransactionRules/Triggers/ToAccountEnds.php@@ -82,9 +82,9 @@ final class ToAccountEnds extends AbstractTrigger implements TriggerInterface$toAccountName .= strtolower($account->name);}- $toAccountNameLength = \strlen($toAccountName);+ $toAccountNameLength = strlen($toAccountName);$search = strtolower($this->triggerValue);- $searchLength = \strlen($search);+ $searchLength = strlen($search);// if the string to search for is longer than the account name,// return falsediff --git a/app/TransactionRules/Triggers/ToAccountStarts.php b/app/TransactionRules/Triggers/ToAccountStarts.phpindex 8c813b499f..861e36d983 100644--- a/app/TransactionRules/Triggers/ToAccountStarts.php+++ b/app/TransactionRules/Triggers/ToAccountStarts.php@@ -83,7 +83,7 @@ final class ToAccountStarts extends AbstractTrigger implements TriggerInterface}$search = strtolower($this->triggerValue);- $part = substr($toAccountName, 0, \strlen($search));+ $part = substr($toAccountName, 0, strlen($search));if ($part === $search) {Log::debug(sprintf('RuleTrigger ToAccountStarts for journal #%d: "%s" starts with "%s", return true.', $journal->id, $toAccountName, $search));diff --git a/app/Validation/FireflyValidator.php b/app/Validation/FireflyValidator.phpindex bb36f45cb6..27824c5928 100644--- a/app/Validation/FireflyValidator.php+++ b/app/Validation/FireflyValidator.php@@ -55,7 +55,7 @@ class FireflyValidator extends Validator*/public function validate2faCode($attribute, $value): bool{- if (!\is_string($value) || null === $value || 6 !== \strlen($value)) {+ if (!\is_string($value) || null === $value || 6 !== strlen($value)) {return false;}@@ -117,7 +117,7 @@ class FireflyValidator extends Validator*/public function validateIban($attribute, $value): bool{- if (!\is_string($value) || null === $value || \strlen($value) < 6) {+ if (!\is_string($value) || null === $value || strlen($value) < 6) {return false;}// strip spaces