* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Console\ArgumentResolver\ValueResolver; use Symfony\Component\Console\Attribute\Reflection\ReflectionMember; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Stopwatch\Stopwatch; /** * @author Robin Chalas */ final class TraceableValueResolver implements ValueResolverInterface { public function __construct( private ValueResolverInterface $inner, private Stopwatch $stopwatch, ) { } public function resolve(string $argumentName, InputInterface $input, ReflectionMember $member): iterable { $method = $this->inner::class.'::'.__FUNCTION__; $this->stopwatch->start($method, 'command.argument_value_resolver'); try { yield from $this->inner->resolve($argumentName, $input, $member); } finally { $this->stopwatch->stop($method); } } }