if (null === $object && false === $configuration->isOptional()) {
$message = sprintf('%s object not found by the @%s annotation.', $class, $this->getAnnotationName($configuration));
if ($errorMessage) {
$message .= ' '.$errorMessage;
}
throw new NotFoundHttpException($message);
}
$request->attributes->set($name, $object);
return true;
// automatically apply conversion for non-configured objects
if ($this->autoConvert) {
$configurations = $this->autoConfigure($r, $request, $configurations);
}
$this->manager->apply($request, $configurations);
}
private function autoConfigure(\ReflectionFunctionAbstract $r, Request $request, $configurations)
{
foreach ($r->getParameters() as $param) {
if (false === $controller = $this->resolver->getController($request)) {
throw new NotFoundHttpException(sprintf('Unable to find the controller for path "%s". The route is wrongly configured.', $request->getPathInfo()));
}
$event = new FilterControllerEvent($this, $controller, $request, $type);
$this->dispatcher->dispatch(KernelEvents::CONTROLLER, $event);
$controller = $event->getController();
// controller arguments
$arguments = $this->argumentResolver->getArguments($request, $controller);
public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $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) {
if (!IpUtils::checkIp('127.0.0.1', $trustedProxies)) {
Request::setTrustedProxies(array_merge($trustedProxies, ['127.0.0.1']), Request::getTrustedHeaderSet());
}
try {
return $kernel->handle($request, $type, $catch);
} finally {
// restore global state
Request::setTrustedProxies($trustedProxies, $trustedHeaderSet);
}
}
if ($this->surrogate) {
$this->surrogate->addSurrogateCapability($request);
}
// always a "master" request (as the real master request can be in cache)
$response = SubRequestHandler::handle($this->kernel, $request, HttpKernelInterface::MASTER_REQUEST, $catch);
/*
* Support stale-if-error given on Responses or as a config option.
* RFC 7234 summarizes in Section 4.2.4 (but also mentions with the individual
* Cache-Control directives) that
reload the cache by fetching a fresh response and caching it (if possible).
*/
$this->record($request, 'reload');
$response = $this->fetch($request, $catch);
} else {
$response = $this->lookup($request, $catch);
}
$this->restoreResponseBody($request, $response);
if (HttpKernelInterface::MASTER_REQUEST === $type && $this->options['debug']) {
$kernel = new AppCache($kernel);
// When using the HttpCache, you need to call the method in your front controller instead of relying on the configuration parameter
Request::enableHttpMethodParameterOverride();
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);
No log messages
NotFoundHttpException |
---|
Symfony\Component\HttpKernel\Exception\NotFoundHttpException: AppBundle\Entity\siteSheets object not found by the @ParamConverter annotation. at vendor/sensio/framework-extra-bundle/Request/ParamConverter/DoctrineParamConverter.php:107 at Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\DoctrineParamConverter->apply(object(Request), object(ParamConverter)) (vendor/sensio/framework-extra-bundle/Request/ParamConverter/ParamConverterManager.php:92) at Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\ParamConverterManager->applyConverter(object(Request), object(ParamConverter)) (vendor/sensio/framework-extra-bundle/Request/ParamConverter/ParamConverterManager.php:48) at Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\ParamConverterManager->apply(object(Request), array('sheets' => object(ParamConverter))) (vendor/sensio/framework-extra-bundle/EventListener/ParamConverterListener.php:78) at Sensio\Bundle\FrameworkExtraBundle\EventListener\ParamConverterListener->onKernelController(object(FilterControllerEvent), 'kernel.controller', object(TraceableEventDispatcher)) (vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/Debug/WrappedListener.php:115) at Symfony\Component\EventDispatcher\Debug\WrappedListener->__invoke(object(FilterControllerEvent), 'kernel.controller', object(TraceableEventDispatcher)) (vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/EventDispatcher.php:214) at Symfony\Component\EventDispatcher\EventDispatcher->doDispatch(array(object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener)), 'kernel.controller', object(FilterControllerEvent)) (vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/EventDispatcher.php:44) at Symfony\Component\EventDispatcher\EventDispatcher->dispatch('kernel.controller', object(FilterControllerEvent)) (vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/Debug/TraceableEventDispatcher.php:143) at Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->dispatch('kernel.controller', object(FilterControllerEvent)) (vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:139) at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1) (vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:68) at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true) (vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:200) at Symfony\Component\HttpKernel\Kernel->handle(object(Request), 1, true) (vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpCache/SubRequestHandler.php:102) at Symfony\Component\HttpKernel\HttpCache\SubRequestHandler::handle(object(AppKernel), object(Request), 1, true) (vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php:453) at Symfony\Component\HttpKernel\HttpCache\HttpCache->forward(object(Request), true, null) (vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/HttpCache/HttpCache.php:64) at Symfony\Bundle\FrameworkBundle\HttpCache\HttpCache->forward(object(Request), true) (vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php:426) at Symfony\Component\HttpKernel\HttpCache\HttpCache->fetch(object(Request), true) (vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php:317) at Symfony\Component\HttpKernel\HttpCache\HttpCache->lookup(object(Request), true) (vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php:192) at Symfony\Component\HttpKernel\HttpCache\HttpCache->handle(object(Request)) (public_html/app.php:30) |