-
-
Save wouterj/dfa95e44db53a9954f60 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class BcArgumentResolver implements ArgumentResolverInterface | |
{ | |
protected $resolver; | |
protected $resolvedArguments; | |
/** | |
* @param $resolver The ControllerResolver to use | |
*/ | |
public function __construct(\ControllerResolverInterface $resolver) | |
{ | |
$this->resolver = $resolver; | |
} | |
public function accepts(\ReflectionParameter $parameter, Request $request) | |
{ | |
try { | |
$this->resolvedArguments = $this->resolver->getArguments($request, $parameter->getClass(), array($parameter)); | |
} catch (\RuntimeException $e) { | |
return false; | |
} | |
return true; | |
} | |
public function resolve(\ReflectionParameter $parameter, Request $request) | |
{ | |
return $this->resolvedArguments; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment