1<?php 2/** 3 * Squiz_Sniffs_Functions_FunctionDeclarationSniff. 4 * 5 * PHP version 5 6 * 7 * @category PHP 8 * @package PHP_CodeSniffer 9 * @author Greg Sherwood <gsherwood@squiz.net> 10 * @author Marc McIntyre <mmcintyre@squiz.net> 11 * @copyright 2006-2014 Squiz Pty Ltd (ABN 77 084 670 600) 12 * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence 13 * @link http://pear.php.net/package/PHP_CodeSniffer 14 */ 15 16if (class_exists('PHP_CodeSniffer_Standards_AbstractPatternSniff', true) === false) { 17 throw new PHP_CodeSniffer_Exception('Class PHP_CodeSniffer_Standards_AbstractPatternSniff not found'); 18} 19 20/** 21 * Squiz_Sniffs_Functions_FunctionDeclarationSniff. 22 * 23 * Checks the function declaration is correct. 24 * 25 * @category PHP 26 * @package PHP_CodeSniffer 27 * @author Greg Sherwood <gsherwood@squiz.net> 28 * @author Marc McIntyre <mmcintyre@squiz.net> 29 * @copyright 2006-2014 Squiz Pty Ltd (ABN 77 084 670 600) 30 * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence 31 * @version Release: @package_version@ 32 * @link http://pear.php.net/package/PHP_CodeSniffer 33 */ 34class Squiz_Sniffs_Functions_FunctionDeclarationSniff extends PHP_CodeSniffer_Standards_AbstractPatternSniff 35{ 36 37 38 /** 39 * Returns an array of patterns to check are correct. 40 * 41 * @return array 42 */ 43 protected function getPatterns() 44 { 45 return array( 46 'function abc(...);', 47 'function abc(...)', 48 'abstract function abc(...);', 49 ); 50 51 }//end getPatterns() 52 53 54}//end class 55