Closed
Description
Symfony version(s) affected
Any version from 4.4 and PHP 8.1
Description
Use syntax !php/const
with an enum as parameter doesn't work properly when you want to bind the parameter.
How to reproduce
<?php
namespace App;
enum Status: string {
case Draft = 'draft';
case Deleted = 'deleted';
case Published = 'published';
}
# services.yaml
parameters:
my_param: !php/const App\Status::Deleted
services:
_defaults:
autowire: true
autoconfigure: true
bind:
$myParam: '%my_param%'
dd($container->getParameter('my_param')); // is OK output the enum
but
/**
* @Route("/foo", name="foo")
*/
public function index(EntityManagerInterface $entityManager, $myParam): Response
Possible Solution
No response
Additional Context
No response