I'm dabbling with the idea of setting up PHP CodeSniffer on our continuous integration server in an effort to improve the quality of our code-base. After reading the documentation I'm very excited about the idea of normalizing and enforcing our…
I use PSR-2 for code styling my code.
When I inspect a file using Codesniffer most of the times I get the following error.
332 | ERROR | [x] Expected 1 newline at end of file; 0 found
It's obvious how to fix this. What I need to know is if…
Is there a PHPCS coding standard that would check that proper annotations (@param, @return, @throws, etc.) are present in a docblock, including the proper spacing between them?
I'm trying to install PHP CodeSniffer on OS X Mountain Lion - and I appear to be getting a strange problem
When running 'phpcs' I get the following error:
PHP Warning: include_once(PHP/CodeSniffer/CLI.php): failed to open stream: No such
file or…
I've spent now over 2h on trying to figure out how to require the { in the same line as the method declaration instead of the default requirement being the next line. How can I get this done? I've copied the PSR2 standard to a new folder named PSR2…
I've recently inherited a large PHP application with NO objects/modules/namespaces...only a lot of files containing functions.
Of course, there is a LOT of dependencies (and all files and almost always included).
I'm looking for a tool that could…
Since switching from SVN to Git, we lost the ability to enforce our coding standards through a pre-commit hook on the subversion server.
With Git, you only have pre-commit hooks on the client which cannot be enforced in any way. What makes it worse…
My codebase adheres (or should) to the Zend Coding Standard. I've been using the Zend standard with PHP_CodeSniffer, but I see discussion saying the Zend standard for phpcs is inconsistent and unmaintained and doesn't necessarily stick to the Zend…
I'm trying to write an custom ruleset.xml for php code sniffer but calling it from the commandline without putting it in the default folder doesn't seem to work.
Since the documentations seems to state otherwise i'd like to ask if i'm doing…
I am trying to figure out which code style to enforce with the phpcs code sniffer.
Since the popularity of Symfony2, it seems to be a good practice to use its code standard. On the other hand, its code style is based upon PSR2, so this seems to be…
I've extended a class of the PSR-2 sniff set. Now the checks are executed two times -- even if my chid class is empty.
Why? And how to do it correctly?
EDIT:
I have an idea now why: Probably the Sniffer processes the rulesets bottom-up -- from the…
I am trying to build a pre-commit script in SVN, and I want to run PHP_CodeSniffer on the modified lines only (as opposed to the whole file). So far I have this script:
#!/bin/sh
REPOS="$1"
TXN="$2"
# Make sure that the log message contains some…
I followed this guide for eclipse integration on drupal:
https://drupal.org/node/1420004
I tried to install PTI plugin to Aptana
(Aptana Studio 3, build: 3.4.1.201306062137, with Eclipse Platform Version:…