Permalink
Browse files

Add rule.

  • Loading branch information...
sebastianbergmann committed Nov 11, 2011
1 parent 8be802d commit 15e117ee49db7dd6186dd98168db2c0fc781ed1e
View
@@ -105,7 +105,7 @@
<target name="phpcs"
description="Find coding standard violations using PHP_CodeSniffer">
<exec executable="phpcs">
- <arg value="--standard=${basedir}/build/phpcs.xml" />
+ <arg value="--standard=${basedir}/build/PHPCS" />
<arg value="--extensions=php" />
<arg value="--ignore=Autoload.php" />
<arg path="${basedir}/PHP" />
@@ -117,7 +117,7 @@
<exec executable="phpcs" output="/dev/null">
<arg value="--report=checkstyle" />
<arg value="--report-file=${basedir}/build/logs/checkstyle.xml" />
- <arg value="--standard=${basedir}/build/phpcs.xml" />
+ <arg value="--standard=${basedir}/build/PHPCS" />
<arg value="--extensions=php" />
<arg value="--ignore=Autoload.php" />
<arg path="${basedir}/PHP" />
@@ -0,0 +1,22 @@
+<?php
+class PHPCS_Sniffs_ControlStructures_ControlSignatureSniff extends PHP_CodeSniffer_Standards_AbstractPatternSniff
+{
+ public function __construct()
+ {
+ parent::__construct(true);
+ }
+
+ protected function getPatterns()
+ {
+ return array(
+ 'do {EOL...} while (...);EOL',
+ 'while (...) {EOL',
+ 'for (...) {EOL',
+ 'if (...) {EOL',
+ 'foreach (...) {EOL',
+ '}EOLelse if (...) {EOL',
+ '}EOLelse {EOL',
+ 'do {EOL',
+ );
+ }
+}
File renamed without changes.

0 comments on commit 15e117e

Please sign in to comment.