diff --git a/phpcs.xml.dist b/phpcs.xml.dist index 2affdde..e5cf81b 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -14,5 +14,7 @@ test - + + + diff --git a/src/Contracts/HydratorManagerContract.php b/src/Contracts/HydratorManagerContract.php index 21c358f..2321eee 100644 --- a/src/Contracts/HydratorManagerContract.php +++ b/src/Contracts/HydratorManagerContract.php @@ -12,10 +12,10 @@ interface HydratorManagerContract /** @param mixed $value */ public function canExtract($value): bool; + public function extract(mixed $class, ?string $overrideHydrator = null): Collection|Resource; + /** - * @param mixed $class - * - * @return Resource|Collection + * @param mixed[]|null $state */ - public function extract($class); + public function resource(?array $state = null): Resource; } diff --git a/src/HydratorManager.php b/src/HydratorManager.php index 474f9aa..7521abc 100644 --- a/src/HydratorManager.php +++ b/src/HydratorManager.php @@ -53,12 +53,7 @@ public function canExtract($value): bool return isset($this->classHydrators[get_class($value)]); } - /** - * @param mixed $class - * - * @return Resource|Collection - */ - public function extract($class, ?string $overrideHydrator = null) + public function extract(mixed $class, ?string $overrideHydrator = null): Collection|Resource { if (! $class) { return (new Resource())->setHydratorManager($this);