No Description

ControlSignatureSniff.php 530B

1234567891011121314151617181920212223
  1. <?php
  2. class PHPCS_Sniffs_ControlStructures_ControlSignatureSniff extends PHP_CodeSniffer_Standards_AbstractPatternSniff
  3. {
  4. public function __construct()
  5. {
  6. parent::__construct(true);
  7. }
  8. protected function getPatterns()
  9. {
  10. return array(
  11. 'do {EOL...} while (...);EOL',
  12. 'while (...) {EOL',
  13. 'for (...) {EOL',
  14. 'if (...) {EOL',
  15. 'foreach (...) {EOL',
  16. '}EOLelse if (...) {EOL',
  17. '}EOLelse {EOL',
  18. 'do {EOL',
  19. );
  20. }
  21. }