mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-01-07 06:31:22 +00:00
Code reordering and reformatting. I should really start employing style CI.
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Rules;
|
||||
|
||||
use Illuminate\Contracts\Validation\Rule;
|
||||
|
||||
/**
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Rules;
|
||||
|
||||
use FireflyIII\Models\TransactionType;
|
||||
use FireflyIII\Validation\AccountValidator;
|
||||
use Illuminate\Contracts\Validation\Rule;
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Rules;
|
||||
|
||||
use FireflyIII\Models\Account;
|
||||
use FireflyIII\Models\Bill;
|
||||
use FireflyIII\Models\Budget;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Rules;
|
||||
|
||||
use Illuminate\Contracts\Validation\Rule;
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Rules;
|
||||
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Rules;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Contracts\Validation\Rule;
|
||||
use InvalidArgumentException;
|
||||
|
||||
Reference in New Issue
Block a user