Code reordering and reformatting. I should really start employing style CI.

This commit is contained in:
James Cole
2021-09-18 10:26:12 +02:00
parent 9b9d52e99f
commit 4003cea759
344 changed files with 2776 additions and 2605 deletions

View File

@@ -69,7 +69,7 @@ class IsDateOrTime implements Rule
Log::error(sprintf('"%s" is not a valid date: %s', $value, $e->getMessage()));
return false;
} catch(InvalidFormatException $e) {
} catch (InvalidFormatException $e) {
Log::error(sprintf('"%s" is of an invalid format: %s', $value, $e->getMessage()));
return false;
@@ -84,7 +84,7 @@ class IsDateOrTime implements Rule
Log::error(sprintf('"%s" is not a valid date or time: %s', $value, $e->getMessage()));
return false;
} catch(InvalidFormatException $e) {
} catch (InvalidFormatException $e) {
Log::error(sprintf('"%s" is of an invalid format: %s', $value, $e->getMessage()));
return false;

View File

@@ -22,6 +22,7 @@
declare(strict_types=1);
namespace FireflyIII\Rules;
use Illuminate\Contracts\Validation\Rule;
/**

View File

@@ -23,6 +23,7 @@
declare(strict_types=1);
namespace FireflyIII\Rules;
use FireflyIII\Models\TransactionType;
use FireflyIII\Validation\AccountValidator;
use Illuminate\Contracts\Validation\Rule;

View File

@@ -22,6 +22,7 @@
declare(strict_types=1);
namespace FireflyIII\Rules;
use FireflyIII\Models\Account;
use FireflyIII\Models\Bill;
use FireflyIII\Models\Budget;

View File

@@ -33,8 +33,8 @@ use JsonException;
*/
class IsValidBulkClause implements Rule
{
private array $rules;
private string $error;
private array $rules;
/**
* @param string $type
@@ -45,6 +45,14 @@ class IsValidBulkClause implements Rule
$this->error = (string)trans('firefly.belongs_user');
}
/**
* @return string
*/
public function message(): string
{
return $this->error;
}
/**
* @param string $attribute
* @param mixed $value
@@ -57,15 +65,8 @@ class IsValidBulkClause implements Rule
if (false === $result) {
return false;
}
return true;
}
/**
* @return string
*/
public function message(): string
{
return $this->error;
return true;
}
/**
@@ -106,7 +107,7 @@ class IsValidBulkClause implements Rule
'value' => $this->rules[$clause][$arrayKey],
]);
if ($validator->fails()) {
$this->error = sprintf('%s: %s: %s',$clause, $arrayKey, join(', ', ($validator->errors()->get('value'))));
$this->error = sprintf('%s: %s: %s', $clause, $arrayKey, join(', ', ($validator->errors()->get('value'))));
return false;
}

View File

@@ -21,6 +21,7 @@
*/
declare(strict_types=1);
namespace FireflyIII\Rules;
use Illuminate\Contracts\Validation\Rule;

View File

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

View File

@@ -21,6 +21,7 @@
*/
declare(strict_types=1);
namespace FireflyIII\Rules;
use FireflyIII\Models\TransactionJournal;

View File

@@ -22,6 +22,7 @@
declare(strict_types=1);
namespace FireflyIII\Rules;
use Carbon\Carbon;
use Illuminate\Contracts\Validation\Rule;
use InvalidArgumentException;