-
-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Compiler: removed support for \ in service name (BC break)
- Loading branch information
Showing
1 changed file
with
4 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72bc3f0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's reason for this? We are using it quit a lot as IDE is able to suggest me the name of service in neon file and I can easily change her configuration.
72bc3f0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ping @dg
72bc3f0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because syntax
Class\Name: self
is deprecated for long time 48388d9 and replaced with- Class\Name
.72bc3f0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, but it's not the same.
Let's say that I've got and interface Namespace\IFoo. So I create a service with name Namespace\IFoo and specify the default impementation by class option. When I need to overwrite it or add some setup in local config, I do not need to think about the name of service and simple use her class name. It's simple and efective.
Example:
module.neon:
config.local.neon:
72bc3f0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand, but this can lead to confusion, referencing via name
@Namespace\IFoo
will not work as expected:72bc3f0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So it's becouse of this? Maybe we could check if class is of type $serviceName?
72bc3f0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is hard and it is not enough. Simply
Namespace\IFoo:
is name (no inheritance, case sensitive), it is not class/interface name, but it looks like class name (inheritance, case insensitive).72bc3f0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I understand...