for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* CodingStandard_Sniffs_ControlStructures_ControlSignatureSniff.
*
* PHP version 5
* @category PHP
* @package PHP_CodeSniffer
* @author Greg Sherwood <[email protected]>
* @author Marc McIntyre <[email protected]>
* @author Alexander Obuhovich <[email protected]>
* @license https://github.com/aik099/CodingStandard/blob/master/LICENSE BSD 3-Clause
* @link https://github.com/aik099/CodingStandard
*/
namespace CodingStandard\Sniffs\ControlStructures;
use PHP_CodeSniffer\Sniffs\AbstractPatternSniff;
* Verifies that control statements conform to their coding standards.
class ControlSignatureSniff extends AbstractPatternSniff
{
* A list of tokenizers this sniff supports.
* @var array
public $supportedTokenizers = array(
'PHP',
'JS',
);
* Constructs a PEAR_Sniffs_ControlStructures_ControlSignatureSniff.
public function __construct()
parent::__construct(true);
}//end __construct()
* Returns the patterns that this test wishes to verify.
* @return string[]
protected function getPatterns()
return array(
'do {EOL...} while (...);EOL',
'while (...) {EOL',
'switch (...) {EOL',
'for (...) {EOL',
'if (...) {EOL',
'foreach (...) {EOL',
'}EOLelseif (...) {EOL',
'}EOLelse {EOL',
'do {EOL',
'try {EOL',
'}EOLcatch (...) {EOL',
}//end getPatterns()
}//end class