This code produces the error:
/**
* @var EntityManagerInterface
*/
private EntityManagerInterface $entityManager;
public function __construct(EntityManagerInterface $entityManager)
{
$this->entityManager = $entityManager;
parent::__construct();
}
My composer.json uses
"php": ">=7.1.3",
And i use Symfony 4.4 which is a requirement for my job.
I found somewhere on the internet that this type of error is caused by outdated version of php but i am not sure if it's the case in this specific situation. My question is if i can write the code differently or if my only option is to go to a higher php version?