Closed juillerat closed 4 years ago
@juillerat Thank you for your report. Would you be able to provide a small reproducable example?
Whatever happens it must be a bug in another library, Reader::getMethodAnnotations()
must return an array
.
It seems that in your case it returns null
. Maybe we should look if doctrine/annotations
recently introduced a bc break.
due to the close timing of the bug reports .. is the there a relation to https://github.com/FriendsOfSymfony/FOSRestBundle/issues/1636 ?
The Reader::getMethodAnnotations()
returns effectively null
because the annotations doesn't get cached for some reasons: $this->fetchFromCache($cacheKey, $class)
returns null
.
This happens when methods have this annotation: @View(statusCode=Response::HTTP_NO_CONTENT)
even if Response
is declared with use Symfony\Component\HttpFoundation\Response;
. It works with @View(statusCode=204)
@juillerat I don't have this annotation but the error is nevertheless present But I use some like that @QueryParam(map=true, name="sort", requirements=@Sort, allowBlank=false, default={Sort::DEFAULT_FIELD : Sort::DEFAULT_ORDER})
When I don't use --optimize-autoloader on composer install it's ok, otherwise not.
@chosroes I think you should submit an issue on doctrine/annotations, from what you say, it seems to be caused by constants.
Closing as there is no activity.
Hi, I get this exception when clearing cache on production environment
This exception appears with FosRestBundle 1.8, 2.0., 2.1. and Symfony 3.2.1. With Symfony 3.2.0, everything is working as expected. Best regards, Philippe