for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace BrainExe\Core\Application;
use BrainExe\Annotations\Annotations\Inject;
use BrainExe\Annotations\Annotations\Service;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Controller\ControllerResolverInterface;
/**
* @Service(public=false)
*/
class ControllerResolver implements ControllerResolverInterface
{
* @var ContainerInterface
private $container;
* @Inject("@service_container")
* @param ContainerInterface $container
public function __construct(ContainerInterface $container)
$this->container = $container;
}
* {@inheritdoc}
public function getController(Request $request)
list($serviceId, $method) = $request->attributes->get('_controller');
$service = $this->container->get($serviceId);
return [$service, $method];
public function getArguments(Request $request, $controller)
$arguments = [
$request
];
foreach ($request->attributes->all() as $attribute => $value) {
if ($attribute[0] !== '_') {
$arguments[] = $value;
return $arguments;