Hi!

Developing on Symfony 2 I was always wondering why I should write parameters 
in DI config files as one-liners.

Why this:
1.
<parameter 
key="my.test.purpose.class">My\Really\Long\Namespaced\Class\Name</parameter>

instead of this:
2.
<parameter key="my.test.purpose.class">
My\Really\Long\Namespaced\Class\Name
</parameter>
???

One-liner is bad when it doesn't fit on the screen. Also my editor (IDEA) 
tries to create 2-nd option instead of the first one when formatting during 
copy-paste.

The second option is not possible as parameters are not trim'ed so trying to 
instantiate such class will end up with an Exception: 

InvalidArgumentException: "'
My\\Really\\Long\\Namespaced\\Class\\Name
'" is not a valid class name for the "my.test.purpose" service.

I think it would be much better to trim all parameters as it would 
be visually easier to read (and write) it. 
The downside would be that we are unable to place any space in our 
parameters but do we really need this?

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to symfony-devs@googlegroups.com
To unsubscribe from this group, send email to
symfony-devs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en

Reply via email to