Skip to content

Commit

Permalink
Fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenvanassche authored and github-actions[bot] committed Aug 4, 2023
1 parent 41b9d45 commit 5b12205
Show file tree
Hide file tree
Showing 15 changed files with 19 additions and 32 deletions.
3 changes: 1 addition & 2 deletions src/Attributes/Validation/Dimensions.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ public function __construct(
null|int|RouteParameterReference $width = null,
null|int|RouteParameterReference $height = null,
null|BaseDimensions $rule = null,
)
{
) {
$minWidth = $this->normalizePossibleRouteReferenceParameter($minWidth);
$minHeight = $this->normalizePossibleRouteReferenceParameter($minHeight);
$maxWidth = $this->normalizePossibleRouteReferenceParameter($maxWidth);
Expand Down
6 changes: 3 additions & 3 deletions src/Attributes/Validation/Email.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ public static function keyword(): string
public function parameters(): array
{
return collect($this->modes)
->whenEmpty(fn(Collection $modes) => $modes->add(self::RfcValidation))
->filter(fn(string $mode) => in_array($mode, [
->whenEmpty(fn (Collection $modes) => $modes->add(self::RfcValidation))
->filter(fn (string $mode) => in_array($mode, [
self::RfcValidation,
self::NoRfcWarningsValidation,
self::DnsCheckValidation,
self::SpoofCheckValidation,
self::FilterEmailValidation,
]))
->whenEmpty(fn() => throw CannotBuildValidationRule::create("Email validation rule needs at least one valid mode."))
->whenEmpty(fn () => throw CannotBuildValidationRule::create("Email validation rule needs at least one valid mode."))
->all();
}
}
3 changes: 1 addition & 2 deletions src/Attributes/Validation/ExcludeIf.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ class ExcludeIf extends StringValidationAttribute
public function __construct(
string|FieldReference $field,
protected string|int|float|bool|BackedEnum|RouteParameterReference $value
)
{
) {
$this->field = $this->parseFieldReference($field);
}

Expand Down
3 changes: 1 addition & 2 deletions src/Attributes/Validation/ExcludeUnless.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ class ExcludeUnless extends StringValidationAttribute
public function __construct(
string|FieldReference $field,
protected string|int|float|bool|BackedEnum|RouteParameterReference $value
)
{
) {
$this->field = $this->parseFieldReference($field);
}

Expand Down
3 changes: 1 addition & 2 deletions src/Attributes/Validation/ExcludeWithout.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ class ExcludeWithout extends StringValidationAttribute

public function __construct(
string|FieldReference $field,
)
{
) {
$this->field = $this->parseFieldReference($field);
}

Expand Down
3 changes: 1 addition & 2 deletions src/Attributes/Validation/InArray.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ class InArray extends StringValidationAttribute

public function __construct(
string|FieldReference $field,
)
{
) {
$this->field = $this->parseFieldReference($field);
}

Expand Down
3 changes: 1 addition & 2 deletions src/Attributes/Validation/LessThan.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ class LessThan extends StringValidationAttribute

public function __construct(
string|FieldReference $field,
)
{
) {
$this->field = $this->parseFieldReference($field);
}

Expand Down
3 changes: 1 addition & 2 deletions src/Attributes/Validation/LessThanOrEqualTo.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ class LessThanOrEqualTo extends StringValidationAttribute

public function __construct(
string|FieldReference $field,
)
{
) {
$this->field = $this->parseFieldReference($field);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Attributes/Validation/NotIn.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function __construct(array|string|BaseNotIn|RouteParameterReference ...$v
}

$values = array_map(
fn(string|RouteParameterReference $value) => $this->normalizePossibleRouteReferenceParameter($value),
fn (string|RouteParameterReference $value) => $this->normalizePossibleRouteReferenceParameter($value),
Arr::flatten($values)
);

Expand Down
3 changes: 1 addition & 2 deletions src/Attributes/Validation/Password.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ public function __construct(
int|RouteParameterReference $uncompromisedThreshold = 0,
bool|RouteParameterReference $default = false,
?BasePassword $rule = null,
)
{
) {
$min = $this->normalizePossibleRouteReferenceParameter($min);
$letters = $this->normalizePossibleRouteReferenceParameter($letters);
$mixedCase = $this->normalizePossibleRouteReferenceParameter($mixedCase);
Expand Down
3 changes: 1 addition & 2 deletions src/Attributes/Validation/ProhibitedUnless.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ class ProhibitedUnless extends StringValidationAttribute
public function __construct(
string|FieldReference $field,
array|string|BackedEnum|RouteParameterReference ...$values
)
{
) {
$this->field = $this->parseFieldReference($field);
$this->values = Arr::flatten($values);
}
Expand Down
3 changes: 1 addition & 2 deletions src/Attributes/Validation/RequiredIf.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ class RequiredIf extends StringValidationAttribute implements RequiringRule
public function __construct(
string|FieldReference $field,
array|string|BackedEnum|RouteParameterReference ...$values
)
{
) {
$this->field = $this->parseFieldReference($field);
$this->values = Arr::flatten($values);
}
Expand Down
3 changes: 1 addition & 2 deletions src/Attributes/Validation/RequiredUnless.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ class RequiredUnless extends StringValidationAttribute implements RequiringRule
public function __construct(
string|FieldReference $field,
array|string|BackedEnum|RouteParameterReference ...$values
)
{
) {
$this->field = $this->parseFieldReference($field);
$this->values = Arr::flatten($values);
}
Expand Down
3 changes: 1 addition & 2 deletions src/Attributes/Validation/Unique.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ public function __construct(
string|RouteParameterReference $deletedAtColumn = 'deleted_at',
?Closure $where = null,
?BaseUnique $rule = null
)
{
) {
$table = $this->normalizePossibleRouteReferenceParameter($table);
$column = $this->normalizePossibleRouteReferenceParameter($column);
$connection = $this->normalizePossibleRouteReferenceParameter($connection);
Expand Down
7 changes: 3 additions & 4 deletions src/Attributes/Validation/ValidationAttribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function __toString(): string

protected static function parseDateValue(mixed $value): mixed
{
if (!is_string($value)) {
if (! is_string($value)) {
return $value;
}

Expand All @@ -41,7 +41,7 @@ protected static function parseDateValue(mixed $value): mixed

protected static function parseBooleanValue(mixed $value): mixed
{
if (!is_string($value)) {
if (! is_string($value)) {
return $value;
}

Expand All @@ -58,8 +58,7 @@ protected static function parseBooleanValue(mixed $value): mixed

protected function parseFieldReference(
string|FieldReference $reference
): FieldReference
{
): FieldReference {
return $reference instanceof FieldReference
? $reference
: new FieldReference($reference);
Expand Down

0 comments on commit 5b12205

Please sign in to comment.