Exceptions
Exception
TypeError
in
src/Security/Voter/BrandSubresourceVoter.php
(line 96)
private function normalizeBrandCode(string $code): string{return $this->isVolkswagenBrand($code) ? BrandEnum::VOLKSWAGEN->value : $code;}public function voteOnIteratorAggregate(User|Device $user, \IteratorAggregate $paginator): int{$iterator = $paginator->getIterator();foreach ($iterator as $brandAware) {if (!$brandAware instanceof BrandAwareInterface) {
BrandSubresourceVoter->voteOnIteratorAggregate()
in
src/Security/Voter/BrandSubresourceVoter.php
(line 52)
if ($subject instanceof BrandAwareInterface) {return $this->voteOnBrandAware($user, $subject);}if ($subject instanceof \IteratorAggregate) {return $this->voteOnIteratorAggregate($user, $subject);}return VoterInterface::ACCESS_ABSTAIN;}
in
vendor/symfony/security-core/Authorization/Voter/TraceableVoter.php
->
vote
(line 35)
) {}public function vote(TokenInterface $token, mixed $subject, array $attributes, ?Vote $vote = null): int{$result = $this->voter->vote($token, $subject, $attributes, $vote);$this->eventDispatcher->dispatch(new VoteEvent($this->voter, $subject, $attributes, $result, $vote->reasons ?? []), 'debug.security.authorization.vote');return $result;}
in
vendor/symfony/security-core/Authorization/AccessDecisionManager.php
->
vote
(line 89)
*/private function collectResults(TokenInterface $token, array $attributes, mixed $object, AccessDecision $accessDecision): \Traversable{foreach ($this->getVoters($attributes, $object) as $voter) {$vote = new Vote();$result = $voter->vote($token, $object, $attributes, $vote);if (!\is_int($result) || !(self::VALID_VOTES[$result] ?? false)) {throw new \LogicException(\sprintf('"%s::vote()" must return one of "%s" constants ("ACCESS_GRANTED", "ACCESS_DENIED" or "ACCESS_ABSTAIN"), "%s" returned.', get_debug_type($voter), VoterInterface::class, var_export($result, true)));}
in
vendor/symfony/security-core/Authorization/Strategy/UnanimousStrategy.php
->
collectResults
(line 36)
}public function decide(\Traversable $results, ?AccessDecision $accessDecision = null): bool{$grant = 0;foreach ($results as $result) {if (VoterInterface::ACCESS_DENIED === $result) {return false;}if (VoterInterface::ACCESS_GRANTED === $result) {
in
vendor/symfony/security-core/Authorization/AccessDecisionManager.php
->
decide
(line 73)
$this->accessDecisionStack[] = $accessDecision;$accessDecision->strategy = $this->strategy instanceof \Stringable ? $this->strategy : get_debug_type($this->strategy);try {return $accessDecision->isGranted = $this->strategy->decide($this->collectResults($token, $attributes, $object, $accessDecision),$accessDecision,);} finally {array_pop($this->accessDecisionStack);
in
vendor/symfony/security-core/Authorization/TraceableAccessDecisionManager.php
->
decide
(line 57)
$accessDecision ??= end($this->accessDecisionStack) ?: new AccessDecision();$this->accessDecisionStack[] = $accessDecision;try {return $accessDecision->isGranted = $this->manager->decide($token, $attributes, $object, $accessDecision, $allowMultipleAttributes);} finally {$this->strategy = $accessDecision->strategy;$currentLog = array_pop($this->currentLog);if (isset($accessDecision->isGranted)) {$currentLog['result'] = $accessDecision->isGranted;
in
vendor/symfony/security-core/Authorization/AuthorizationChecker.php
->
decide
(line 54)
}$accessDecision ??= end($this->accessDecisionStack) ?: new AccessDecision();$this->accessDecisionStack[] = $accessDecision;try {return $accessDecision->isGranted = $this->accessDecisionManager->decide($token, [$attribute], $subject, $accessDecision);} finally {array_pop($this->accessDecisionStack);}}
in
vendor/api-platform/core/src/Symfony/Security/Core/Authorization/ExpressionLanguageProvider.php
->
isGranted
(line 29)
final class ExpressionLanguageProvider implements ExpressionFunctionProviderInterface{public function getFunctions(): array{return [new ExpressionFunction('is_granted', static fn ($attributes, $object = 'null'): string => \sprintf('$auth_checker->isGranted(%s, %s)', $attributes, $object), static fn (array $variables, $attributes, $object = null) => $variables['auth_checker']->isGranted($attributes, $object)),];}}
in
vendor/symfony/expression-language/Node/FunctionNode.php
::
ApiPlatform\Symfony\Security\Core\Authorization\{closure}
(line 50)
$arguments = [$values];foreach ($this->nodes['arguments']->nodes as $node) {$arguments[] = $node->evaluate($functions, $values);}return $functions[$this->attributes['name']]['evaluator'](...$arguments);}public function toArray(): array{$array = [];
in
vendor/symfony/expression-language/Node/BinaryNode.php
->
evaluate
(line 105)
}public function evaluate(array $functions, array $values): mixed{$operator = $this->attributes['operator'];$left = $this->nodes['left']->evaluate($functions, $values);if (isset(self::FUNCTIONS[$operator])) {$right = $this->nodes['right']->evaluate($functions, $values);return match ($operator) {
in
vendor/symfony/expression-language/ExpressionLanguage.php
->
evaluate
(line 59)
/*** Evaluate an expression.*/public function evaluate(Expression|string $expression, array $values = []): mixed{return $this->parse($expression, array_keys($values))->getNodes()->evaluate($this->functions, $values);}/*** Parses an expression.*
in
vendor/api-platform/core/src/Symfony/Security/ResourceAccessChecker.php
->
evaluate
(line 57)
$token = new NullToken();}$variables = array_merge($variables, $this->getVariables($token));return (bool) $this->expressionLanguage->evaluate($expression, $variables);}/*** @copyright Fabien Potencier <fabien@symfony.com>*
in
vendor/api-platform/core/src/Symfony/Security/State/AccessCheckerProvider.php
->
isGranted
(line 87)
'object' => $body,'previous_object' => $context['graphql_context']['previous_object'] ?? null,];}if (!$this->resourceAccessChecker->isGranted($operation->getClass(), $isGranted, $resourceAccessCheckerContext)) {$operation instanceof GraphQlOperation ? throw new AccessDeniedHttpException($message ?? 'Access Denied.') : throw new AccessDeniedException($message ?? 'Access Denied.');}return $body;}
in
vendor/api-platform/core/src/State/Provider/SecurityParameterProvider.php
->
provide
(line 50)
{}public function provide(Operation $operation, array $uriVariables = [], array $context = []): object|array|null{$body = $this->decorated->provide($operation, $uriVariables, $context);$request = $context['request'] ?? null;$operation = $request?->attributes->get('_api_operation') ?? $operation;$parameters = $operation->getParameters() ?? new Parameters();
in
vendor/api-platform/core/src/State/Provider/DeserializeProvider.php
->
provide
(line 60)
// We need request contentif (!$operation instanceof HttpOperation || !($request = $context['request'] ?? null)) {return $this->decorated?->provide($operation, $uriVariables, $context);}$data = $this->decorated ? $this->decorated->provide($operation, $uriVariables, $context) : $request->attributes->get('data');if (!$operation->canDeserialize() || $context['request']->attributes->has('deserialized')) {return $data;}
in
vendor/api-platform/core/src/Symfony/Security/State/AccessCheckerProvider.php
->
provide
(line 62)
default:$isGranted = $operation->getSecurity();$message = $operation->getSecurityMessage();}$body = $this->decorated->provide($operation, $uriVariables, $context);if (null === $isGranted) {return $body;}// On a GraphQl QueryCollection we want to perform security stage only on the top-level query
in
vendor/api-platform/core/src/Symfony/Validator/State/ValidateProvider.php
->
provide
(line 32)
{}public function provide(Operation $operation, array $uriVariables = [], array $context = []): object|array|null{$body = $this->decorated?->provide($operation, $uriVariables, $context) ?? ($context['request'] ?? null)?->attributes->get('data');if ($body instanceof Response || !$body) {return $body;}
in
vendor/api-platform/core/src/Symfony/Security/State/AccessCheckerProvider.php
->
provide
(line 62)
default:$isGranted = $operation->getSecurity();$message = $operation->getSecurityMessage();}$body = $this->decorated->provide($operation, $uriVariables, $context);if (null === $isGranted) {return $body;}// On a GraphQl QueryCollection we want to perform security stage only on the top-level query
in
vendor/api-platform/core/src/Symfony/Validator/State/ParameterValidatorProvider.php
->
provide
(line 101)
if (0 !== \count($constraintViolationList)) {throw new ValidationException($constraintViolationList);}return $this->decorated->provide($operation, $uriVariables, $context);}// There's a `property` inside Parameter but it's used for hydra:search only as here we want the parameter name insteadprivate function getProperty(Parameter $parameter, ConstraintViolationInterface $violation): string{
in
vendor/api-platform/core/src/State/Provider/ParameterProvider.php
->
provide
(line 102)
$request?->attributes->set('_api_operation', $operation);$context['operation'] = $operation;$this->stopwatch?->stop('api_platform.provider.parameter');return $this->decorated?->provide($operation, $uriVariables, $context);}/*** TODO: uriVariables could be a Parameters instance, it'd make things easier.*
in
vendor/api-platform/core/src/State/Provider/ContentNegotiationProvider.php
->
provide
(line 56)
$this->addRequestFormats($request, $formats);$request->attributes->set('input_format', $this->getInputFormat($operation, $request));$request->setRequestFormat($this->getRequestFormat($request, $formats, !$isErrorOperation));$this->stopwatch?->stop('api_platform.provider.content_negotiation');return $this->decorated?->provide($operation, $uriVariables, $context);}/*** Adds the supported formats to the request.*
in
vendor/api-platform/core/src/Symfony/Controller/MainController.php
->
provide
(line 94)
|| ('PUT' === $method && !($operation->getExtraProperties()['standard_put'] ?? true));$operation = $operation->withDenormalizationContext($denormalizationContext + [SerializerContextBuilderInterface::ASSIGN_OBJECT_TO_POPULATE => $assignObjectToPopulate]);}$body = $this->provider->provide($operation, $uriVariables, $context);// The provider can change the Operation, extract it again from the Request attributesif ($request->attributes->get('_api_operation') !== $operation) {$operation = $this->initializeOperation($request);
in
vendor/symfony/http-kernel/HttpKernel.php
->
__invoke
(line 183)
$this->dispatcher->dispatch($event, KernelEvents::CONTROLLER_ARGUMENTS);$controller = $event->getController();$arguments = $event->getArguments();// call controller$response = $controller(...$arguments);// viewif (!$response instanceof Response) {$event = new ViewEvent($this, $request, $type, $response, $event);$this->dispatcher->dispatch($event, KernelEvents::VIEW);
in
vendor/symfony/http-kernel/HttpKernel.php
->
handleRaw
(line 76)
$request->headers->set('X-Php-Ob-Level', (string) ob_get_level());$this->requestStack->push($request);$response = null;try {return $response = $this->handleRaw($request, $type);} catch (\Throwable $e) {if ($e instanceof \Error && !$this->handleAllThrowables) {throw $e;}
in
vendor/symfony/http-kernel/Kernel.php
->
handle
(line 193)
if (!$this->handlingHttpCache) {$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)
) {}public function run(): int{$response = $this->kernel->handle($this->request);if (Kernel::VERSION_ID >= 60400) {$response->send(false);if (\function_exists('fastcgi_finish_request') && !$this->debug) {
in
vendor/autoload_runtime.php
->
run
(line 32)
$app = $app(...$args);exit($runtime->getRunner($app)->run());
<?phpuse App\Kernel;require_once dirname(__DIR__).'/vendor/autoload_runtime.php';return function (array $context) {return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);};
Logs
| Level | Channel | Message |
|---|---|---|
| INFO 16:39:29 | request |
Matched route "_profiler". {
"route": "_profiler",
"route_parameters": {
"_route": "_profiler",
"_controller": "web_profiler.controller.profiler::panelAction",
"token": "b18acf"
},
"request_uri": "http://api.dev.newretail.avp.tech/_profiler/b18acf?panel=exception&type=request",
"method": "GET"
}
|
| DEBUG 16:39:29 | event |
Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\DebugHandlersListener::configure". {
"event": "kernel.request",
"listener": "Symfony\\Component\\HttpKernel\\EventListener\\DebugHandlersListener::configure"
}
|
| DEBUG 16:39:29 | event |
Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\ValidateRequestListener::onKernelRequest". {
"event": "kernel.request",
"listener": "Symfony\\Component\\HttpKernel\\EventListener\\ValidateRequestListener::onKernelRequest"
}
|
| DEBUG 16:39:29 | event |
Notified event "kernel.request" to listener "Nelmio\CorsBundle\EventListener\CorsListener::onKernelRequest". {
"event": "kernel.request",
"listener": "Nelmio\\CorsBundle\\EventListener\\CorsListener::onKernelRequest"
}
|
| DEBUG 16:39:29 | event |
Notified event "kernel.request" to listener "Symfony\Bridge\Doctrine\Middleware\IdleConnection\Listener::onKernelRequest". {
"event": "kernel.request",
"listener": "Symfony\\Bridge\\Doctrine\\Middleware\\IdleConnection\\Listener::onKernelRequest"
}
|
| DEBUG 16:39:29 | event |
Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\SessionListener::onKernelRequest". {
"event": "kernel.request",
"listener": "Symfony\\Component\\HttpKernel\\EventListener\\SessionListener::onKernelRequest"
}
|
| DEBUG 16:39:29 | event |
Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\LocaleListener::setDefaultLocale". {
"event": "kernel.request",
"listener": "Symfony\\Component\\HttpKernel\\EventListener\\LocaleListener::setDefaultLocale"
}
|
| DEBUG 16:39:29 | event |
Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\RouterListener::onKernelRequest". {
"event": "kernel.request",
"listener": "Symfony\\Component\\HttpKernel\\EventListener\\RouterListener::onKernelRequest"
}
|
| DEBUG 16:39:29 | event |
Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\LocaleListener::onKernelRequest". {
"event": "kernel.request",
"listener": "Symfony\\Component\\HttpKernel\\EventListener\\LocaleListener::onKernelRequest"
}
|
| DEBUG 16:39:29 | event |
Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\LocaleAwareListener::onKernelRequest". {
"event": "kernel.request",
"listener": "Symfony\\Component\\HttpKernel\\EventListener\\LocaleAwareListener::onKernelRequest"
}
|
| DEBUG 16:39:29 | event |
Notified event "kernel.request" to listener "Symfony\Bundle\SecurityBundle\Debug\TraceableFirewallListener::configureLogoutUrlGenerator". {
"event": "kernel.request",
"listener": "Symfony\\Bundle\\SecurityBundle\\Debug\\TraceableFirewallListener::configureLogoutUrlGenerator"
}
|
| DEBUG 16:39:29 | event |
Notified event "kernel.request" to listener "Symfony\Bundle\SecurityBundle\Debug\TraceableFirewallListener::onKernelRequest". {
"event": "kernel.request",
"listener": "Symfony\\Bundle\\SecurityBundle\\Debug\\TraceableFirewallListener::onKernelRequest"
}
|
| DEBUG 16:39:29 | event |
Notified event "kernel.controller" to listener "Symfony\Bundle\FrameworkBundle\DataCollector\RouterDataCollector::onKernelController". {
"event": "kernel.controller",
"listener": "Symfony\\Bundle\\FrameworkBundle\\DataCollector\\RouterDataCollector::onKernelController"
}
|
| DEBUG 16:39:29 | event |
Notified event "kernel.controller" to listener "App\EventListener\DeviceActivityListener::onController". {
"event": "kernel.controller",
"listener": "App\\EventListener\\DeviceActivityListener::onController"
}
|
| DEBUG 16:39:29 | event |
Notified event "kernel.controller" to listener "App\EventListener\UserActivityListener::onController". {
"event": "kernel.controller",
"listener": "App\\EventListener\\UserActivityListener::onController"
}
|
| DEBUG 16:39:29 | event |
Notified event "kernel.controller" to listener "Symfony\Component\HttpKernel\DataCollector\RequestDataCollector::onKernelController". {
"event": "kernel.controller",
"listener": "Symfony\\Component\\HttpKernel\\DataCollector\\RequestDataCollector::onKernelController"
}
|
| DEBUG 16:39:29 | event |
Notified event "kernel.controller_arguments" to listener "Symfony\Component\HttpKernel\EventListener\IsSignatureValidAttributeListener::onKernelControllerArguments". {
"event": "kernel.controller_arguments",
"listener": "Symfony\\Component\\HttpKernel\\EventListener\\IsSignatureValidAttributeListener::onKernelControllerArguments"
}
|
| DEBUG 16:39:29 | event |
Notified event "kernel.controller_arguments" to listener "Symfony\Component\Security\Http\EventListener\IsCsrfTokenValidAttributeListener::onKernelControllerArguments". {
"event": "kernel.controller_arguments",
"listener": "Symfony\\Component\\Security\\Http\\EventListener\\IsCsrfTokenValidAttributeListener::onKernelControllerArguments"
}
|
| DEBUG 16:39:29 | event |
Notified event "kernel.controller_arguments" to listener "Symfony\Component\Security\Http\EventListener\IsGrantedAttributeListener::onKernelControllerArguments". {
"event": "kernel.controller_arguments",
"listener": "Symfony\\Component\\Security\\Http\\EventListener\\IsGrantedAttributeListener::onKernelControllerArguments"
}
|
| DEBUG 16:39:29 | event |
Notified event "kernel.controller_arguments" to listener "Symfony\Component\HttpKernel\EventListener\CacheAttributeListener::onKernelControllerArguments". {
"event": "kernel.controller_arguments",
"listener": "Symfony\\Component\\HttpKernel\\EventListener\\CacheAttributeListener::onKernelControllerArguments"
}
|
| DEBUG 16:39:29 | event |
Notified event "kernel.controller_arguments" to listener "ContainerNxKBOxo\RequestPayloadValueResolverGhost01ca9cc::onKernelControllerArguments". {
"event": "kernel.controller_arguments",
"listener": "ContainerNxKBOxo\\RequestPayloadValueResolverGhost01ca9cc::onKernelControllerArguments"
}
|
| DEBUG 16:39:29 | event |
Notified event "kernel.controller_arguments" to listener "Symfony\Component\HttpKernel\EventListener\ErrorListener::onControllerArguments". {
"event": "kernel.controller_arguments",
"listener": "Symfony\\Component\\HttpKernel\\EventListener\\ErrorListener::onControllerArguments"
}
|
Stack Trace
|
TypeError
|
|---|
TypeError:
App\Security\Voter\BrandSubresourceVoter::voteOnIteratorAggregate(): Argument #1 ($user) must be of type App\Entity\User|App\Entity\Device, null given, called in /usr/src/app/src/Security/Voter/BrandSubresourceVoter.php on line 52
at src/Security/Voter/BrandSubresourceVoter.php:96
at App\Security\Voter\BrandSubresourceVoter->voteOnIteratorAggregate()
(src/Security/Voter/BrandSubresourceVoter.php:52)
at App\Security\Voter\BrandSubresourceVoter->vote()
(vendor/symfony/security-core/Authorization/Voter/TraceableVoter.php:35)
at Symfony\Component\Security\Core\Authorization\Voter\TraceableVoter->vote()
(vendor/symfony/security-core/Authorization/AccessDecisionManager.php:89)
at Symfony\Component\Security\Core\Authorization\AccessDecisionManager->collectResults()
(vendor/symfony/security-core/Authorization/Strategy/UnanimousStrategy.php:36)
at Symfony\Component\Security\Core\Authorization\Strategy\UnanimousStrategy->decide()
(vendor/symfony/security-core/Authorization/AccessDecisionManager.php:73)
at Symfony\Component\Security\Core\Authorization\AccessDecisionManager->decide()
(vendor/symfony/security-core/Authorization/TraceableAccessDecisionManager.php:57)
at Symfony\Component\Security\Core\Authorization\TraceableAccessDecisionManager->decide()
(vendor/symfony/security-core/Authorization/AuthorizationChecker.php:54)
at Symfony\Component\Security\Core\Authorization\AuthorizationChecker->isGranted()
(vendor/api-platform/core/src/Symfony/Security/Core/Authorization/ExpressionLanguageProvider.php:29)
at ApiPlatform\Symfony\Security\Core\Authorization\ExpressionLanguageProvider::ApiPlatform\Symfony\Security\Core\Authorization\{closure}()
(vendor/symfony/expression-language/Node/FunctionNode.php:50)
at Symfony\Component\ExpressionLanguage\Node\FunctionNode->evaluate()
(vendor/symfony/expression-language/Node/BinaryNode.php:105)
at Symfony\Component\ExpressionLanguage\Node\BinaryNode->evaluate()
(vendor/symfony/expression-language/ExpressionLanguage.php:59)
at Symfony\Component\ExpressionLanguage\ExpressionLanguage->evaluate()
(vendor/api-platform/core/src/Symfony/Security/ResourceAccessChecker.php:57)
at ApiPlatform\Symfony\Security\ResourceAccessChecker->isGranted()
(vendor/api-platform/core/src/Symfony/Security/State/AccessCheckerProvider.php:87)
at ApiPlatform\Symfony\Security\State\AccessCheckerProvider->provide()
(vendor/api-platform/core/src/State/Provider/SecurityParameterProvider.php:50)
at ApiPlatform\State\Provider\SecurityParameterProvider->provide()
(vendor/api-platform/core/src/State/Provider/DeserializeProvider.php:60)
at ApiPlatform\State\Provider\DeserializeProvider->provide()
(vendor/api-platform/core/src/Symfony/Security/State/AccessCheckerProvider.php:62)
at ApiPlatform\Symfony\Security\State\AccessCheckerProvider->provide()
(vendor/api-platform/core/src/Symfony/Validator/State/ValidateProvider.php:32)
at ApiPlatform\Symfony\Validator\State\ValidateProvider->provide()
(vendor/api-platform/core/src/Symfony/Security/State/AccessCheckerProvider.php:62)
at ApiPlatform\Symfony\Security\State\AccessCheckerProvider->provide()
(vendor/api-platform/core/src/Symfony/Validator/State/ParameterValidatorProvider.php:101)
at ApiPlatform\Symfony\Validator\State\ParameterValidatorProvider->provide()
(vendor/api-platform/core/src/State/Provider/ParameterProvider.php:102)
at ApiPlatform\State\Provider\ParameterProvider->provide()
(vendor/api-platform/core/src/State/Provider/ContentNegotiationProvider.php:56)
at ApiPlatform\State\Provider\ContentNegotiationProvider->provide()
(vendor/api-platform/core/src/Symfony/Controller/MainController.php:94)
at ApiPlatform\Symfony\Controller\MainController->__invoke()
(vendor/symfony/http-kernel/HttpKernel.php:183)
at Symfony\Component\HttpKernel\HttpKernel->handleRaw()
(vendor/symfony/http-kernel/HttpKernel.php:76)
at Symfony\Component\HttpKernel\HttpKernel->handle()
(vendor/symfony/http-kernel/Kernel.php:193)
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:32)
at require_once('/usr/src/app/vendor/autoload_runtime.php')
(public/index.php:5)
|