diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 82b59bf..327a824 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -61,36 +61,3 @@ jobs: echo "::group::Tests (w/ phar composer/composer)" COMPOSER_AUDIT_TEST_COMPOSER_BINARY=$(which composer) vendor/bin/simple-phpunit --verbose echo "::endgroup::" - # Verifies that the plugin entry point still parses on PHP 5.3, users of 5.3 - # cannot use this Composer plugin but at least it won't break their Composer. - legacy: - runs-on: ubuntu-latest - name: PHP 5.3 - steps: - - uses: actions/checkout@v2 - - uses: shivammathur/setup-php@d30ad8b1843ace22e6698ab99bbafaa747b6bd0d - with: - php-version: 5.3 - tools: composer:2.2 - coverage: none - - name: Syntax check - run: | - while read file; do - php -l "$file" - done < <(find src/Legacy -type f -name "*.php") - - name: Integration test - run: | - composer global config allow-plugins.cs278/composer-audit true - composer global config repositories.0 path "$(pwd)" - composer global require --ignore-platform-reqs symfony/yaml '~4.4' - composer global require --ignore-platform-reqs cs278/composer-audit '*@dev' - - set +e - composer global audit -vvv - result=$? - set -e - - if [ $result -ne 2 ]; then - echo "Expected audit command to exit with error code 2, got: ${result}" >&2 - exit 1 - fi diff --git a/composer.json b/composer.json index 4e6f3ef..2355fc3 100644 --- a/composer.json +++ b/composer.json @@ -11,8 +11,8 @@ ], "minimum-stability": "stable", "require": { - "php": ">= 7.1", - "composer-plugin-api": "^1.1 || ^2", + "php": ">= 7.2", + "composer-plugin-api": "^2", "symfony/yaml": "^4.4 || ^5 || ^6 || ^7" }, "require-dev": { @@ -35,6 +35,6 @@ "sort-packages": true }, "extra": { - "class": "Cs278\\ComposerAudit\\Legacy\\ComposerPlugin" + "class": "Cs278\\ComposerAudit\\ComposerPlugin" } } diff --git a/src/AdvisoriesInstallerV1.php b/src/AdvisoriesInstallerV1.php deleted file mode 100644 index 8bbc5ac..0000000 --- a/src/AdvisoriesInstallerV1.php +++ /dev/null @@ -1,29 +0,0 @@ -downloadManager = $downloadManager; - } - - protected function downloadAndInstall($targetDirectory, PackageInterface $package) - { - $this->downloadManager->download($package, $targetDirectory, false); - } -} diff --git a/src/Legacy/AuditNotCompatibleCommand.php b/src/Legacy/AuditNotCompatibleCommand.php deleted file mode 100644 index d389a61..0000000 --- a/src/Legacy/AuditNotCompatibleCommand.php +++ /dev/null @@ -1,47 +0,0 @@ -setName('security-audit'); - $this->setAliases(array('audit')); - $this->setDescription('Check packages for security advisories.'); - $this->addOption( - 'no-dev', - null, - InputOption::VALUE_NONE, - 'Disable checking of development dependencies.' - ); - $this->addOption( - 'update', - null, - InputOption::VALUE_NONE, - 'Update security advisory information if a new version is available.' - ); - } - - protected function execute(InputInterface $input, OutputInterface $output) - { - $output = $output instanceof ConsoleOutputInterface ? $output->getErrorOutput() : $output; - - $output->writeln(sprintf('Composer Audit is not compatible with PHP %s', PHP_VERSION)); - - return 2; - } -} diff --git a/src/Legacy/CommandProvider.php b/src/Legacy/CommandProvider.php deleted file mode 100644 index 7b2e161..0000000 --- a/src/Legacy/CommandProvider.php +++ /dev/null @@ -1,18 +0,0 @@ -= 70100) { - \class_alias(substr(__NAMESPACE__, 0, strrpos(__NAMESPACE__, '\\')).'\\ComposerPlugin', __NAMESPACE__.'\\ComposerPlugin'); - } else { - /** - * Composer Audit Plugin declaration. - * - * @internal This class is used when loading the plugin with PHP < 7.1. - */ - final class ComposerPlugin implements PluginInterface, Capable - { - public function activate(Composer $composer, IOInterface $io) - { - - } - - public function deactivate(Composer $composer, IOInterface $io) - { - - } - - public function uninstall(Composer $composer, IOInterface $io) - { - - } - - public function getCapabilities() - { - return array( - 'Composer\\Plugin\\Capability\\CommandProvider' => __NAMESPACE__.'\\CommandProvider', - ); - } - } - } -} diff --git a/src/Legacy/README b/src/Legacy/README deleted file mode 100644 index 22f42be..0000000 --- a/src/Legacy/README +++ /dev/null @@ -1,2 +0,0 @@ -Code in this namespace must be compatible with the lowest PHP version that -Composer supports.