Skip to content

Commit

Permalink
Merge f38db3f into 3237097
Browse files Browse the repository at this point in the history
  • Loading branch information
kakenbok committed Nov 7, 2019
2 parents 3237097 + f38db3f commit 08dbeb5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Container.php
Expand Up @@ -403,8 +403,8 @@ private function getInvoker() : InvokerInterface
new DefinitionParameterResolver($this->definitionResolver),
new NumericArrayResolver,
new AssociativeArrayResolver,
new DefaultValueResolver,
new TypeHintContainerResolver($this->delegateContainer),
new DefaultValueResolver,
]);

$this->invoker = new Invoker($parameterResolver, $this);
Expand Down
16 changes: 16 additions & 0 deletions tests/IntegrationTest/ContainerCallTest.php
Expand Up @@ -132,6 +132,22 @@ public function test_parameter_from_type_hint(ContainerBuilder $builder)
$this->assertEquals($value, $result);
}

/**
* @dataProvider provideContainer
*/
public function test_parameter_from_type_hint_with_default(ContainerBuilder $builder)
{
$container = $builder->build();

$value = new \stdClass();
$container->set('stdClass', $value);

$result = $container->call(function (\stdClass $foo = null) {
return $foo;
});
$this->assertEquals($value, $result);
}

/**
* @test
* @dataProvider provideContainer
Expand Down

0 comments on commit 08dbeb5

Please sign in to comment.