Skip to content

Commit

Permalink
reset previous changes
Browse files Browse the repository at this point in the history
remove Typehints and add DocBlock
fix wrong DocBlock and remove Typehints
reset $type self logic

Signed-off-by: gennadigennadigennadi <gennadijanzen@icloud.com>
  • Loading branch information
gennadigennadigennadi committed Oct 7, 2020
1 parent de2bd07 commit 9c03854
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/Container/AutowireFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function canCreate(ContainerInterface $container, string $requestedName)
/**
* Create an instance
*
* @return bool
* @return object
*/
public function create(ContainerInterface $container, string $requestedName, ?array $options = null)
{
Expand All @@ -66,9 +66,9 @@ public function create(ContainerInterface $container, string $requestedName, ?ar
/**
* Make invokable and implement the laminas-service factory pattern
*
* @return bool
* @return object
*/
public function __invoke(ContainerInterface $container, string $requestedName, ?array $options = null)
public function __invoke(ContainerInterface $container, $requestedName, ?array $options = null)
{
return $this->create($container, (string) $requestedName, $options);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Resolver/DependencyResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ public function resolveParameters(string $requestedType, array $callTimeParamete

foreach ($params as $paramInfo) {
$name = $paramInfo->getName();
$type = $paramInfo->getType() === 'self' ? $requestedType : $paramInfo->getType();
$type = $paramInfo->getType();

if (isset($callTimeParameters[$name])) {
$result[$name] = new ValueInjection($callTimeParameters[$name]);
Expand Down
6 changes: 5 additions & 1 deletion test/TestAsset/Constructor/OptionalArguments.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@

class OptionalArguments
{
public function __construct(?string $foo = null, string $bar = 'something')
/**
* @param null|string $foo
* @param string $bar
*/
public function __construct($foo = null, $bar = 'something')
{
}
}

0 comments on commit 9c03854

Please sign in to comment.