4 * This file is part of the Behat.
5 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
7 * For the full copyright and license information, please view the LICENSE
8 * file that was distributed with this source code.
11 namespace Behat\Behat\HelperContainer\Argument;
13 use Behat\Behat\Context\Argument\ArgumentResolver;
14 use Behat\Behat\HelperContainer\ArgumentAutowirer;
15 use Psr\Container\ContainerInterface;
19 * Resolves arguments that weren't resolved before by autowiring.
23 * @author Konstantin Kudryashov <ever.zet@gmail.com>
25 final class AutowiringResolver implements ArgumentResolver
28 * @var ArgumentAutowirer
33 * Initialises resolver.
35 * @param ContainerInterface $container
37 public function __construct(ContainerInterface $container)
39 $this->autowirer = new ArgumentAutowirer($container);
45 public function resolveArguments(ReflectionClass $classReflection, array $arguments)
47 if ($constructor = $classReflection->getConstructor()) {
48 return $this->autowirer->autowireArguments($constructor, $arguments);