diff --git a/.gitignore b/.gitignore index e21d1b2..abb9c75 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,3 @@ -/.idea /vendor /composer.lock - /phpunit.xml -/Tests/Build diff --git a/.travis.yml b/.travis.yml index 0adc31f..0bb6a36 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,10 +3,16 @@ php: - 5.4 - 5.5 - 5.6 + - 7.0 + - hhvm + +matrix: + allow_failures: + - php: hhvm + - php: 7.0 + before_script: - - $TRAVIS_BUILD_DIR/travis.sh - - cd $TRAVIS_BUILD_DIR/../Ongr/ - - composer self-update - - composer update --prefer-source + - composer install + script: - - vendor/bin/phpunit Tests/AllTests.php + - vendor/bin/phpunit diff --git a/Sniffs/Arrays/ArrayDeclarationSniff.php b/Ongr/Sniffs/Arrays/ArrayDeclarationSniff.php similarity index 100% rename from Sniffs/Arrays/ArrayDeclarationSniff.php rename to Ongr/Sniffs/Arrays/ArrayDeclarationSniff.php diff --git a/Sniffs/Classes/ClassDeclarationSniff.php b/Ongr/Sniffs/Classes/ClassDeclarationSniff.php similarity index 100% rename from Sniffs/Classes/ClassDeclarationSniff.php rename to Ongr/Sniffs/Classes/ClassDeclarationSniff.php diff --git a/Sniffs/Commenting/BlockCommentSniff.php b/Ongr/Sniffs/Commenting/BlockCommentSniff.php similarity index 100% rename from Sniffs/Commenting/BlockCommentSniff.php rename to Ongr/Sniffs/Commenting/BlockCommentSniff.php diff --git a/Sniffs/Commenting/ClassCommentSniff.php b/Ongr/Sniffs/Commenting/ClassCommentSniff.php similarity index 100% rename from Sniffs/Commenting/ClassCommentSniff.php rename to Ongr/Sniffs/Commenting/ClassCommentSniff.php diff --git a/Ongr/Sniffs/Commenting/DocCommentAlignmentSniff.php b/Ongr/Sniffs/Commenting/DocCommentAlignmentSniff.php new file mode 100644 index 0000000..c262337 --- /dev/null +++ b/Ongr/Sniffs/Commenting/DocCommentAlignmentSniff.php @@ -0,0 +1,170 @@ + + * @author Marc McIntyre + * @copyright 2006-2014 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @link http://pear.php.net/package/PHP_CodeSniffer + */ + +/** + * Ongr_Sniffs_Commenting_DocCommentAlignmentSniff. + * + * Tests that the stars in a doc comment align correctly. + * + * @category PHP + * @package PHP_CodeSniffer + * @author Greg Sherwood + * @author Marc McIntyre + * @copyright 2006-2014 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @version Release: @package_version@ + * @link http://pear.php.net/package/PHP_CodeSniffer + */ +class Ongr_Sniffs_Commenting_DocCommentAlignmentSniff implements PHP_CodeSniffer_Sniff +{ + + /** + * A list of tokenizers this sniff supports. + * + * @var array + */ + public $supportedTokenizers = array( + 'PHP', + 'JS', + ); + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return array(T_DOC_COMMENT_OPEN_TAG); + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @param PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current token + * in the stack passed in $tokens. + * + * @return void + */ + public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + // We are only interested in function/class/interface doc block comments. + $ignore = PHP_CodeSniffer_Tokens::$emptyTokens; + if ($phpcsFile->tokenizerType === 'JS') { + $ignore[] = T_EQUAL; + $ignore[] = T_STRING; + $ignore[] = T_OBJECT_OPERATOR; + } + + $nextToken = $phpcsFile->findNext($ignore, ($stackPtr + 1), null, true); + $ignore = array( + T_CLASS => true, + T_INTERFACE => true, + T_FUNCTION => true, + T_PUBLIC => true, + T_PRIVATE => true, + T_PROTECTED => true, + T_STATIC => true, + T_ABSTRACT => true, + T_PROPERTY => true, + T_OBJECT => true, + T_PROTOTYPE => true, + ); + + if (isset($ignore[$tokens[$nextToken]['code']]) === false) { + // Could be a file comment. + $prevToken = $phpcsFile->findPrevious(PHP_CodeSniffer_Tokens::$emptyTokens, ($stackPtr - 1), null, true); + if ($tokens[$prevToken]['code'] !== T_OPEN_TAG) { + return; + } + } + + // There must be one space after each star (unless it is an empty comment line) + // and all the stars must be aligned correctly. + $requiredColumn = ($tokens[$stackPtr]['column'] + 1); + $endComment = $tokens[$stackPtr]['comment_closer']; + for ($i = ($stackPtr + 1); $i <= $endComment; $i++) { + if ($tokens[$i]['code'] !== T_DOC_COMMENT_STAR + && $tokens[$i]['code'] !== T_DOC_COMMENT_CLOSE_TAG + ) { + continue; + } + + if ($tokens[$i]['code'] === T_DOC_COMMENT_CLOSE_TAG) { + // Can't process the close tag if it is not the first thing on the line. + $prev = $phpcsFile->findPrevious(T_DOC_COMMENT_WHITESPACE, ($i - 1), $stackPtr, true); + if ($tokens[$prev]['line'] === $tokens[$i]['line']) { + continue; + } + } + + if ($tokens[$i]['column'] !== $requiredColumn) { + $error = 'Expected %s space(s) before asterisk; %s found'; + $data = array( + ($requiredColumn - 1), + ($tokens[$i]['column'] - 1), + ); + $fix = $phpcsFile->addFixableError($error, $i, 'SpaceBeforeStar', $data); + if ($fix === true) { + $padding = str_repeat(' ', ($requiredColumn - 1)); + if ($tokens[$i]['column'] === 1) { + $phpcsFile->fixer->addContentBefore($i, $padding); + } else { + $phpcsFile->fixer->replaceToken(($i - 1), $padding); + } + } + } + + if ($tokens[$i]['code'] !== T_DOC_COMMENT_STAR) { + continue; + } + + if ($tokens[($i + 2)]['line'] !== $tokens[$i]['line']) { + // Line is empty. + continue; + } + //ONGR get last character on previous line. + $lastVarEnding = substr($tokens[$i - 3]['content'], -1); + if ($tokens[($i + 1)]['code'] !== T_DOC_COMMENT_WHITESPACE) { + $error = 'Expected 1 space after asterisk; 0 found'; + $fix = $phpcsFile->addFixableError($error, $i, 'NoSpaceAfterStar'); + if ($fix === true) { + $phpcsFile->fixer->addContent($i, ' '); + } + } else if ($tokens[($i + 2)]['code'] === T_DOC_COMMENT_TAG + && $tokens[($i + 1)]['content'] !== ' ' + //ONGR we allow more spaces after asterisk if tags represented as in array. + && $lastVarEnding !== '{' + && $lastVarEnding !== ',' + ) { + $error = 'Expected 1 space after asterisk; %s found 1 '.$lastVarEnding; + $data = array(strlen($tokens[($i + 1)]['content'])); + $fix = $phpcsFile->addFixableError($error, $i, 'SpaceAfterStar', $data); + if ($fix === true) { + $phpcsFile->fixer->replaceToken(($i + 1), ' '); + } + } + }//end for + + }//end process() + + +}//end class diff --git a/Sniffs/Commenting/FunctionCommentSniff.php b/Ongr/Sniffs/Commenting/FunctionCommentSniff.php similarity index 100% rename from Sniffs/Commenting/FunctionCommentSniff.php rename to Ongr/Sniffs/Commenting/FunctionCommentSniff.php diff --git a/Sniffs/Commenting/InlineCommentSniff.php b/Ongr/Sniffs/Commenting/InlineCommentSniff.php similarity index 100% rename from Sniffs/Commenting/InlineCommentSniff.php rename to Ongr/Sniffs/Commenting/InlineCommentSniff.php diff --git a/Sniffs/Commenting/VariableCommentSniff.php b/Ongr/Sniffs/Commenting/VariableCommentSniff.php similarity index 100% rename from Sniffs/Commenting/VariableCommentSniff.php rename to Ongr/Sniffs/Commenting/VariableCommentSniff.php diff --git a/Sniffs/ControlStructures/InlineIfDeclarationSniff.php b/Ongr/Sniffs/ControlStructures/InlineIfDeclarationSniff.php similarity index 100% rename from Sniffs/ControlStructures/InlineIfDeclarationSniff.php rename to Ongr/Sniffs/ControlStructures/InlineIfDeclarationSniff.php diff --git a/Sniffs/ControlStructures/SwitchDeclarationSniff.php b/Ongr/Sniffs/ControlStructures/SwitchDeclarationSniff.php similarity index 100% rename from Sniffs/ControlStructures/SwitchDeclarationSniff.php rename to Ongr/Sniffs/ControlStructures/SwitchDeclarationSniff.php diff --git a/Sniffs/NamingConventions/AbstractClassPrefixSniff.php b/Ongr/Sniffs/NamingConventions/AbstractClassPrefixSniff.php similarity index 100% rename from Sniffs/NamingConventions/AbstractClassPrefixSniff.php rename to Ongr/Sniffs/NamingConventions/AbstractClassPrefixSniff.php diff --git a/Sniffs/NamingConventions/TraitSuffixSniff.php b/Ongr/Sniffs/NamingConventions/TraitSuffixSniff.php similarity index 100% rename from Sniffs/NamingConventions/TraitSuffixSniff.php rename to Ongr/Sniffs/NamingConventions/TraitSuffixSniff.php diff --git a/Sniffs/NamingConventions/ValidVariableNameSniff.php b/Ongr/Sniffs/NamingConventions/ValidVariableNameSniff.php similarity index 100% rename from Sniffs/NamingConventions/ValidVariableNameSniff.php rename to Ongr/Sniffs/NamingConventions/ValidVariableNameSniff.php diff --git a/Sniffs/PHP/DisallowMultipleAssignmentsSniff.php b/Ongr/Sniffs/PHP/DisallowMultipleAssignmentsSniff.php similarity index 100% rename from Sniffs/PHP/DisallowMultipleAssignmentsSniff.php rename to Ongr/Sniffs/PHP/DisallowMultipleAssignmentsSniff.php diff --git a/Sniffs/Strings/DoubleQuoteUsageSniff.php b/Ongr/Sniffs/Strings/DoubleQuoteUsageSniff.php similarity index 100% rename from Sniffs/Strings/DoubleQuoteUsageSniff.php rename to Ongr/Sniffs/Strings/DoubleQuoteUsageSniff.php diff --git a/Sniffs/Symfony/BlankLineBeforeReturnSniff.php b/Ongr/Sniffs/Symfony/BlankLineBeforeReturnSniff.php similarity index 100% rename from Sniffs/Symfony/BlankLineBeforeReturnSniff.php rename to Ongr/Sniffs/Symfony/BlankLineBeforeReturnSniff.php diff --git a/Sniffs/WhiteSpace/ControlStructureSpacingSniff.php b/Ongr/Sniffs/WhiteSpace/ControlStructureSpacingSniff.php similarity index 100% rename from Sniffs/WhiteSpace/ControlStructureSpacingSniff.php rename to Ongr/Sniffs/WhiteSpace/ControlStructureSpacingSniff.php diff --git a/Sniffs/WhiteSpace/FunctionClosingBraceSpaceSniff.php b/Ongr/Sniffs/WhiteSpace/FunctionClosingBraceSpaceSniff.php similarity index 100% rename from Sniffs/WhiteSpace/FunctionClosingBraceSpaceSniff.php rename to Ongr/Sniffs/WhiteSpace/FunctionClosingBraceSpaceSniff.php diff --git a/Sniffs/WhiteSpace/FunctionSpacingSniff.php b/Ongr/Sniffs/WhiteSpace/FunctionSpacingSniff.php similarity index 100% rename from Sniffs/WhiteSpace/FunctionSpacingSniff.php rename to Ongr/Sniffs/WhiteSpace/FunctionSpacingSniff.php diff --git a/Sniffs/WhiteSpace/MemberVarSpacingSniff.php b/Ongr/Sniffs/WhiteSpace/MemberVarSpacingSniff.php similarity index 100% rename from Sniffs/WhiteSpace/MemberVarSpacingSniff.php rename to Ongr/Sniffs/WhiteSpace/MemberVarSpacingSniff.php diff --git a/Sniffs/WhiteSpace/NamespaceSpacingSniff.php b/Ongr/Sniffs/WhiteSpace/NamespaceSpacingSniff.php similarity index 100% rename from Sniffs/WhiteSpace/NamespaceSpacingSniff.php rename to Ongr/Sniffs/WhiteSpace/NamespaceSpacingSniff.php diff --git a/Sniffs/WhiteSpace/OperatorSpacingSniff.php b/Ongr/Sniffs/WhiteSpace/OperatorSpacingSniff.php similarity index 100% rename from Sniffs/WhiteSpace/OperatorSpacingSniff.php rename to Ongr/Sniffs/WhiteSpace/OperatorSpacingSniff.php diff --git a/Sniffs/WhiteSpace/PHPOpenTagSniff.php b/Ongr/Sniffs/WhiteSpace/PHPOpenTagSniff.php similarity index 100% rename from Sniffs/WhiteSpace/PHPOpenTagSniff.php rename to Ongr/Sniffs/WhiteSpace/PHPOpenTagSniff.php diff --git a/Tests/AbstractSniffUnitTest.php b/Ongr/Tests/AbstractSniffUnitTest.php similarity index 100% rename from Tests/AbstractSniffUnitTest.php rename to Ongr/Tests/AbstractSniffUnitTest.php diff --git a/Tests/AllSniffs.php b/Ongr/Tests/AllSniffs.php similarity index 97% rename from Tests/AllSniffs.php rename to Ongr/Tests/AllSniffs.php index a74f569..a46139e 100644 --- a/Tests/AllSniffs.php +++ b/Ongr/Tests/AllSniffs.php @@ -61,7 +61,7 @@ public static function main() public static function suite() { $suite = new PHPUnit_Framework_TestSuite('PHP CodeSniffer Standards'); - $baseDir = pathinfo(getcwd(), PATHINFO_DIRNAME); + $baseDir = pathinfo(getcwd()."/Ongr", PATHINFO_DIRNAME); \PHP_CodeSniffer::setConfigData('installed_paths', $baseDir); $path = pathinfo(\PHP_CodeSniffer::getInstalledStandardPath('Ongr'), PATHINFO_DIRNAME); diff --git a/Tests/AllTests.php b/Ongr/Tests/AllTests.php similarity index 100% rename from Tests/AllTests.php rename to Ongr/Tests/AllTests.php diff --git a/Tests/TestSuite.php b/Ongr/Tests/TestSuite.php similarity index 100% rename from Tests/TestSuite.php rename to Ongr/Tests/TestSuite.php diff --git a/Tests/Unit/Arrays/ArrayDeclarationSniffTest.php b/Ongr/Tests/Unit/Arrays/ArrayDeclarationSniffTest.php similarity index 100% rename from Tests/Unit/Arrays/ArrayDeclarationSniffTest.php rename to Ongr/Tests/Unit/Arrays/ArrayDeclarationSniffTest.php diff --git a/Tests/Unit/Arrays/ArrayDeclarationSniffTest.phptest b/Ongr/Tests/Unit/Arrays/ArrayDeclarationSniffTest.phptest similarity index 100% rename from Tests/Unit/Arrays/ArrayDeclarationSniffTest.phptest rename to Ongr/Tests/Unit/Arrays/ArrayDeclarationSniffTest.phptest diff --git a/Ongr/Tests/Unit/Commenting/DocCommentAlignmentSniffTest.php b/Ongr/Tests/Unit/Commenting/DocCommentAlignmentSniffTest.php new file mode 100644 index 0000000..f241f92 --- /dev/null +++ b/Ongr/Tests/Unit/Commenting/DocCommentAlignmentSniffTest.php @@ -0,0 +1,39 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Ongr\Tests\Unit\Commenting; + +use Ongr\Tests\AbstractSniffUnitTest; + +/** + * VariableCommentSniffTest class. + */ +class DocCommentAlignmentSniffTest extends AbstractSniffUnitTest +{ + /** + * {@inheritdoc} + */ + protected function getErrorList() + { + return [ + 43 => 1, + 54 => 1, + ]; + } + + /** + * {@inheritdoc} + */ + protected function getWarningList() + { + return []; + } +} diff --git a/Ongr/Tests/Unit/Commenting/DocCommentAlignmentSniffTest.phptest b/Ongr/Tests/Unit/Commenting/DocCommentAlignmentSniffTest.phptest new file mode 100644 index 0000000..6cb9b38 --- /dev/null +++ b/Ongr/Tests/Unit/Commenting/DocCommentAlignmentSniffTest.phptest @@ -0,0 +1,57 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Test; + +class DocCommentAlignmentSniffTest +{ + /** + * @var int + * + * @ORM\ManyToOne(targetEntity="FooBars") + * @ORM\JoinColumns({ + * @ORM\JoinColumn(name="BarID", referencedColumnName="Bar") + * }) + */ + public $foo; + + /** + * @var int + * + * @ORM\ManyToOne(targetEntity="FooBars") + * @ORM\JoinColumns({ + * @ORM\JoinColumn(name="BarID", referencedColumnName="Bar"), + * @ORM\JoinColumn(name="BarID", referencedColumnName="Bar") + * }) + */ + public $foo2; + + /** + * @var int + * + * @ORM\ManyToOne(targetEntity="FooBars") + * @ORM\JoinColumns({ + * @ORM\JoinColumn(name="BarID", referencedColumnName="Bar") + * @ORM\JoinColumn(name="BarID", referencedColumnName="Bar") + * }) + */ + public $foo3; + + /** + * @var int + * + * @ORM\ManyToOne(targetEntity="FooBars") + * @ORM\JoinColumns({ + * }) + * @ORM\JoinColumn(name="BarID", referencedColumnName="Bar") + */ + public $foo4; +} diff --git a/Tests/Unit/Commenting/FunctionCommentSniffTest.php b/Ongr/Tests/Unit/Commenting/FunctionCommentSniffTest.php similarity index 100% rename from Tests/Unit/Commenting/FunctionCommentSniffTest.php rename to Ongr/Tests/Unit/Commenting/FunctionCommentSniffTest.php diff --git a/Tests/Unit/Commenting/FunctionCommentSniffTest.phptest b/Ongr/Tests/Unit/Commenting/FunctionCommentSniffTest.phptest similarity index 100% rename from Tests/Unit/Commenting/FunctionCommentSniffTest.phptest rename to Ongr/Tests/Unit/Commenting/FunctionCommentSniffTest.phptest diff --git a/Tests/Unit/Commenting/VariableCommentSniffTest.php b/Ongr/Tests/Unit/Commenting/VariableCommentSniffTest.php similarity index 100% rename from Tests/Unit/Commenting/VariableCommentSniffTest.php rename to Ongr/Tests/Unit/Commenting/VariableCommentSniffTest.php diff --git a/Tests/Unit/Commenting/VariableCommentSniffTest.phptest b/Ongr/Tests/Unit/Commenting/VariableCommentSniffTest.phptest similarity index 100% rename from Tests/Unit/Commenting/VariableCommentSniffTest.phptest rename to Ongr/Tests/Unit/Commenting/VariableCommentSniffTest.phptest diff --git a/Tests/Unit/ControlStructures/SwitchDeclarationSniffTest.php b/Ongr/Tests/Unit/ControlStructures/SwitchDeclarationSniffTest.php similarity index 100% rename from Tests/Unit/ControlStructures/SwitchDeclarationSniffTest.php rename to Ongr/Tests/Unit/ControlStructures/SwitchDeclarationSniffTest.php diff --git a/Tests/Unit/ControlStructures/SwitchDeclarationSniffTest.phptest b/Ongr/Tests/Unit/ControlStructures/SwitchDeclarationSniffTest.phptest similarity index 100% rename from Tests/Unit/ControlStructures/SwitchDeclarationSniffTest.phptest rename to Ongr/Tests/Unit/ControlStructures/SwitchDeclarationSniffTest.phptest diff --git a/Tests/Unit/NamingConventions/AbstractClassPrefixSniffTest.php b/Ongr/Tests/Unit/NamingConventions/AbstractClassPrefixSniffTest.php similarity index 100% rename from Tests/Unit/NamingConventions/AbstractClassPrefixSniffTest.php rename to Ongr/Tests/Unit/NamingConventions/AbstractClassPrefixSniffTest.php diff --git a/Tests/Unit/NamingConventions/AbstractClassPrefixSniffTest.phptest b/Ongr/Tests/Unit/NamingConventions/AbstractClassPrefixSniffTest.phptest similarity index 100% rename from Tests/Unit/NamingConventions/AbstractClassPrefixSniffTest.phptest rename to Ongr/Tests/Unit/NamingConventions/AbstractClassPrefixSniffTest.phptest diff --git a/Tests/Unit/NamingConventions/TraitSuffixSniffTest.php b/Ongr/Tests/Unit/NamingConventions/TraitSuffixSniffTest.php similarity index 100% rename from Tests/Unit/NamingConventions/TraitSuffixSniffTest.php rename to Ongr/Tests/Unit/NamingConventions/TraitSuffixSniffTest.php diff --git a/Tests/Unit/NamingConventions/TraitSuffixSniffTest.phptest b/Ongr/Tests/Unit/NamingConventions/TraitSuffixSniffTest.phptest similarity index 100% rename from Tests/Unit/NamingConventions/TraitSuffixSniffTest.phptest rename to Ongr/Tests/Unit/NamingConventions/TraitSuffixSniffTest.phptest diff --git a/Tests/Unit/PHP/DisallowMultipleAssignmentsSniffTest.php b/Ongr/Tests/Unit/PHP/DisallowMultipleAssignmentsSniffTest.php similarity index 100% rename from Tests/Unit/PHP/DisallowMultipleAssignmentsSniffTest.php rename to Ongr/Tests/Unit/PHP/DisallowMultipleAssignmentsSniffTest.php diff --git a/Tests/Unit/PHP/DisallowMultipleAssignmentsSniffTest.phptest b/Ongr/Tests/Unit/PHP/DisallowMultipleAssignmentsSniffTest.phptest similarity index 100% rename from Tests/Unit/PHP/DisallowMultipleAssignmentsSniffTest.phptest rename to Ongr/Tests/Unit/PHP/DisallowMultipleAssignmentsSniffTest.phptest diff --git a/Tests/Unit/WhiteSpace/FunctionSpacingSniffTest.php b/Ongr/Tests/Unit/WhiteSpace/FunctionSpacingSniffTest.php similarity index 100% rename from Tests/Unit/WhiteSpace/FunctionSpacingSniffTest.php rename to Ongr/Tests/Unit/WhiteSpace/FunctionSpacingSniffTest.php diff --git a/Tests/Unit/WhiteSpace/FunctionSpacingSniffTest.phptest b/Ongr/Tests/Unit/WhiteSpace/FunctionSpacingSniffTest.phptest similarity index 100% rename from Tests/Unit/WhiteSpace/FunctionSpacingSniffTest.phptest rename to Ongr/Tests/Unit/WhiteSpace/FunctionSpacingSniffTest.phptest diff --git a/Tests/Unit/WhiteSpace/OperatorSpacingSniffTest.php b/Ongr/Tests/Unit/WhiteSpace/OperatorSpacingSniffTest.php similarity index 100% rename from Tests/Unit/WhiteSpace/OperatorSpacingSniffTest.php rename to Ongr/Tests/Unit/WhiteSpace/OperatorSpacingSniffTest.php diff --git a/Tests/Unit/WhiteSpace/OperatorSpacingSniffTest.phptest b/Ongr/Tests/Unit/WhiteSpace/OperatorSpacingSniffTest.phptest similarity index 100% rename from Tests/Unit/WhiteSpace/OperatorSpacingSniffTest.phptest rename to Ongr/Tests/Unit/WhiteSpace/OperatorSpacingSniffTest.phptest diff --git a/Tests/Unit/WhiteSpace/PHPOpenTagSniffTest.php b/Ongr/Tests/Unit/WhiteSpace/PHPOpenTagSniffTest.php similarity index 100% rename from Tests/Unit/WhiteSpace/PHPOpenTagSniffTest.php rename to Ongr/Tests/Unit/WhiteSpace/PHPOpenTagSniffTest.php diff --git a/Tests/Unit/WhiteSpace/PHPOpenTagSniffTest.phptest b/Ongr/Tests/Unit/WhiteSpace/PHPOpenTagSniffTest.phptest similarity index 100% rename from Tests/Unit/WhiteSpace/PHPOpenTagSniffTest.phptest rename to Ongr/Tests/Unit/WhiteSpace/PHPOpenTagSniffTest.phptest diff --git a/ruleset.xml b/Ongr/ruleset.xml similarity index 98% rename from ruleset.xml rename to Ongr/ruleset.xml index 70e5749..288baae 100644 --- a/ruleset.xml +++ b/Ongr/ruleset.xml @@ -51,6 +51,7 @@ + diff --git a/README.rst b/README.rst index 8fa53dc..0d9e88f 100644 --- a/README.rst +++ b/README.rst @@ -109,8 +109,8 @@ Composer: { "require-dev": { - "ongr/ongr-strict-standard": "~1.0", - "squizlabs/php_codesniffer": "~1" + "ongr/ongr-strict-standard": "2.*", + "squizlabs/php_codesniffer": "2.*" } } diff --git a/composer.json b/composer.json index 6a0e81e..17070c5 100644 --- a/composer.json +++ b/composer.json @@ -17,14 +17,13 @@ } ], "require": { - "php": ">=5.4" + "php": ">=5.4", + "squizlabs/php_codesniffer": "~2.0" }, "require-dev": { - "squizlabs/php_codesniffer": "~2.0", "phpunit/phpunit": "~4.2" }, - "target-dir": "Ongr", "autoload": { - "psr-0": {"Ongr\\": ""} + "psr-0": {"": "./"} } } diff --git a/phpunit.xml.dist b/phpunit.xml.dist index bc0906c..523f8a7 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -13,7 +13,7 @@ - Tests/AllTests.php + Ongr/Tests/AllTests.php @@ -21,14 +21,15 @@ ./ - ./Tests + ./Ongr/Tests ./vendor + - + diff --git a/travis.sh b/travis.sh deleted file mode 100755 index 9def0e8..0000000 --- a/travis.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -cd .. -mv $TRAVIS_BUILD_DIR $TRAVIS_BUILD_DIR/../Ongr/ -mkdir $TRAVIS_BUILD_DIR -cd $TRAVIS_BUILD_DIR/../Ongr/ -git clone https://github.com/ongr-io/ConnectionsBundle.git TmpConnectionsBundle -cd TmpConnectionsBundle -git checkout 43df7f8fbaacd47e63d17dc5b2aad6bc10857413 -cd ..