gsherwood on master
Fixed docblocks Because custom… (compare)
@gsherwood The method name is spelled incorrectly, and I think those Boolean values are swapped as well.
The File::getMethodParamaters() method now includes a has_body array index in the return value TRUE if the method has no body (as with abstract and interface methods) or FALSE otherwise
@glen-84 No, unfortunately not as that would require the specs of the parent class which PHPCS may or may not have information on.
What I mean by that is, that:
Does that explain it well enough ?
Hi, I'm having an issue where include patterns seem to be applying differently between my local environment and Travis CI. Has anyone run into that?
Example: the complexity of third party code makes using an include much easier than exclude patters. The following locally only checks directories that start with foo- or files that start with foo-*. But in Travis it's not being respected.
<rule ref="PSR2"> <include-pattern>*/foo\-*/*</include-pattern> <include-pattern>*/foo\-*\.php</include-pattern> </rule>
$tokens = $phpcsFile->getTokens(); $phpcsFile->tokenizer->ignoredLines[$tokens[$stackPtr]['line']] = array( 'CodingStandard.Commenting.FunctionComment.TypeHintMissing' => true, );
Hi there, i'm using docker and i'm having a problem integrating a containerized php executable into PhpStorm with PHP CS. The problem is, as I guess you know, that containers should be remplazable and have as less persistance as it's possible but, for PHP CS to work as expected, i need to add the installed_paths so it knows about the symfony standard.
TLDR: I'm using a docker container and do not have a local PHP (neither I want) and the container does not know about the "installed_paths" when it's run.
Hi, is it possible to extend phpcs rules(ruleset.xml) with phpcsfixer rules like yoda_style?
$finder = PhpCsFixer\Finder::create()
$config = [
'@PSR2' => true,
'array_indentation' => true,
'array_syntax' => ['syntax' => 'short'],
'yoda_style' => true,
root@faaab3cb17ad:/var/www/xuanwutenant/vendor/bin# ./phpcs --standard=/var/www/xuanwutenant/phpcs.xml /var/www/xuanwutenant/app/Http/Controllers/FrontendApi/FrontendAuthController.php
PHP Fatal error: Uncaught ReflectionException: Function SjczTDG4TDK0Tweg() does not exist in /var/www/xuanwutenant/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/DeprecatedFunctionsSniff.php:37
#0 /var/www/xuanwutenant/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/DeprecatedFunctionsSniff.php(37): ReflectionFunction->construct('SjczTDG4TDK0Twe...')
#1 /var/www/xuanwutenant/vendor/squizlabs/php_codesniffer/src/Ruleset.php(1196): PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\DeprecatedFunctionsSniff->construct()
#2 /var/www/xuanwutenant/vendor/squizlabs/php_codesniffer/src/Ruleset.php(217): PHP_CodeSniffer\Ruleset->populateTokenListeners()
#3 /var/www/xuanwutenant/vendor/squizlabs/php_codesniffer/src/Runner.php(332): PHP_CodeSniffer\Ruleset->__construct(Object(PHP_CodeSniffer\Config))
#4 /var/www/xuanwutenant/vendor/squizlabs/php_codesniffer/src/Runner.php(70): PHP_CodeSniffer\Runner->init()
#5 /var/www/xuanwutenant/vendor/squizlabs/php_codesniffer/bin/phpcs(18): PHP_CodeSn in /var/www/xuanwutenant/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/DeprecatedFunctionsSniff.php on line 37
SjczTDG4TDK0Twegwould be marked as an internal function by PHP, so I'm not sure how to help. Anything special you are doing that might cause this?
relative) is not supported: https://github.com/squizlabs/PHP_CodeSniffer/blob/a2bde796c6a6313e0a8ed730d33a0eb2cabeafa8/src/Ruleset.php#L1230-L1237
phpcs: Declaration of Glen84\Sniffs\Strings\DoubleQuoteUsageSniff::process(PHP_CodeSniffer\Files\File $phpcsFile, int $stackPtr) must be compatible with PHP_CodeSniffer\Sniffs\Sniff::process(PHP_CodeSniffer\Files\File $phpcsFile, $stackPtr) in D:\Programming\Standards\phpcs\Glen84\Sniffs\Strings\DoubleQuoteUsageSniff.php on line 15