-
Notifications
You must be signed in to change notification settings - Fork 177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deprecation of single colon when referencing controllers in SF 4.1 #340
Comments
Ok judging from those nice failed tests, the double colon seems to be new in PHP 7.1, now I'm not sure if it's better to find a way to recognize the php version and then use that to determine if it's a double or single colon or if it would be better to bump the minimum php version to 7.1 (which seems to be required by SF 4.1) |
Facing the same problem |
Fixed in fc4750b. |
@bytehead What about SF 3.4? Using double colon throw exception "Class "oneup_uploader.controller.gallery" does not exist." |
Can you show me your requirements in your |
|
Strange, can't reproduce this with a Symfony 3.4.12. And the bundle is also tested against Symfony ^3.4 |
what does |
Upgrade to SF 3.4.12 didn't help. |
With double colon in ContainerControllerResolver method createController executes parent::createController($controller). There is throwing exception: if (!class_exists($class)) {
throw new \InvalidArgumentException(sprintf('Class "%s" does not exist.', $class));
} In single colon controller is returing as a service: $service = $this->container->get($controller); |
And with version |
Double colons should be supported in |
Yes. In 2.0.5 and 2.0.6 changing uploader-bundle/Routing/RouteLoader.php:33 from: ['_controller' => $service.'::upload', '_format' => 'json'], to ['_controller' => $service.':upload', '_format' => 'json'], fixed the problem. Maybe it's something with my configuration but php cant create new class from service id "oneup_uploader.controller.gallery" |
Give |
Thx for fast fix. |
You're welcome. |
Starting at Symfony 4.1 you'll get a
Referencing controllers with a single colon is deprecated since Symfony 4.1. Use oneup_uploader.controller.xxxx::upload instead.
deprecation for generated routes.
The text was updated successfully, but these errors were encountered: