Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added first working version of the standard

  • Loading branch information...
commit e35266a167111679e87603df1e26db180e79271a 0 parents
@denderello denderello authored
42 PHP/CodeSniffer/Standards/Symfony/Sniffs/WhiteSpace/ScopeIndentSniff.php
@@ -0,0 +1,42 @@
+<?php
+/**
+ * Generic_Sniffs_Whitespace_ScopeIndentSniff.
+ *
+ * PHP version 5
+ *
+ * @category PHP
+ * @package PHP_CodeSniffer
+ * @author Greg Sherwood <gsherwood@squiz.net>
+ * @author Marc McIntyre <mmcintyre@squiz.net>
+ * @copyright 2006 Squiz Pty Ltd (ABN 77 084 670 600)
+ * @license http://matrix.squiz.net/developer/tools/php_cs/licence BSD Licence
+ * @version CVS: $Id: ScopeIndentSniff.php 270281 2008-12-02 02:38:34Z squiz $
+ * @link http://pear.php.net/package/PHP_CodeSniffer
+ */
+
+/**
+ * Generic_Sniffs_Whitespace_ScopeIndentSniff.
+ *
+ * Checks that control structures are structured correctly, and their content
+ * is indented correctly. This sniff will throw errors if tabs are used
+ * for indentation rather than spaces.
+ *
+ * @category PHP
+ * @package PHP_CodeSniffer
+ * @author Greg Sherwood <gsherwood@squiz.net>
+ * @author Marc McIntyre <mmcintyre@squiz.net>
+ * @copyright 2006 Squiz Pty Ltd (ABN 77 084 670 600)
+ * @license http://matrix.squiz.net/developer/tools/php_cs/licence BSD Licence
+ * @version Release: 1.2.2
+ * @link http://pear.php.net/package/PHP_CodeSniffer
+ */
+class Symfony_Sniffs_WhiteSpace_ScopeIndentSniff extends Generic_Sniffs_WhiteSpace_ScopeIndentSniff
+{
+
+ /**
+ * The number of spaces code should be indented.
+ *
+ * @var int
+ */
+ protected $indent = 2;
+}
48 PHP/CodeSniffer/Standards/Symfony/SymfonyCodingStandard.php
@@ -0,0 +1,48 @@
+<?php
+/**
+ * Symfony Coding Standard.
+ *
+ * PHP version 5
+ *
+ * @category PHP
+ * @package PHP_CodeSniffer
+ * @author Dennis Benkert <spinecrasher@googlemail.com>
+ * @license http://matrix.squiz.net/developer/tools/php_cs/licence BSD Licence
+ * @version CVS: $Id$
+ * @link http://pear.php.net/package/PHP_CodeSniffer
+ */
+
+if (class_exists('PHP_CodeSniffer_Standards_CodingStandard', true) === false) {
+ throw new PHP_CodeSniffer_Exception('Class PHP_CodeSniffer_Standards_CodingStandard not found');
+}
+
+/**
+ * Symfony Coding Standard.
+ *
+ * @category PHP
+ * @package PHP_CodeSniffer
+ * @author Dennis Benkert <spinecrasher@googlemail.com>
+ * @license http://matrix.squiz.net/developer/tools/php_cs/licence BSD Licence
+ * @version Release: @release_version@
+ * @link http://pear.php.net/package/PHP_CodeSniffer
+ */
+class PHP_CodeSniffer_Standards_Symfony_SymfonyCodingStandard extends PHP_CodeSniffer_Standards_CodingStandard
+{
+ /**
+ * Return a list of external sniffs to include with this standard.
+ *
+ * The PEAR standard uses some generic sniffs.
+ *
+ * @return array
+ */
+ public function getIncludedSniffs()
+ {
+ return array(
+ 'Generic/Sniffs/WhiteSpace/DisallowTabIndentSniff.php',
+ 'Symfony/Sniffs/WhiteSpace/ScopeIndentSniff.php',
+ 'Generic/Sniffs/Functions/OpeningFunctionBraceBsdAllmanSniff.php'
+ );
+ }
+}
+
+?>
Please sign in to comment.
Something went wrong with that request. Please try again.