mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-06 04:34:00 +00:00
Remove unnecessary backslash
This commit is contained in:
@@ -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);
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -241,7 +241,7 @@ class Request extends FormRequest
|
||||
return 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);
|
||||
|
@@ -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);
|
||||
}
|
||||
|
@@ -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 PrerequisitesInterface
|
||||
if (null === $apiKey->data) {
|
||||
return false;
|
||||
}
|
||||
if (32 === \strlen((string)$apiKey->data)) {
|
||||
if (32 === strlen((string)$apiKey->data)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@@ -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);
|
||||
|
@@ -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();
|
||||
|
||||
|
@@ -56,7 +56,7 @@ class IsDateOrTime implements Rule
|
||||
public 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);
|
||||
|
@@ -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';
|
||||
}
|
||||
|
||||
|
@@ -72,9 +72,9 @@ final class DescriptionEnds extends AbstractTrigger implements TriggerInterface
|
||||
public 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.
|
||||
|
@@ -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));
|
||||
|
@@ -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.
|
||||
|
@@ -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));
|
||||
|
@@ -78,9 +78,9 @@ final class NotesEnd extends AbstractTrigger implements TriggerInterface
|
||||
if (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 false
|
||||
|
@@ -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));
|
||||
|
@@ -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 false
|
||||
|
@@ -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));
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user