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
1 answer

Codesniffer standards not working properly

I have recently been working on a coding standard and would like to use codesniffer to check my files according to this standard. Since i am new to Codesniffer i figured i'd go test the standards first before creating my own standard. I have however…
Björn
  • 203
  • 6
  • 19
0
votes
2 answers

PHP 5.2 upgrade to 5.3

Possible Duplicate: Upgrade PHP from version 5.2 to 5.3 I have 15 sites implemented with some functions that are deprecated in PHP 5.3. My hosting provider is offering me a new server, but it has php 5.3 installed on it. I need to upgrade all of…
ElCuy
  • 55
  • 6
0
votes
1 answer

Is there a way to have Netbean's generated PHP Unit tests to adhere to CodeSniffer Zend Standards?

I am using Netbeans to generate PHP Unit tests and CodeSniffer doesn't like the template that was generated because it's not Zend standard. How can I have the PHP Unit test templates generate Zend standard templates so it won't throw all those…
Strawberry
  • 66,024
  • 56
  • 149
  • 197
0
votes
1 answer

JS Lexer to detect function calls

In order to localize strings used within my javascript, I want scan all my js files for such strings. I am using a t() function to request string translations as follows: t("Hello world"); or with dynamic portions: t("Hello @user", {"@user":…
d_inevitable
  • 4,381
  • 2
  • 29
  • 48
0
votes
1 answer

Find string rule in PHP_CodeSniffer

I wish to scan files for the string Firebug, but this is not enought. I also wish to make a difference between QFirebug::log and QFirebug::error static methods. How I can I extract the method name after the class name ? public function…
johnlemon
  • 20,761
  • 42
  • 119
  • 178
-1
votes
1 answer

Any way to ignore `Missing file doc comment` Yii2 using PHp Strom?

How i can remove the error so i don't have to add file tag before namespace and class tag for after name space namespace backend\controllers; use common\models\helpers\Frontend\DropdownHelper; use common\models\Lookup; use…
rajwa766
  • 604
  • 13
  • 31
-1
votes
2 answers

Include Excluded rule

I want to include the PSR12 ruleset (which includes the rule "PSR1.Methods.CamelCapsMethodName.NotCamelCaps") but I don't want that rule to run on a specific file. so I tried the following ruleset:
-1
votes
1 answer

Unable to add codesniffer, psr-1, psr-2, pmd rules in sonarqube

Need to add codesniffer, psr-1, psr-2, pmd rules in sonarqube. I tried finding plugin but get sonar-php-codesniffer0.2 plugin which is compatible only upto sonarqube>2.0. Also there is no way to import custom php rules in sonarqube6.1 or updated…
YATIN GUPTA
  • 916
  • 9
  • 17
-1
votes
2 answers

View source code and sniff images with PHP?

I would like to implement a PHP web page that, given a certain URL, is going to sniff some images from that page. Do to so, I need : 1) to access the html source-code of that page and find out the URLs of the images I want. 2) to download these…
phenetas
  • 117
  • 1
  • 8
-2
votes
2 answers

How should html variables be prepared in php (and specifically, WordPress) before echoing

I'm a complete neophyte when it comes to PHP, so I suspect this question has a simple answer that I'm just not able to find yet. I'm using PHP Code Sniffer with WordPress Coding Standards to put together a basic wordpress plugin. A bunch of tutorial…
tobriand
  • 1,095
  • 15
  • 29
-2
votes
1 answer

PHP_CodeSniffer: How to reset line length on newline?

I've made a custom standard because my coding style is far from anything anyone would call normal. In fact, I reject about 90% of what many people consider good standards as whitespace spam. That being said, I do think that if I'm going to use a…
krowe
  • 2,129
  • 17
  • 19
-3
votes
1 answer

Issue running code sniffer on Mac

I am trying to install php code sniffer. I have manage to get to a point where after running php /Users/ryanfernandes/pear/bin/phpcs --version it display the info. but when I try to run code sniffer by php /Users/username/pear/bin/phpcs…
1 2 3
21
22