Skip to content

Commit

Permalink
Merge pull request #39 from nutgram/analysis-prdW1Z
Browse files Browse the repository at this point in the history
Apply fixes from StyleCI
  • Loading branch information
sergix44 authored Jan 7, 2024
2 parents 9aa4a0d + 54cc6d0 commit c709192
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
9 changes: 5 additions & 4 deletions src/Annotation/UnionResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@
abstract class UnionResolver
{
/**
* @param string $propertyName
* @param ReflectionNamedType[] $propertyTypes
* @param array $data
* @param string $propertyName
* @param ReflectionNamedType[] $propertyTypes
* @param array $data
*
* @return ReflectionType
* @throws ReflectionException
*
* @return ReflectionType
*/
abstract public function resolve(string $propertyName, array $propertyTypes, array $data): ReflectionType;
}
2 changes: 2 additions & 0 deletions src/Hydrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
use SergiX44\Hydrator\Annotation\SkipConstructor;
use SergiX44\Hydrator\Annotation\UnionResolver;
use SergiX44\Hydrator\Exception\InvalidObjectException;

use function array_key_exists;
use function class_exists;
use function ctype_digit;
Expand All @@ -37,6 +38,7 @@
use function is_subclass_of;
use function sprintf;
use function strtotime;

use const FILTER_NULL_ON_FAILURE;
use const FILTER_VALIDATE_BOOLEAN;
use const FILTER_VALIDATE_FLOAT;
Expand Down
4 changes: 2 additions & 2 deletions src/Resolver/EnumOrScalar.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ public function resolve(string $propertyName, array $propertyTypes, array $data)
$valueType = gettype($value);
$valueType = match ($valueType) {
'integer' => 'int',
'double' => 'float',
'double' => 'float',
'boolean' => 'bool',
default => $valueType,
default => $valueType,
};

foreach ($propertyTypes as $t) {
Expand Down

0 comments on commit c709192

Please sign in to comment.