Description
Q | A |
---|---|
Bug report? | yes |
Feature request? | no |
BC Break report? | no |
RFC? | no |
Symfony version | 3.3 |
I'm upgrading a real application to Symfony 3.3 + Flex + autowiring. I'm using the default app.yaml
config with full autowiring. The problem is that autowiring "randomly" fails.
Yesterday, I saw this error:
Expected to find class "App\Controller\AdminController" in file "/Users/javier/<my-
project>/src/Controller/AdminController.php" while importing services from resource
"../../src/*", but it was not found! Check the namespace prefix used with the
resource in /Users/javier/<my-project>/config/packages/app.yaml (which is loaded
in resource "/Users/javier/<my-project>/config/packages/app.yaml").
I've checked 100 times: the class exists in that file. Moreover, there are more than 10 controllers in the same location with the same namespace. All of them work, except this one.
Then I removed that AdminController, but I saw this:
Expected to find class "App\Test\AbstractTestCase" in file "/Users/javier/<my-
project>/src/Test/AbstractTestCase.php" while importing services from resource
"../../src/*", but it was not found! Check the namespace prefix used with the
resource in /Users/javier/<my-project>/config/packages/app.yaml (which is loaded
in resource "/Users/javier/<my-project>/config/packages/app.yaml").
Again, I've checked 100 times. Everything is correct ... but it fails. If I remove that PHP class, the application works perfectly. At least with Symfony 3.3.4.
Today I've just upgraded the application to 3.3.5 ... and I see this error message:
Expected to find class "App\Form\Type\AcmeType" in file "/Users/javier/<my-
project>/src/Form/Type/AcmeType.php" while importing services from resource
"../../src/*", but it was not found! Check the namespace prefix used with the
resource in /Users/javier/<my-project>/config/packages/app.yaml (which is loaded
in resource "/Users/javier/<my-project>/config/packages/app.yaml").
If I remove that class (which is perfectly fine, including the namespace, and yesterday it worked) the application works again.
I'm sorry I can't give you a better error report, but this is all I know for now: autowiring randomly fails for some classes and makes the app unusable.