This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<ruleset name="MyStandard"> | |
<description>PSR2 with tabs instead of spaces.</description> | |
<arg name="tab-width" value="4"/> | |
<rule ref="PSR2"> | |
<exclude name="Generic.WhiteSpace.DisallowTabIndent"/> | |
</rule> | |
<rule ref="Generic.WhiteSpace.DisallowSpaceIndent"/> | |
<rule ref="Generic.WhiteSpace.ScopeIndent"> | |
<properties> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace MyCustomProject; | |
use PHP_CodeSniffer\Runner; | |
use PHP_CodeSniffer\Config; | |
use PHP_CodeSniffer\Reporter; | |
use PHP_CodeSniffer\Files\DummyFile; | |
use PHP_CodeSniffer\Util\Timing; | |
// Include the PHPCS autoloader however you need. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Vendor\Package; | |
use FooInterface; use BarClass as Bar; use OtherVendor\OtherPackage\BazClass; | |
class Foo extends Bar implements FooInterface { | |
public function sampleFunction($a,$b=null) { | |
if ($a === $b) { bar(); | |
} else if ($a>$b) { | |
$foo->bar( $arg1 ); } | |
else { | |
BazClass::bar($arg2,$arg3 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Verifies that inline control statements are not present. | |
* | |
* @author Greg Sherwood <gsherwood@squiz.net> | |
* @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) | |
* @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence | |
*/ | |
namespace PHP_CodeSniffer\Standards\Generic\Sniffs\ControlStructures; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace MyCustomProject; | |
use PHP_CodeSniffer\Runner; | |
use PHP_CodeSniffer\Config; | |
use PHP_CodeSniffer\Files\DummyFile; | |
// Include the PHPCS autoloader, however you need to. | |
require_once __DIR__.'/autoload.php'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ git diff | |
diff --git a/CodeSniffer/File.php b/CodeSniffer/File.php | |
index f45e307..e629fed 100644 | |
--- a/CodeSniffer/File.php | |
+++ b/CodeSniffer/File.php | |
@@ -1446,7 +1446,7 @@ class PHP_CodeSniffer_File | |
if (PHP_CODESNIFFER_VERBOSITY > 1) { | |
$type = $tokens[$i]['type']; | |
$content = str_replace($eolChar, '\n', $tokens[$i]['content']); | |
- echo "\tStart scope map at $i: $type => $content".PHP_EOL; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ php scripts/phpcs ../zf2/library/Zend/ --standard=PSR2 -p --report=source -ns | |
PHP CODE SNIFFER VIOLATION SOURCE SUMMARY | |
-------------------------------------------------------------------------------- | |
SOURCE COUNT | |
-------------------------------------------------------------------------------- | |
[x] PSR2.Methods.FunctionCallSignature.Indent 328 | |
[ ] PSR2.Methods.FunctionCallSignature.MultipleArguments 276 | |
[x] PSR2.Methods.FunctionCallSignature.CloseBracketLine 248 | |
[x] Squiz.WhiteSpace.ScopeClosingBrace.ContentBefore 230 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cat temp.php | |
<?php | |
class Client extends GuzzleClient implements ClientInterface { | |
/** | |
* {@inheritdoc} | |
*/ | |
public function authenticatedRequest($method = 'GET', $url = null, UserInterface $user, $options = []) { | |
$duration = isset($options['timeout']) ? $options['timeout'] : NULL; | |
$options['query']['token'] = $user->acquireToken($duration); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ($foo) { | |
echo 'foo'; | |
} elseif ($bar) { | |
echo 'bar'; | |
} else { | |
echo 'else'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Generic_Sniffs_Strings_SearchStringSniff. | |
* | |
* PHP version 5 | |
* | |
* @category PHP | |
* @package PHP_CodeSniffer | |
* @author Greg Sherwood <gsherwood@squiz.net> | |
* @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) |
NewerOlder