diff --git a/.editorconfig b/.editorconfig index ccb6cbf..e165a55 100644 --- a/.editorconfig +++ b/.editorconfig @@ -10,3 +10,6 @@ indent_size = 4 [Makefile] indent_style = tab + +[*.yml] +indent_size = 2 diff --git a/.flintci.yml b/.flintci.yml deleted file mode 100644 index 097fa60..0000000 --- a/.flintci.yml +++ /dev/null @@ -1,2 +0,0 @@ -services: - phpcsfixer: true diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..621f038 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,105 @@ +name: CI + +on: + pull_request: + push: + branches: + - master + workflow_dispatch: + +jobs: + testsuite: + runs-on: ubuntu-22.04 + strategy: + fail-fast: false + matrix: + php-version: ['7.4', '8.2'] + + steps: + - uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-version }} + extensions: mbstring, intl, bcmath + coverage: pcov + + - name: Composer install + run: | + composer --version + composer install + + - name: Run PHPUnit + run: | + if [[ ${{ matrix.php-version }} == '7.4' ]]; then + vendor/bin/phpunit --coverage-clover=coverage.xml + else + vendor/bin/phpunit + fi + + - name: Code Coverage Report + if: success() && matrix.php-version == '7.4' + uses: codecov/codecov-action@v1 + + validation: + name: Coding Standard & Static Analysis + runs-on: ubuntu-22.04 + + steps: + - uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '7.4' + extensions: mbstring, intl, bcmath + coverage: none + + - name: Composer Install + run: composer install + + - name: Run phpstan + run: composer stan-setup && vendor/bin/phpstan analyse --error-format=github + + - name: Run phpcs + run: composer cs-check + + prefer-lowest: + runs-on: ubuntu-22.04 + strategy: + fail-fast: false + matrix: + php-version: [ + '7.4' + ] + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-version }} + extensions: mbstring, intl, bcmath + coverage: none + + - name: Get Composer Cache Directory + id: composer-cache + run: | + echo "::set-output name=dir::$(composer config cache-files-dir)" + - name: Composer cache + uses: actions/cache@v2 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + restore-keys: ${{ runner.os }}-composer- + + - name: Composer prefer-lowest + run: | + composer update --prefer-dist --no-interaction --prefer-lowest --prefer-stable + + - name: Run PHPUnit + run: | + vendor/bin/phpunit diff --git a/.gitignore b/.gitignore index e2bb016..c06d5e3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ -/.php_cs.cache -/.phpunit.result.cache -/composer.lock -/vendor +.php_cs.cache +.phpunit.result.cache +composer.lock +vendor/ *.phar diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 08832e1..0000000 --- a/.travis.yml +++ /dev/null @@ -1,52 +0,0 @@ -branches: - only: - - master - -language: php - -dist: trusty - -php: - - 7.4 - - 8.0 - - nightly - -env: - global: - - PATH="$HOME/.composer/vendor/bin:$PATH" - -matrix: - fast_finish: true - include: - - php: 7.4 - env: COMPOSER_FLAGS="--prefer-lowest" - - php: 7.4 - env: COMPOSER_VERSION=1.* - - php: 8.0 - env: COMPOSER_VERSION=2.*@dev - - php: 8.0 - env: COMPOSER_VERSION=dev-master - allow_failures: - - php: nightly - - env: COMPOSER_VERSION=dev-master - -sudo: false - -cache: - directories: - - $HOME/.composer/cache/files - -before_install: - - echo "memory_limit=4096M" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini - - composer global require 'phpunit/phpunit:>=4.0, <6' satooshi/php-coveralls:@stable codeclimate/php-test-reporter:@stable --no-update - - if [ "$COMPOSER_VERSION" != "" ]; then composer require "composer/composer:${COMPOSER_VERSION}" --no-update; fi; - -install: - - composer global update --prefer-dist --no-interaction - - composer update --prefer-dist --no-interaction $COMPOSER_FLAGS - -script: phpunit -c phpunit.xml.dist --coverage-clover build/logs/clover.xml - -after_script: - - coveralls -v - - test-reporter diff --git a/CHANGELOG.md b/CHANGELOG.md index f4e5769..9e17cde 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,44 +1,4 @@ # CHANGELOG -* 2.0.5 (2021-12-07) - - * PHP 8 support - -* 2.0.4 (2020-05-05) - - * Composer v2 support - -* 2.0.3 (2017-06-16) - - * Fix wrong outdated output on aliased packages. - -* 2.0.2 (2016-04-29) - - * Remove composer compatibility check. - -* 2.0.1 (2016-04-26) - - * Fix `UnexpectedValueException` with `Semver::satisfies` issue - try to update with `--no-plugins` to get this new version. - -* 2.0.0 (2016-04-19) - - * Composer version compatibility check. - * Remove composer BC version compare method. - * Disable `show-links` option by default. - -* 1.1.0 (2016-04-19) - - * More tiny and sexy outdated output words. - * Outdated packages number on output. - * Show outdated packages links if exist. - -* 1.0.2 (2015-10-12) - - * Align output indent to Composer. - * Plugin disabled with --prefer-lowest option. - -* 1.0.1 (2015-10-06) - - * Cross-platform newline character support. - * Fix composer versions without `composer/semver` enabled. +Coming from original `sllh/composer-versions-check` v1 or v2: +- Use this in v1 now. diff --git a/README.md b/README.md index 83d40e5..739f7fd 100644 --- a/README.md +++ b/README.md @@ -1,24 +1,15 @@ # composer-versions-check -composer-versions-check is a plugin for Composer. +A plugin for Composer. It warns user for outdated packages from last major versions after update command. -It warns user for outdated packages from last major versions after update command. +[![Latest Stable Version](https://poser.pugx.org/dereuromark/composer-versions-check/v/stable)](https://packagist.org/packages/dereuromark/composer-versions-check) +[![License](https://poser.pugx.org/dereuromark/composer-versions-check/license)](https://packagist.org/packages/dereuromark/composer-versions-check) -[![Latest Stable Version](https://poser.pugx.org/sllh/composer-versions-check/v/stable)](https://packagist.org/packages/sllh/composer-versions-check) -[![Latest Unstable Version](https://poser.pugx.org/sllh/composer-versions-check/v/unstable)](https://packagist.org/packages/sllh/composer-versions-check) -[![License](https://poser.pugx.org/sllh/composer-versions-check/license)](https://packagist.org/packages/sllh/composer-versions-check) -[![Dependency Status](https://www.versioneye.com/php/sllh:composer-versions-check/badge.svg)](https://www.versioneye.com/php/sllh:composer-versions-check) -[![Reference Status](https://www.versioneye.com/php/sllh:composer-versions-check/reference_badge.svg)](https://www.versioneye.com/php/sllh:composer-versions-check/references) - -[![Total Downloads](https://poser.pugx.org/sllh/composer-versions-check/downloads)](https://packagist.org/packages/sllh/composer-versions-check) -[![Monthly Downloads](https://poser.pugx.org/sllh/composer-versions-check/d/monthly)](https://packagist.org/packages/sllh/composer-versions-check) -[![Daily Downloads](https://poser.pugx.org/sllh/composer-versions-check/d/daily)](https://packagist.org/packages/sllh/composer-versions-check) +[![Total Downloads](https://poser.pugx.org/dereuromark/composer-versions-check/downloads)](https://packagist.org/packages/dereuromark/composer-versions-check) +[![Monthly Downloads](https://poser.pugx.org/dereuromark/composer-versions-check/d/monthly)](https://packagist.org/packages/dereuromark/composer-versions-check) +[![Daily Downloads](https://poser.pugx.org/dereuromark/composer-versions-check/d/daily)](https://packagist.org/packages/dereuromark/composer-versions-check) [![Build Status](https://travis-ci.org/Soullivaneuh/composer-versions-check.svg?branch=master)](https://travis-ci.org/Soullivaneuh/composer-versions-check) -[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/Soullivaneuh/composer-versions-check/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/Soullivaneuh/composer-versions-check/?branch=master) -[![Code Climate](https://codeclimate.com/github/Soullivaneuh/composer-versions-check/badges/gpa.svg)](https://codeclimate.com/github/Soullivaneuh/composer-versions-check) -[![Coverage Status](https://coveralls.io/repos/Soullivaneuh/composer-versions-check/badge.svg?branch=master)](https://coveralls.io/r/Soullivaneuh/composer-versions-check?branch=master) -[![SensioLabsInsight](https://insight.sensiolabs.com/projects/278a8379-fb6d-425f-b175-7d7b9ef93d47/mini.png)](https://insight.sensiolabs.com/projects/278a8379-fb6d-425f-b175-7d7b9ef93d47) ![composer-versions-check_demo](https://cloud.githubusercontent.com/assets/1698357/14637529/2e32a778-0632-11e6-99c7-0e1c284a7436.gif) @@ -29,13 +20,13 @@ It warns user for outdated packages from last major versions after update comman You can install it either globally (recommended): ```bash -composer global require sllh/composer-versions-check +composer global require dereuromark/composer-versions-check ``` or locally (as require-dev dependency then): ```bash -composer require --dev sllh/composer-versions-check +composer require --dev dereuromark/composer-versions-check ``` ## Usage @@ -51,7 +42,7 @@ You can configure the plugin via the [`COMPOSER_HOME/config.json`](https://getco ```json { "config": { - "sllh-composer-versions-check": { + "dereuromark-composer-versions-check": { "show-links": false } } diff --git a/UPGRADE-2.0.md b/UPGRADE-2.0.md deleted file mode 100644 index 661457e..0000000 --- a/UPGRADE-2.0.md +++ /dev/null @@ -1,14 +0,0 @@ -# Upgrade from 1.x to 2.0 - -## Version requirement - -Composer 1.0 is now the minimum requirement to get the plugin working. - -## Code removal - -`SLLH\ComposerVersionsCheck\VersionsCheck::versionCompare` method is removed. -This method was here for BC and should never be used externally. - -## Default options changes - -`show-links` option is now disabled by default. diff --git a/composer.json b/composer.json index 8747b1f..2eba160 100644 --- a/composer.json +++ b/composer.json @@ -11,29 +11,30 @@ } ], "require": { - "php": "^7.4 || ^8.0", + "php": ">=7.4", "composer-plugin-api": "^2.0", "composer/semver": "^3.2.5", - "symfony/console": "^3.4 || ^4.4 || ^5.0" + "symfony/console": "^4.4 || ^5.3 || ^6.0" }, "require-dev": { "composer/composer": "^2.0", + "phpunit/phpunit": "9.6.5", "symfony/phpunit-bridge": "^5.3.3" }, "autoload": { "psr-4": { - "SLLH\\ComposerVersionsCheck\\": "src/" + "ComposerVersionsCheck\\": "src/" } }, "autoload-dev": { "psr-4": { - "SLLH\\ComposerVersionsCheck\\Tests\\": "tests/" + "ComposerVersionsCheck\\Tests\\": "tests/" } }, "extra": { - "class": "SLLH\\ComposerVersionsCheck\\VersionsCheckPlugin", + "class": "ComposerVersionsCheck\\VersionsCheckPlugin", "branch-alias": { - "dev-master": "2.x-dev" + "dev-master": "1.x-dev" } } } diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 920b929..2ecbb41 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -17,13 +17,13 @@ - ./tests/ + tests/ - ./src + src/ diff --git a/src/OutdatedPackage.php b/src/OutdatedPackage.php index 5aafb90..cd5ba00 100644 --- a/src/OutdatedPackage.php +++ b/src/OutdatedPackage.php @@ -1,6 +1,6 @@ */ -final class OutdatedPackage +class OutdatedPackage { /** * @var PackageInterface diff --git a/src/VersionsCheck.php b/src/VersionsCheck.php index 8d56142..6776cad 100644 --- a/src/VersionsCheck.php +++ b/src/VersionsCheck.php @@ -1,6 +1,6 @@ */ -final class VersionsCheck +class VersionsCheck { /** * @var OutdatedPackage[] diff --git a/src/VersionsCheckPlugin.php b/src/VersionsCheckPlugin.php index 7a3a0a4..95fa2a0 100644 --- a/src/VersionsCheckPlugin.php +++ b/src/VersionsCheckPlugin.php @@ -1,6 +1,6 @@ */ -final class VersionsCheckPlugin implements PluginInterface, EventSubscriberInterface +class VersionsCheckPlugin implements PluginInterface, EventSubscriberInterface { /** * @var Composer diff --git a/tests/OutdatedPackageTest.php b/tests/OutdatedPackageTest.php index fb027be..3ef6dd9 100644 --- a/tests/OutdatedPackageTest.php +++ b/tests/OutdatedPackageTest.php @@ -1,11 +1,11 @@ diff --git a/tests/VersionsCheckPluginTest.php b/tests/VersionsCheckPluginTest.php index b41306b..0813180 100644 --- a/tests/VersionsCheckPluginTest.php +++ b/tests/VersionsCheckPluginTest.php @@ -1,6 +1,6 @@