Skip to content

Commit

Permalink
qa: add native return-types to ReflectionBasedAbstractFactory methods
Browse files Browse the repository at this point in the history
Signed-off-by: Maximilian Bösing <[email protected]>
  • Loading branch information
boesing committed Apr 5, 2023
1 parent aa86639 commit 04b41a7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/AbstractFactory/ReflectionBasedAbstractFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public function __construct(
/**
* {@inheritDoc}
*/
public function __invoke(ContainerInterface $container, $requestedName, ?array $options = null)
public function __invoke(ContainerInterface $container, $requestedName, ?array $options = null): object
{
if (! class_exists($requestedName)) {
throw new InvalidArgumentException(sprintf('%s can only be used with class names.', self::class));
Expand All @@ -101,7 +101,7 @@ public function __invoke(ContainerInterface $container, $requestedName, ?array $
}

/** {@inheritDoc} */
public function canCreate(ContainerInterface $container, $requestedName)
public function canCreate(ContainerInterface $container, $requestedName): bool
{
return class_exists($requestedName) && $this->canCallConstructor($requestedName);
}
Expand Down

0 comments on commit 04b41a7

Please sign in to comment.