Too few arguments var/cache/dev/appDevDebugProjectContainer.php
Bonjour,
Je rencontre un problème bizarre avec un de mes services symfony (symfony 3).
Ca me dit:
Citation:
Type error: Too few arguments to function ISC\AuthenticationBundle\Repositories\AuthenticationUserRepository::__construct(), 1 passed in /opt/workspaces/eclipse-php/webisc/var/cache/dev/appDevDebugProjectContainer.php on line 2227 and exactly 2 expected
Effectivement, dans le cache je retrouve que le service généré par symfony est ainsi:
Code:
1 2 3 4
| protected function getIscAuthentication_RepositoryAuthenticationUserService()
{
return $this->services['isc_authentication.repositoryAuthenticationUser'] = new \ISC\AuthenticationBundle\Repositories\AuthenticationUserRepository(${($_ = isset($this->services['isc_webservicesbundle.consumer']) ? $this->services['isc_webservicesbundle.consumer'] : $this->get('isc_webservicesbundle.consumer')) && false ?: '_'});
} |
Or, je déclare son constructeur comme ça, avec deux arguments:
Code:
1 2 3 4 5 6 7 8 9
|
private $_consumer;
private $_patientRepository;
public function __construct($patientRepository,$consumer)
{
$this->_consumer=$consumer;
$this->_patientRepository=$patientRepository;
} |
Dans le fichier services.yml de ce bundle j'ai:
Code:
1 2 3 4 5 6
|
isc_authenticationbundle.repository:
class: ISC\AuthenticationBundle\Repositories\AuthenticationUserRepository
arguments:
- "@isc_administratif.repositoryPatient"
- "@isc_webservicesbundle.consumer" |
De plus le code du service.yml pour le repositoryPatient est:
Code:
1 2 3 4 5 6
|
services:
isc_administratif.repositoryPatient:
class: ISC\AdministratifBundle\Repositories\PatientRepository
arguments:
- "@isc_webservicesbundle.consumer" |
Je nage... pourquoi le cache se génère-t-il avec un constructeur à 1 parametre alors que j'en veux 2?
J'ai essayé de refaire en inversant les 2 parametres mais c'est toujours sur patientRepository qua ça pèche et je précise que j'ai nettoyé le cache à chaque fois...
Quelqu'un aurait une idée svp?