-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Closed
Description
Symfony version(s) affected: 4.2.3
Description
I got error Uncaught PHP Exception Symfony\Component\Cache\Exception\InvalidArgumentException: "Cache key "@anonymous" contains reserved characters {}()/@:
In my controller action method I am using anonymous class
...
$form = $this->createForm(SomeType::class, $this->getDataWrapper($data));
...
protected function getDataWrapper($data)
{
return new class ($data) {
protected $data;
public function __construct($data)
{
$this->data = $data;
}
public function getData() {
return $this->data->getQuery()->getResult();
}
public function setData($data) {
$this->data = $data;
}
};
}
I was able to fix this by using ordinary, not anonymous class, but I think it should be fixed somehow