Exceptions
Exceptions 2
InvalidArgumentException
if ($e instanceof \ArgumentCountError) {
throw new \InvalidArgumentException(sprintf('Controller "%s" has required constructor arguments and does not exist in the container. Did you forget to define the controller as a service?', $class), 0, $e);
}
throw new \InvalidArgumentException(sprintf('Controller "%s" does neither exist as service nor as class.', $class), 0, $e);
}
private function throwExceptionIfControllerWasRemoved(string $controller, \Throwable $previous)
{
if ($this->container instanceof Container && isset($this->container->getRemovedIds()[$controller])) {
in
vendor/symfony/framework-bundle/Controller/ControllerResolver.php
->
instantiateController
(line 29)
/**
* {@inheritdoc}
*/
protected function instantiateController(string $class): object
{
$controller = parent::instantiateController($class);
if ($controller instanceof ContainerAwareInterface) {
$controller->setContainer($this->container);
}
if ($controller instanceof AbstractController) {
in
vendor/symfony/http-kernel/Controller/ControllerResolver.php
->
instantiateController
(line 49)
}
if (\is_array($controller)) {
if (isset($controller[0]) && \is_string($controller[0]) && isset($controller[1])) {
try {
$controller[0] = $this->instantiateController($controller[0]);
} catch (\Error|\LogicException $e) {
try {
// We cannot just check is_callable but have to use reflection because a non-static method
// can still be called statically in PHP but we don't want that. This is deprecated in PHP 7, so we
// could simplify this with PHP 8.
in
vendor/symfony/http-kernel/Controller/TraceableControllerResolver.php
->
getController
(line 38)
*/
public function getController(Request $request)
{
$e = $this->stopwatch->start('controller.get_callable');
$ret = $this->resolver->getController($request);
$e->stop();
return $ret;
}
in
vendor/easycorp/easyadmin-bundle/src/Factory/ControllerFactory.php
->
getController
(line 60)
if (null === $controllerFqcn || null === $controllerAction) {
return null;
}
$newRequest = $request->duplicate(null, null, ['_controller' => [$controllerFqcn, $controllerAction]]);
$controllerCallable = $this->controllerResolver->getController($newRequest);
if (false === $controllerCallable) {
throw new NotFoundHttpException(sprintf('Unable to find the controller "%s::%s".', $controllerFqcn, $controllerAction));
}
in
vendor/easycorp/easyadmin-bundle/src/Factory/ControllerFactory.php
->
getController
(line 50)
return $this->getController(DashboardControllerInterface::class, $dashboardControllerFqcn, 'index', $request);
}
private function getCrudController(?string $crudControllerFqcn, ?string $crudAction, Request $request): ?CrudControllerInterface
{
return $this->getController(CrudControllerInterface::class, $crudControllerFqcn, $crudAction, $request);
}
private function getController(string $controllerInterface, ?string $controllerFqcn, ?string $controllerAction, Request $request)
{
if (null === $controllerFqcn || null === $controllerAction) {
in
vendor/easycorp/easyadmin-bundle/src/Factory/ControllerFactory.php
->
getCrudController
(line 40)
{
if (null === $crudControllerFqcn) {
return null;
}
return $this->getCrudController($crudControllerFqcn, $crudAction, $request);
}
private function getDashboardController(?string $dashboardControllerFqcn, Request $request): ?DashboardControllerInterface
{
return $this->getController(DashboardControllerInterface::class, $dashboardControllerFqcn, 'index', $request);
in
vendor/easycorp/easyadmin-bundle/src/EventListener/AdminRouterSubscriber.php
->
getCrudControllerInstance
(line 230)
$crudControllerFqcn = $request->query->get(EA::CRUD_CONTROLLER_FQCN);
}
$crudAction = $request->query->get(EA::CRUD_ACTION);
return $this->controllerFactory->getCrudControllerInstance($crudControllerFqcn, $crudAction, $request);
}
private function getSymfonyControllerFqcn(Request $request): ?string
{
$routeName = $request->query->get(EA::ROUTE_NAME);
in
vendor/easycorp/easyadmin-bundle/src/EventListener/AdminRouterSubscriber.php
->
getCrudControllerInstance
(line 124)
}
// creating the context is expensive, so it's created once and stored in the request
// if the current request already has an AdminContext object, do nothing
if (null === $adminContext = $request->attributes->get(EA::CONTEXT_REQUEST_ATTRIBUTE)) {
$crudControllerInstance = $this->getCrudControllerInstance($request);
$adminContext = $this->adminContextFactory->create($request, $dashboardControllerInstance, $crudControllerInstance);
}
$request->attributes->set(EA::CONTEXT_REQUEST_ATTRIBUTE, $adminContext);
in
vendor/symfony/event-dispatcher/Debug/WrappedListener.php
->
onKernelRequest
(line 117)
$this->called = true;
$this->priority = $dispatcher->getListenerPriority($eventName, $this->listener);
$e = $this->stopwatch->start($this->name, 'event_listener');
($this->optimizedListener ?? $this->listener)($event, $eventName, $dispatcher);
if ($e->isStarted()) {
$e->stop();
}
in
vendor/symfony/event-dispatcher/EventDispatcher.php
->
__invoke
(line 230)
foreach ($listeners as $listener) {
if ($stoppable && $event->isPropagationStopped()) {
break;
}
$listener($event, $eventName, $this);
}
}
/**
* Sorts the internal list of listeners for the given event by priority.
in
vendor/symfony/event-dispatcher/EventDispatcher.php
->
callListeners
(line 59)
} else {
$listeners = $this->getListeners($eventName);
}
if ($listeners) {
$this->callListeners($listeners, $eventName, $event);
}
return $event;
}
in
vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php
->
dispatch
(line 154)
try {
$this->beforeDispatch($eventName, $event);
try {
$e = $this->stopwatch->start($eventName, 'section');
try {
$this->dispatcher->dispatch($event, $eventName);
} finally {
if ($e->isStarted()) {
$e->stop();
}
}
in
vendor/symfony/http-kernel/HttpKernel.php
->
dispatch
(line 128)
{
$this->requestStack->push($request);
// request
$event = new RequestEvent($this, $request, $type);
$this->dispatcher->dispatch($event, KernelEvents::REQUEST);
if ($event->hasResponse()) {
return $this->filterResponse($event->getResponse(), $request, $type);
}
in
vendor/symfony/http-kernel/HttpKernel.php
->
handleRaw
(line 74)
public function handle(Request $request, int $type = HttpKernelInterface::MAIN_REQUEST, bool $catch = true)
{
$request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
try {
return $this->handleRaw($request, $type);
} catch (\Exception $e) {
if ($e instanceof RequestExceptionInterface) {
$e = new BadRequestHttpException($e->getMessage(), $e);
}
if (false === $catch) {
in
vendor/symfony/http-kernel/Kernel.php
->
handle
(line 202)
$this->boot();
++$this->requestStackSize;
$this->resetServices = true;
try {
return $this->getHttpKernel()->handle($request, $type, $catch);
} finally {
--$this->requestStackSize;
}
}
in
vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php
->
handle
(line 35)
$this->request = $request;
}
public function run(): int
{
$response = $this->kernel->handle($this->request);
$response->send();
if ($this->kernel instanceof TerminableInterface) {
$this->kernel->terminate($this->request, $response);
}
in
vendor/autoload_runtime.php
->
run
(line 35)
$app = $app(...$args);
exit(
$runtime
->getRunner($app)
->run()
);
require_once('/home/whitetower/solgar/production/vendor/autoload_runtime.php')
in
public/index.php
(line 5)
<?php
use App\Kernel;
require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
return function (array $context) {
return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
};
Error
*
* @return object
*/
protected function instantiateController(string $class)
{
return new $class();
}
private function getControllerError($callable): string
{
if (\is_string($callable)) {
in
vendor/symfony/http-kernel/Controller/ContainerControllerResolver.php
->
instantiateController
(line 57)
if ($this->container->has($class)) {
return $this->container->get($class);
}
try {
return parent::instantiateController($class);
} catch (\Error $e) {
}
$this->throwExceptionIfControllerWasRemoved($class, $e);
in
vendor/symfony/framework-bundle/Controller/ControllerResolver.php
->
instantiateController
(line 29)
/**
* {@inheritdoc}
*/
protected function instantiateController(string $class): object
{
$controller = parent::instantiateController($class);
if ($controller instanceof ContainerAwareInterface) {
$controller->setContainer($this->container);
}
if ($controller instanceof AbstractController) {
in
vendor/symfony/http-kernel/Controller/ControllerResolver.php
->
instantiateController
(line 49)
}
if (\is_array($controller)) {
if (isset($controller[0]) && \is_string($controller[0]) && isset($controller[1])) {
try {
$controller[0] = $this->instantiateController($controller[0]);
} catch (\Error|\LogicException $e) {
try {
// We cannot just check is_callable but have to use reflection because a non-static method
// can still be called statically in PHP but we don't want that. This is deprecated in PHP 7, so we
// could simplify this with PHP 8.
in
vendor/symfony/http-kernel/Controller/TraceableControllerResolver.php
->
getController
(line 38)
*/
public function getController(Request $request)
{
$e = $this->stopwatch->start('controller.get_callable');
$ret = $this->resolver->getController($request);
$e->stop();
return $ret;
}
in
vendor/easycorp/easyadmin-bundle/src/Factory/ControllerFactory.php
->
getController
(line 60)
if (null === $controllerFqcn || null === $controllerAction) {
return null;
}
$newRequest = $request->duplicate(null, null, ['_controller' => [$controllerFqcn, $controllerAction]]);
$controllerCallable = $this->controllerResolver->getController($newRequest);
if (false === $controllerCallable) {
throw new NotFoundHttpException(sprintf('Unable to find the controller "%s::%s".', $controllerFqcn, $controllerAction));
}
in
vendor/easycorp/easyadmin-bundle/src/Factory/ControllerFactory.php
->
getController
(line 50)
return $this->getController(DashboardControllerInterface::class, $dashboardControllerFqcn, 'index', $request);
}
private function getCrudController(?string $crudControllerFqcn, ?string $crudAction, Request $request): ?CrudControllerInterface
{
return $this->getController(CrudControllerInterface::class, $crudControllerFqcn, $crudAction, $request);
}
private function getController(string $controllerInterface, ?string $controllerFqcn, ?string $controllerAction, Request $request)
{
if (null === $controllerFqcn || null === $controllerAction) {
in
vendor/easycorp/easyadmin-bundle/src/Factory/ControllerFactory.php
->
getCrudController
(line 40)
{
if (null === $crudControllerFqcn) {
return null;
}
return $this->getCrudController($crudControllerFqcn, $crudAction, $request);
}
private function getDashboardController(?string $dashboardControllerFqcn, Request $request): ?DashboardControllerInterface
{
return $this->getController(DashboardControllerInterface::class, $dashboardControllerFqcn, 'index', $request);
in
vendor/easycorp/easyadmin-bundle/src/EventListener/AdminRouterSubscriber.php
->
getCrudControllerInstance
(line 230)
$crudControllerFqcn = $request->query->get(EA::CRUD_CONTROLLER_FQCN);
}
$crudAction = $request->query->get(EA::CRUD_ACTION);
return $this->controllerFactory->getCrudControllerInstance($crudControllerFqcn, $crudAction, $request);
}
private function getSymfonyControllerFqcn(Request $request): ?string
{
$routeName = $request->query->get(EA::ROUTE_NAME);
in
vendor/easycorp/easyadmin-bundle/src/EventListener/AdminRouterSubscriber.php
->
getCrudControllerInstance
(line 124)
}
// creating the context is expensive, so it's created once and stored in the request
// if the current request already has an AdminContext object, do nothing
if (null === $adminContext = $request->attributes->get(EA::CONTEXT_REQUEST_ATTRIBUTE)) {
$crudControllerInstance = $this->getCrudControllerInstance($request);
$adminContext = $this->adminContextFactory->create($request, $dashboardControllerInstance, $crudControllerInstance);
}
$request->attributes->set(EA::CONTEXT_REQUEST_ATTRIBUTE, $adminContext);
in
vendor/symfony/event-dispatcher/Debug/WrappedListener.php
->
onKernelRequest
(line 117)
$this->called = true;
$this->priority = $dispatcher->getListenerPriority($eventName, $this->listener);
$e = $this->stopwatch->start($this->name, 'event_listener');
($this->optimizedListener ?? $this->listener)($event, $eventName, $dispatcher);
if ($e->isStarted()) {
$e->stop();
}
in
vendor/symfony/event-dispatcher/EventDispatcher.php
->
__invoke
(line 230)
foreach ($listeners as $listener) {
if ($stoppable && $event->isPropagationStopped()) {
break;
}
$listener($event, $eventName, $this);
}
}
/**
* Sorts the internal list of listeners for the given event by priority.
in
vendor/symfony/event-dispatcher/EventDispatcher.php
->
callListeners
(line 59)
} else {
$listeners = $this->getListeners($eventName);
}
if ($listeners) {
$this->callListeners($listeners, $eventName, $event);
}
return $event;
}
in
vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php
->
dispatch
(line 154)
try {
$this->beforeDispatch($eventName, $event);
try {
$e = $this->stopwatch->start($eventName, 'section');
try {
$this->dispatcher->dispatch($event, $eventName);
} finally {
if ($e->isStarted()) {
$e->stop();
}
}
in
vendor/symfony/http-kernel/HttpKernel.php
->
dispatch
(line 128)
{
$this->requestStack->push($request);
// request
$event = new RequestEvent($this, $request, $type);
$this->dispatcher->dispatch($event, KernelEvents::REQUEST);
if ($event->hasResponse()) {
return $this->filterResponse($event->getResponse(), $request, $type);
}
in
vendor/symfony/http-kernel/HttpKernel.php
->
handleRaw
(line 74)
public function handle(Request $request, int $type = HttpKernelInterface::MAIN_REQUEST, bool $catch = true)
{
$request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
try {
return $this->handleRaw($request, $type);
} catch (\Exception $e) {
if ($e instanceof RequestExceptionInterface) {
$e = new BadRequestHttpException($e->getMessage(), $e);
}
if (false === $catch) {
in
vendor/symfony/http-kernel/Kernel.php
->
handle
(line 202)
$this->boot();
++$this->requestStackSize;
$this->resetServices = true;
try {
return $this->getHttpKernel()->handle($request, $type, $catch);
} finally {
--$this->requestStackSize;
}
}
in
vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php
->
handle
(line 35)
$this->request = $request;
}
public function run(): int
{
$response = $this->kernel->handle($this->request);
$response->send();
if ($this->kernel instanceof TerminableInterface) {
$this->kernel->terminate($this->request, $response);
}
in
vendor/autoload_runtime.php
->
run
(line 35)
$app = $app(...$args);
exit(
$runtime
->getRunner($app)
->run()
);
require_once('/home/whitetower/solgar/production/vendor/autoload_runtime.php')
in
public/index.php
(line 5)
<?php
use App\Kernel;
require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
return function (array $context) {
return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
};
Stack Traces 2
[2/2]
InvalidArgumentException
|
---|
InvalidArgumentException: Controller "App%5CController%5CAdmin%5CCustomerCrudController" does neither exist as service nor as class. at vendor/symfony/http-kernel/Controller/ContainerControllerResolver.php:67 at Symfony\Component\HttpKernel\Controller\ContainerControllerResolver->instantiateController() (vendor/symfony/framework-bundle/Controller/ControllerResolver.php:29) at Symfony\Bundle\FrameworkBundle\Controller\ControllerResolver->instantiateController() (vendor/symfony/http-kernel/Controller/ControllerResolver.php:49) at Symfony\Component\HttpKernel\Controller\ControllerResolver->getController() (vendor/symfony/http-kernel/Controller/TraceableControllerResolver.php:38) at Symfony\Component\HttpKernel\Controller\TraceableControllerResolver->getController() (vendor/easycorp/easyadmin-bundle/src/Factory/ControllerFactory.php:60) at EasyCorp\Bundle\EasyAdminBundle\Factory\ControllerFactory->getController() (vendor/easycorp/easyadmin-bundle/src/Factory/ControllerFactory.php:50) at EasyCorp\Bundle\EasyAdminBundle\Factory\ControllerFactory->getCrudController() (vendor/easycorp/easyadmin-bundle/src/Factory/ControllerFactory.php:40) at EasyCorp\Bundle\EasyAdminBundle\Factory\ControllerFactory->getCrudControllerInstance() (vendor/easycorp/easyadmin-bundle/src/EventListener/AdminRouterSubscriber.php:230) at EasyCorp\Bundle\EasyAdminBundle\EventListener\AdminRouterSubscriber->getCrudControllerInstance() (vendor/easycorp/easyadmin-bundle/src/EventListener/AdminRouterSubscriber.php:124) at EasyCorp\Bundle\EasyAdminBundle\EventListener\AdminRouterSubscriber->onKernelRequest() (vendor/symfony/event-dispatcher/Debug/WrappedListener.php:117) at Symfony\Component\EventDispatcher\Debug\WrappedListener->__invoke() (vendor/symfony/event-dispatcher/EventDispatcher.php:230) at Symfony\Component\EventDispatcher\EventDispatcher->callListeners() (vendor/symfony/event-dispatcher/EventDispatcher.php:59) at Symfony\Component\EventDispatcher\EventDispatcher->dispatch() (vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php:154) at Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->dispatch() (vendor/symfony/http-kernel/HttpKernel.php:128) at Symfony\Component\HttpKernel\HttpKernel->handleRaw() (vendor/symfony/http-kernel/HttpKernel.php:74) at Symfony\Component\HttpKernel\HttpKernel->handle() (vendor/symfony/http-kernel/Kernel.php:202) at Symfony\Component\HttpKernel\Kernel->handle() (vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php:35) at Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run() (vendor/autoload_runtime.php:35) at require_once('/home/whitetower/solgar/production/vendor/autoload_runtime.php') (public/index.php:5) |
[1/2]
Error
|
---|
Error: Class 'App%5CController%5CAdmin%5CCustomerCrudController' not found at vendor/symfony/http-kernel/Controller/ControllerResolver.php:147 at Symfony\Component\HttpKernel\Controller\ControllerResolver->instantiateController() (vendor/symfony/http-kernel/Controller/ContainerControllerResolver.php:57) at Symfony\Component\HttpKernel\Controller\ContainerControllerResolver->instantiateController() (vendor/symfony/framework-bundle/Controller/ControllerResolver.php:29) at Symfony\Bundle\FrameworkBundle\Controller\ControllerResolver->instantiateController() (vendor/symfony/http-kernel/Controller/ControllerResolver.php:49) at Symfony\Component\HttpKernel\Controller\ControllerResolver->getController() (vendor/symfony/http-kernel/Controller/TraceableControllerResolver.php:38) at Symfony\Component\HttpKernel\Controller\TraceableControllerResolver->getController() (vendor/easycorp/easyadmin-bundle/src/Factory/ControllerFactory.php:60) at EasyCorp\Bundle\EasyAdminBundle\Factory\ControllerFactory->getController() (vendor/easycorp/easyadmin-bundle/src/Factory/ControllerFactory.php:50) at EasyCorp\Bundle\EasyAdminBundle\Factory\ControllerFactory->getCrudController() (vendor/easycorp/easyadmin-bundle/src/Factory/ControllerFactory.php:40) at EasyCorp\Bundle\EasyAdminBundle\Factory\ControllerFactory->getCrudControllerInstance() (vendor/easycorp/easyadmin-bundle/src/EventListener/AdminRouterSubscriber.php:230) at EasyCorp\Bundle\EasyAdminBundle\EventListener\AdminRouterSubscriber->getCrudControllerInstance() (vendor/easycorp/easyadmin-bundle/src/EventListener/AdminRouterSubscriber.php:124) at EasyCorp\Bundle\EasyAdminBundle\EventListener\AdminRouterSubscriber->onKernelRequest() (vendor/symfony/event-dispatcher/Debug/WrappedListener.php:117) at Symfony\Component\EventDispatcher\Debug\WrappedListener->__invoke() (vendor/symfony/event-dispatcher/EventDispatcher.php:230) at Symfony\Component\EventDispatcher\EventDispatcher->callListeners() (vendor/symfony/event-dispatcher/EventDispatcher.php:59) at Symfony\Component\EventDispatcher\EventDispatcher->dispatch() (vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php:154) at Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->dispatch() (vendor/symfony/http-kernel/HttpKernel.php:128) at Symfony\Component\HttpKernel\HttpKernel->handleRaw() (vendor/symfony/http-kernel/HttpKernel.php:74) at Symfony\Component\HttpKernel\HttpKernel->handle() (vendor/symfony/http-kernel/Kernel.php:202) at Symfony\Component\HttpKernel\Kernel->handle() (vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php:35) at Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run() (vendor/autoload_runtime.php:35) at require_once('/home/whitetower/solgar/production/vendor/autoload_runtime.php') (public/index.php:5) |