Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
CodeSniffer coding standards
  • Hi guys,
    is there any particular coding standard that I can check with CodeSniffer that I can follow if I want to contribute to the FuelPHP project?
    Thanks!
  • Hi all, maybe these sniffers could do the trick : https://github.com/eviweb/fuelphp-phpcs
    All rules are not applicable, but the main are followed. I let you test it if you want, and please feel free to give me your feedback. Best regards Eric
  • Will certainly do. I had a stab at this a few months ago, but never completed it.
  • Don't really know what you mean by CodeSniffer but here's the url for fuelphp's coding standard. http://docs.fuelphp.com/general/coding_standards.html
  • I saw the coding standards in the URL you sent Huzzi but they are not that detailed and I was wondering if the FuelPHP team uses a tool like PHP CodeSniffer to make sure that the standards are followed be contributions made. Joomla / Drupal are some projects that use CodeSniffer to keep a consistent code base, just wondering if there is something similar to FuelPHP.
  • No, we don't. Currently we scan contributions manually, so far that has not been an issue. What exactly are you missing in the existing coding standards?
  • My intial though was about code commenting but I guess the manual scan is ok due to the current size of the project. Thanks for the replies guys
  • We use docblox to check if the high level comments are ok. For inline comments, it's virtually impossible to automate that, a script can't tell you if they make any sense. We also need to scan the code manually to make sure the quality is up to par. So for the moment I don't see the added benefit of an automated system.
  • Understand inline comments is fine, I was more thinking of the function comments. As a sample have a look at the Controller_Template->after() function , the response parameter is not documented. It just makes the code assist a bit trickier to understand in netbeans and also the automated doc generation to lack info. Haven't tried the docblox out, will have a look at it.
  • That what we use docblox for. We're currently busy with a new application (called "Fuel Depot") which will contain all information about FuelPHP. You can find the staging site here: http://fueldepot.exite.eu If logged in, the API docs will show all docblox errors detected in the selected file, so it can be picked up and corrected. I'm also planning a central error log, which can be used as a docs-todo-list.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion