Skip to content
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

Case-sensitivity and yml-keys. #179

Closed
annitya opened this issue Nov 6, 2013 · 7 comments
Closed

Case-sensitivity and yml-keys. #179

annitya opened this issue Nov 6, 2013 · 7 comments
Labels

Comments

@annitya
Copy link

annitya commented Nov 6, 2013

Some of our yml-parameter keys are transformed to lowercase in appDevDebugProjectContainer.xml. The symfony2-plugin then reports parameters as missing, due to the difference in casing.

Excellent plugin by the way! :)

@Haehnchen
Copy link
Owner

can u give example lines of yaml and container file?
there also some tolower converts in the plugin that are from @adrienbrault . i think he knows why? :)

@annitya
Copy link
Author

annitya commented Nov 11, 2013

Yaml-file:

services:
contenttype:
class: someclass
arguments: [%importSettings%]

Snippet from appDevDebugProjectContainer.xml:

    <parameter key="importsettings" type="collection">
        <parameter key="language-code">nor-NO</parameter>
    </parameter>

Notice the difference between "importSettings" and importsettings. If I change the casing in the yml-file, the "missing-parameter"-message goes away.

@stof
Copy link
Contributor

stof commented Nov 12, 2013

Parameter names are indeed lowercased in Symfony to make them case sensitive (which is why the common naming convention for parameters is not camelCased btw)

@annitya
Copy link
Author

annitya commented Nov 13, 2013

Lowercased to make them case sensitive?

@stof
Copy link
Contributor

stof commented Nov 13, 2013

Parameter names are considered case insensitive in the DI component (service ids are case insensitive too).
to implement this in an easy way, they are stored in lowercase in the container (storing them with their original case would require reading all possible cases when looking for the array key, which is insane).

The PhpStorm plugin reads the parameters from the compiled container, so it has the lowercased names.
But it should indeed change its logic to be case insensitive when providing GoTo and completion

@annitya
Copy link
Author

annitya commented Nov 13, 2013

A common approach. Lowercased to make then case insensitive on compare then! :) I believe completion is lowercased, but GoTo is not. Completion looks up the already lowercased values from the xml-serialized container. GoTo uses the value directly from PhpStorm. A fix should be simple to implement! :)

@annitya
Copy link
Author

annitya commented Dec 3, 2013

Beautiful. Best plugin ever!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants