Questions tagged [phpcodesniffer]

PHP_CodeSniffer is a PHP PEAR package that can be used to tokenise PHP, JavaScript and CSS files and to detect violations of a defined set of coding standards.

PHP_CodeSniffer is a PHP PEAR package that can be used to tokenise PHP, JavaScript and CSS files and to detect violations of a defined set of coding standards. More information can be found here: http://pear.php.net/package/PHP_CodeSniffer/redirected , including documentation and download links.

327 questions
0
votes
0 answers

Are the levels in PHP CodeSniffer inherited?

In PHP CodeSniffer, do the different levels of fixers inherit from each other? E.g. if I run with level psr2, does it include all the fixers in psr1? I've found that running with --level=symfony and then running again with --level=psr2 and --dry-run…
ironchicken
  • 754
  • 6
  • 19
0
votes
1 answer

php code sniffer codeigniter error - "CodeIgniter.Files.ClosingLocationComment" does not exist

I spent whole day installing pear, code sniffer on my mac El Capitan. I also installed codeigniter sniff from this link Sniffs for codeigniter and followed this video tutorial. Now when I test my codeigniter code I get below error amits-iMac:~…
www.amitpatil.me
  • 3,001
  • 5
  • 43
  • 61
0
votes
1 answer

Php Code Sniffer validation issues

I am trying to make my php code psr-1 psr-2 compliant Don't i am getting some weird errors actually i am not understanding what exactly it want me to solve :( Issue-1 Error: Opening parenthesis of a multi-line function call must be the last content…
0
votes
1 answer

git pre-commit hook bypass email

I have a pre-commit hook that runs PHP Codesniffer on all files in the staging area. However, sometimes developers bypass this hook by adding --no-verify option to the git commit command. Is there a way I can send an email each time a developer…
Osama
  • 1
0
votes
1 answer

How to setup different CodeSniffer executables for different projects?

I have a problem, that some of my projects loaded into PhpStorm IDE requires different CodeSniffer versions because of different Code Style conventions. If I go to Settings -> PHP -> Code Sniffer, I can choose only global CS executable. Is there a…
Aistis
  • 3,695
  • 2
  • 34
  • 34
0
votes
1 answer

Installing pear not working

Hello I'm trying to install pear to be able to install Codesniffer. I read that it was fairly easy to do so apparently all I had to do was sudo pear install PHP_CodeSniffer Somehow this didnt work, i got this error Pear: command not found My…
Kevin
  • 930
  • 3
  • 13
  • 34
0
votes
1 answer

No releases available for package “pear.php.net/PHP_CodeSNiffer”

On windows7 I have installed XAMPP with PEAR. I try install PHP_CodeSniffer but i obtain error No releases available for package “pear.php.net/PHP_CodeSNiffer”. I try pear clear_cache, pear update-chanels but still same error
mardon
  • 1,065
  • 1
  • 11
  • 29
0
votes
1 answer

PHPMD (PHP Mess Detector) integration in Eclipse Mars

Before the release of Mars it was possible to install PHPMD support in Eclipse, albeit with some caveats and difficulties. Now support from PTI seems to have been removed completely, even if development of PHPMD hasn't stopped and PHPMD does offer…
LSerni
  • 55,617
  • 10
  • 65
  • 107
0
votes
1 answer

PHPCS / PHPCBF with Grunt without Global Install

We use Bower and Grunt. After running bower install, I get a bower_components/phpcs directory. My grunt task is set up as such: phpcbf: { application: { src: ['*.php'] }, options: { bin: 'bower_components/phpcs', …
frogg3862
  • 491
  • 1
  • 4
  • 19
0
votes
1 answer

Editing phpci.yml File for my Project

I've installed PHPCI and have added a project named 'myproject' in PHPCI for testing. It is asked that I should include a 'phpci.yml' file in the root directory of the project. Here is how this 'phpci.tml' file should look like: Click here to see…
Khuram
  • 1,820
  • 1
  • 26
  • 33
0
votes
1 answer

Install / run CodeSniffer on Windows... Is $ required?

I understand that this question seems to be a little silly, but I'm completely clueless as to how to run CodeSniffer. I followed this page and several other blogs or internet articles, but none of them give explanations which seem to be really…
Hiroki
  • 3,893
  • 13
  • 51
  • 90
0
votes
1 answer

Only PHPCS functions in profiler

I'm using PHPStorn, XDEBUG and PHP code sniffer on El Capitan. I'm trying to profile a WordPress theme. When I run the profiler, I can not find any of my functions in the profiler output. All I see if PHP_CodeSniffer related functions. What am I…
Satish Gandham
  • 401
  • 4
  • 12
0
votes
1 answer

Why am I getting an exception from PHP CodeSniffer?

Well, I'm getting a pretty bizarre error from PHPCS:
Josh Smith
  • 14,674
  • 18
  • 72
  • 118
0
votes
1 answer

Netbeans + CodeSniffer installation. Windows command prompt shows false error

I have been trying to install CodeSniffer on NetBeans IDE 8.0.2 (Build 201411181905) and am following these instructions "Install PHP_CodeSniffer, PHPMD, PHP_Depend and PHPCPD. The preferred way is the installation with the PEAR installer (You have…
Daksh B
  • 269
  • 1
  • 8
  • 45
0
votes
1 answer

Including and excluding globbing patterns in bash

I am trying to use the PHPCompatibility standard for PHP CodeSniffer to test a specific set of files. I'm currently using find to do this. find ./path1 ./path2 ./path3 ./path4 \ -type f …
joewang704
  • 77
  • 2
  • 8