Skip to content

Commit

Permalink
Fix code style
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrii Savluk committed May 13, 2024
1 parent 5d9517e commit 685d533
Show file tree
Hide file tree
Showing 15 changed files with 8 additions and 20 deletions.
1 change: 0 additions & 1 deletion src/Exceptions/DTOException.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@

class DTOException extends LogicException
{

}
1 change: 0 additions & 1 deletion src/Exceptions/TypeGenerateException.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@

class TypeGenerateException extends RuntimeException
{

}
1 change: 0 additions & 1 deletion src/Performance/ClockworkEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@

class ClockworkEvent
{

}
2 changes: 1 addition & 1 deletion src/Support/Mapping/Casts/BooleanCast.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class BooleanCast extends OptionalCast
{
public function __construct(
protected readonly string|Closure|null $accessor = null,
protected readonly bool|null $default = null
protected readonly ?bool $default = null
) {
}

Expand Down
4 changes: 2 additions & 2 deletions src/Support/Mapping/Casts/UnionCast.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ protected function finalize(mixed $source, array $sourcesTrace): mixed
try {
return $this->defaultVariant->resolve($value, $sourcesTrace);
} catch (UnexpectedValue $e) {
throw UnexpectedValue::wrap($e, "[Condition #DEFAULT]", true);
throw UnexpectedValue::wrap($e, '[Condition #DEFAULT]', true);
} catch (Throwable $e) {
throw InternalException::wrap($e, "[Condition #DEFAULT]", true);
throw InternalException::wrap($e, '[Condition #DEFAULT]', true);
}
}

Expand Down
3 changes: 0 additions & 3 deletions src/Support/Mapping/Mapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ public static function declareGenerics(): array
return [];
}

/**
* @return string|Cast|null
*/
public static function as(): string|Cast|null
{
return null;
Expand Down
6 changes: 3 additions & 3 deletions src/Support/Mapping/Schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class Schema
{
use Macroable;

public static function string(string|Closure|null $accessor = null, string $default = null): StringCast
public static function string(string|Closure|null $accessor = null, ?string $default = null): StringCast
{
return new StringCast($accessor, $default);
}
Expand All @@ -62,7 +62,7 @@ public static function constString(string $value, bool $asAnyString = false): Co
return new ConstStringCast($value, $asAnyString);
}

public static function boolean(string|Closure|null $accessor = null, bool $default = null): BooleanCast
public static function boolean(string|Closure|null $accessor = null, ?bool $default = null): BooleanCast
{
return new BooleanCast($accessor, $default);
}
Expand Down Expand Up @@ -123,7 +123,7 @@ public static function intersection(Cast|Mapper ...$objects): IntersectionCast
public static function enum(
string $enum,
string|Closure|null $accessor = null,
BackedEnum $defaultValue = null
?BackedEnum $defaultValue = null
): EnumCast {
return new EnumCast($enum, $accessor, $defaultValue);
}
Expand Down
3 changes: 2 additions & 1 deletion src/Support/TypeGeneration/AliasMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ private function __construct()

public static function schema(): Cast
{
return new class (static::$alias) extends OptionalCast {
return new class(self::$alias) extends OptionalCast
{
public function __construct(public readonly string $alias)
{
}
Expand Down
1 change: 0 additions & 1 deletion src/Support/TypeGeneration/Types/AnyType.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@

class AnyType extends Type
{

}
1 change: 0 additions & 1 deletion src/Support/TypeGeneration/Types/BooleanType.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@

class BooleanType extends Type
{

}
1 change: 0 additions & 1 deletion src/Support/TypeGeneration/Types/NumberType.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@

class NumberType extends Type
{

}
1 change: 0 additions & 1 deletion src/Support/TypeGeneration/Types/StringType.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@

class StringType extends Type
{

}
1 change: 0 additions & 1 deletion src/Support/TypeGeneration/Types/Type.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@

abstract class Type
{

}
1 change: 0 additions & 1 deletion src/Support/TypeGeneration/Types/UndefinedType.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@

class UndefinedType extends Type
{

}
1 change: 0 additions & 1 deletion src/Support/TypeGeneration/Types/VoidType.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@

class VoidType extends Type
{

}

0 comments on commit 685d533

Please sign in to comment.