for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
*
* (c) Yaroslav Honcharuk <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Yarhon\RouteGuardBundle\Security\TestResolver;
use Symfony\Component\HttpFoundation\RequestStack;
use Yarhon\RouteGuardBundle\Security\Test\TestInterface;
use Yarhon\RouteGuardBundle\Security\Test\SymfonySecurityTest;
use Yarhon\RouteGuardBundle\Routing\RouteContextInterface;
use Yarhon\RouteGuardBundle\Security\TestProvider\SymfonyAccessControlProvider;
/**
* @author Yaroslav Honcharuk <[email protected]>
class SymfonyAccessControlResolver implements TestResolverInterface
{
* @var RequestStack
private $requestStack;
* @param RequestStack $requestStack
public function __construct(RequestStack $requestStack)
$this->requestStack = $requestStack;
}
* {@inheritdoc}
public function supports(TestInterface $test)
return SymfonyAccessControlProvider::class === $test->getProviderClass();
public function resolve(TestInterface $test, RouteContextInterface $routeContext)
/* @var SymfonySecurityTest $test */
return [$test->getAttributes(), $this->requestStack->getCurrentRequest()];