Welcome Guest, Not a member yet? Register   Sign In
CodeIgniter PHP Style Guide
#11

[eluser]Natebot[/eluser]
I think class case, and the suggested style, should be enforced.

I'd want a validator to at least have the option to enforce styles, it would be reason I'd use it.

Doesn't the style guide, or rather the user guide's sections on making your own libraries and controllers also have, or at least suggest, a convention on file names too?

Maybe the validator could be set up in such away that tests could be overwritten or turned off in the case of developers that don't adopted all the style suggestions. I am thinking of the later, localized version you speak of.
#12

[eluser]Dam1an[/eluser]
Another nice thing to add would be based on if they use PHP4 or 5, so all functionvars should be declared public/protected/private etc (this is of course additional functionality, so no need to worry about it just yet Wink)

There's an idea... can you not just run the CLI of PHP with some arg to validate the file, that will take care of most things, leaving you to worry about just the CI side of things Smile
#13

[eluser]TheFuzzy0ne[/eluser]
Yes, in the future you will be able to do that, but for the meantime, simplicity is key. When someone comes onto the forum and says "I'm new to CI and I keep getting a 404 - Page cannot be found error", we simply point them in the direction of the validator, and they can validate away. It's simply a case of selecting the file type and uploading a file to go with it. No need for any downloads, or installing PHP or learning the command line switches. Does this make sense? Granted, this idea might have a lot more potential than what I'd originally thought, but for the meantime, simplicity is key.
#14

[eluser]thomas.ernest[/eluser]
Checking your code with PHP_CodeSniffer [php-cs] and CI standard [ci4php-cs] might have helped you to find this error earlier Wink

[phpcs] http://pear.php.net/package/PHP_CodeSniffer/
[ci4php-cs] https://github.com/thomas-ernest/CodeIgn...odeSniffer
#15

[eluser]osci[/eluser]
@thomas.ernest
Start a new topic in ignited code and post what your code does and the pros there.

I'm already fed up reading everywhere the same post.

Starting from your next post (being the same with the previous ones) I'll start marking them all as spam.
I'm really fed up with this post.
#16

[eluser]thomas.ernest[/eluser]
I added my message to less than 15 threads chosen among everything I read when I was looking for CI standard support in PHP_CodeSniffer. Nonetheless, I can understand that you're fed up, because the timeframe in which these messages were added is much shorter than following a normal process (By normal process I mean, people aware of this tool could have share it on all of these topics along the time).

Whatever, thank you for your patience and your advice. I may open a topic especially for this 'tool' so that everybody could discuss pros and cons in a centralized place as you suggested.




Theme © iAndrew 2016 - Forum software by © MyBB