-
Notifications
You must be signed in to change notification settings - Fork 39
Conversation
…andards/blob/master/accepted/PSR-2-coding-style-guide.md#22-files ), remove ezcPhpGenerator from phpdocs, replace ?> to \r\n in method populateFile
Thanks for this update. Before validating it, I must update my IDE formatting rules for PHP for this project. What IDE to you use? I'm actually using Zend Studio and it would be great to be able to share the same configuration. if not, I'll learn the PSR-2 specs in order to take them as the formatting rules so it'll be easier to repect these new coding rules |
@mikaelcom I use PHPStorm (http://www.jetbrains.com/phpstorm/) |
I would have argued that it would have been great to first ensure we follow the PSR-0 and PSR-1 but it seems the code respects these two first standards. As you seem to be more familiar that me with these standards, would you say that the generator classes/files respect these two first standards? At least, the generator classes/files should respect as much as possible the PSR-* standards. Then the goal is also to make sure that the generated classes/files respect, as much as possible, these standards. However I must admit it may be more difficult to apply, dynamically, PSR-* standards on generated classes names and properties. Indeed, underscores and particular caracters can be used and pass through the normalizer or break the generated code. Si it can be hard to apply dynamically these standards, however the generator has worked pretty well since a while without having trouble to generate functional classes. What do you think about this last part? I had the idea to create a class that contains the PSR rules in order to generate the classes/files correctly. Maybe it does already exist? if not, maybe it would not be so hard to create it... Enough of talking, let me know if you have ideas to implement these standards easily and beautifully. |
@mikaelcom I saw some code formatters, but they did not work very well and very slowly. The only thing that I find it uncomfortable - it newlines \r\n instead of \n and tabs instead of 4 spaces. PSR recommends using \n and 4 spaces. |
Reading coding standards on other projects makes me realize that standards can be modified and adapted depending on the project and the developers :). if(true)
{
// then do what you want
}
else
{
// then do something else
} instead of if (true) {
// then do what you want
} else {
// then do something else
} However, when you talk about using \n instead of \r\n, is it in the generated classes/files or in the generator classes/files? It's easy to update it in the |
@mikaelcom When upgrading wsdltophp I constantly receive information that some files are modified. In fact, I have not changed anything there. There is speculation that this may be due to line breaks. |
Ok, I found how to modify line endings. I'll get your modifications later today, then I'll apply the configuration of my IDE to see if it fits your modifications. More generally, I think you can also pass Finally, concerning the whole PSR thing, I'll study what you've done and I'll let you know if I have modifications or questions about it. thx |
[MERGE] minor updates for psr-2
Added newline at end of file (PSR-2 https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md#22-files ), remove ezcPhpGenerator from phpdocs, replace ?> to \r\n in method populateFile