Skip to content

Commit

Permalink
QA fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
akadlec committed Feb 20, 2024
1 parent 5ea312a commit 288a2ec
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/Hydrators/Fields/BackedEnumField.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

namespace FastyBird\JsonApi\Hydrators\Fields;

use BackedEnum;
use IPub\JsonAPIDocument;
use function call_user_func;
use function is_callable;
Expand Down Expand Up @@ -45,7 +46,7 @@ public function __construct(
/**
* @param JsonAPIDocument\Objects\IStandardObject<string, mixed> $attributes
*/
public function getValue(JsonAPIDocument\Objects\IStandardObject $attributes): \BackedEnum|null
public function getValue(JsonAPIDocument\Objects\IStandardObject $attributes): BackedEnum|null
{
$value = $attributes->get($this->getMappedName());

Expand All @@ -54,7 +55,7 @@ public function getValue(JsonAPIDocument\Objects\IStandardObject $attributes): \
if (is_callable($callable)) {
$result = $value !== null ? call_user_func($callable, $value) : null;

return $result instanceof \BackedEnum ? $result : null;
return $result instanceof BackedEnum ? $result : null;
}

return null;
Expand Down
3 changes: 2 additions & 1 deletion src/Hydrators/Hydrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
namespace FastyBird\JsonApi\Hydrators;

use ArrayAccess;
use BackedEnum;
use DateTimeInterface;
use Doctrine\Common;
use Doctrine\ORM;
Expand Down Expand Up @@ -539,7 +540,7 @@ protected function mapEntity(string $entityClassName): array
$isWritable,
);

} elseif ($typeRc->isSubclassOf(\BackedEnum::class)) {
} elseif ($typeRc->isSubclassOf(BackedEnum::class)) {
$fields[] = new Hydrators\Fields\BackedEnumField(
$className,
$isNullable,
Expand Down

0 comments on commit 288a2ec

Please sign in to comment.