Various code cleanup.

This commit is contained in:
James Cole
2021-04-07 07:28:43 +02:00
parent 4ddcb0c965
commit f12744ad8c
180 changed files with 714 additions and 721 deletions

View File

@@ -74,7 +74,7 @@ class BelongsUser implements Rule
{
$attribute = $this->parseAttribute($attribute);
if (!auth()->check()) {
return true; // @codeCoverageIgnore
return true;
}
$attribute = (string)$attribute;
Log::debug(sprintf('Going to validate %s', $attribute));
@@ -97,7 +97,7 @@ class BelongsUser implements Rule
case 'destination_id':
return $this->validateAccountId((int)$value);
default:
throw new FireflyException(sprintf('Rule BelongUser cannot handle "%s"', $attribute)); // @codeCoverageIgnore
throw new FireflyException(sprintf('Rule BelongUser cannot handle "%s"', $attribute));
}
}
@@ -116,7 +116,7 @@ class BelongsUser implements Rule
return $parts[2];
}
return $attribute; // @codeCoverageIgnore
return $attribute;
}
/**

View File

@@ -87,10 +87,10 @@ class UniqueAccountNumber implements Rule
public function passes($attribute, $value): bool
{
if (!auth()->check()) {
return true; // @codeCoverageIgnore
return true;
}
if (null === $this->expectedType) {
return true; // @codeCoverageIgnore
return true;
}
$maxCounts = $this->getMaxOccurrences();

View File

@@ -84,10 +84,10 @@ class UniqueIban implements Rule
public function passes($attribute, $value): bool
{
if (!auth()->check()) {
return true; // @codeCoverageIgnore
return true;
}
if (null === $this->expectedType) {
return true; // @codeCoverageIgnore
return true;
}
$maxCounts = $this->getMaxOccurrences();