diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..2af4c7d5d3df8c5adb174d477e0e9e26e9b113cf --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,49 @@ +stages: + - test + +cache: + paths: + - vendor/ + +before_script: + - apt-get update; apt-get install -y zip unzip + - composer install --optimize-autoloader --no-interaction --no-ansi --prefer-dist + +lint:coding-guideline: + image: tetraweb/php:7.0 + stage: test + script: + - mkdir result + - ./vendor/bin/phpcs -s -n --report-full=result/phpcs-full.txt --report-diff=result/phpcs-diff.txt --report-summary=result/phpcs-summary.txt + artifacts: + when: on_failure + paths: + - result +test:5.3: &PHP-UNITTESTING + image: tetraweb/php:5.3 + stage: test + tags: + - docker + variables: + TIMEZONE: "Europe/Berlin" + WITH_XDEBUG: "true" + script: + - ./vendor/bin/phpunit --coverage-text --colors=never +test:5.4: + <<: *PHP-UNITTESTING + image: tetraweb/php:5.4 +test:5.5: + <<: *PHP-UNITTESTING + image: tetraweb/php:5.5 +test:5.6: + <<: *PHP-UNITTESTING + image: tetraweb/php:5.6 +test:7.0: + <<: *PHP-UNITTESTING + image: tetraweb/php:7.0 +test:7.1: + <<: *PHP-UNITTESTING + image: tetraweb/php:7.1 +test:latest: + <<: *PHP-UNITTESTING + image: tetraweb/php:latest diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 2977bae8c36b7d9b939cc66dea970eb1453c5df3..0000000000000000000000000000000000000000 --- a/.travis.yml +++ /dev/null @@ -1,19 +0,0 @@ -language: php - -cache: - directories: - - $HOME/.composer/cache - -php: - - '5.3' - - '5.4' - - '5.5' - - '5.6' - - '7.0' - - '7.1' - -install: - - 'composer install --prefer-dist' - -script: - - 'php vendor/bin/phpunit -c phpunit.xml.dist' diff --git a/README.md b/README.md index 0f0a8519aff0ea697fd26588b5f4ecc64237f090..ea759577018679bf4c7fbcf17a0bb2fad0737ebe 100644 --- a/README.md +++ b/README.md @@ -3,24 +3,36 @@ About Composer plugin installs [PHP_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer) Standards. -[](https://travis-ci.org/higidi/composer-phpcodesniffer-standards-plugin) [](https://packagist.org/packages/higidi/composer-phpcodesniffer-standards-plugin) [](https://packagist.org/packages/higidi/composer-phpcodesniffer-standards-plugin) [](https://packagist.org/packages/higidi/composer-phpcodesniffer-standards-plugin) +[](https://git.higidi.com/higidi/composer-phpcodesniffer-standards-plugin/commits/master) [](https://git.higidi.com/higidi/composer-phpcodesniffer-standards-plugin/commits/master) [](https://packagist.org/packages/higidi/composer-phpcodesniffer-standards-plugin) [](https://packagist.org/packages/higidi/composer-phpcodesniffer-standards-plugin) [](https://packagist.org/packages/higidi/composer-phpcodesniffer-standards-plugin) Requirements ------------ -_TODO_ +- `PHP >= 5.3.3` +- Composer package providing the PHP CodeSniffer Rulesets & Sniffs Installation ------------ -_TODO_ +```bash +$ composer require higidi/composer-phpcodesniffer-standards-plugin +``` -Documentation -------------- +Change the type of your composer package to `php-codesniffer-standards` -_TODO_ +Your composer.json should looks like: +```json +{ + "name": "vendor/my-php-codesniffer-standards", + "description": "My codesniffer standards", + "type": "php-codesniffer-standards", + "require": { + "higidi/composer-phpcodesniffer-standards-plugin": "^1.0" + } +} +``` Issues ------ -Bug reports and feature requests can be submitted on the [Github Issue Tracker](https://github.com/higidi/composer-phpcodesniffer-standards-plugin/issues) +Bug reports and feature requests can be submitted on the [Issue Tracker](https://git.higidi.com/higidi/composer-phpcodesniffer-standards-plugin/issues) \ No newline at end of file diff --git a/composer.json b/composer.json index af6bb477851ed8d1ed519175addc814c46a3fa88..d7fd38f1e359f5829122ce8102d7e0b7514fac17 100644 --- a/composer.json +++ b/composer.json @@ -38,6 +38,9 @@ "phpunit/phpunit": "^4.5 || ^5.0.5" }, "extra": { - "class": "Higidi\\ComposerPhpCSStandardsPlugin\\Plugin" + "class": "Higidi\\ComposerPhpCSStandardsPlugin\\Plugin", + "branch-alias": { + "dev-master": "1.0.x-dev" + } } } diff --git a/src/Installer.php b/src/Installer.php index 7cf8ea424a2fc58d470a6bf0df070c3f4f7e0a5f..680097fdea342191068121ad1ceafb3e9dad270a 100644 --- a/src/Installer.php +++ b/src/Installer.php @@ -16,7 +16,7 @@ use Symfony\Component\Finder\Finder; class Installer extends LibraryInstaller { - const TYPE = 'php-codesniffer-standards'; + const TYPE = 'phpcodesniffer-standard'; /** * Initializes library installer. @@ -227,4 +227,16 @@ class Installer extends LibraryInstaller { return $this->getInstallPath($this->getPHPCodeSnifferPackage($repo)); } + + /** + * {@inheritDoc} + */ + public function supports($packageType) + { + $secondaryPackageTypes = array('phpcodesniffer-standards'); + $deprecatedPackageTypes = array('php-codesniffer-standards'); + + return parent::supports($packageType) + || in_array($packageType, array_merge($secondaryPackageTypes, $deprecatedPackageTypes)); + } }