-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from cs278/php8
PHP 8
- Loading branch information
Showing
9 changed files
with
164 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
|
||
namespace Cs278\ComposerAudit\Legacy; | ||
|
||
use Composer\Command\BaseCommand; | ||
use Symfony\Component\Console\Input\InputInterface; | ||
use Symfony\Component\Console\Input\InputOption; | ||
use Symfony\Component\Console\Output\ConsoleOutputInterface; | ||
use Symfony\Component\Console\Output\OutputInterface; | ||
|
||
/** | ||
* Dummy command which tells the user they are using an unsupported PHP. | ||
* | ||
* @copyright 2021 Chris Smith | ||
* @license MIT | ||
*/ | ||
final class AuditNotCompatibleCommand extends BaseCommand | ||
{ | ||
protected function configure() | ||
{ | ||
// Configuration is copied from AuditCommand so that the command accepts the same inputs. | ||
$this->setName('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('<error>Composer Audit is not compatible with PHP %s', PHP_VERSION)); | ||
|
||
return 2; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace Cs278\ComposerAudit\Legacy; | ||
|
||
use Composer\Plugin\Capability\CommandProvider as CommandProviderCapability; | ||
|
||
/** | ||
* @internal This class is used when loading the plugin with PHP < 7.1. | ||
*/ | ||
final class CommandProvider implements CommandProviderCapability | ||
{ | ||
public function getCommands() | ||
{ | ||
return array( | ||
new AuditNotCompatibleCommand(), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php | ||
|
||
namespace Cs278\ComposerAudit\Legacy; | ||
|
||
use Composer\Composer; | ||
use Composer\IO\IOInterface; | ||
use Composer\Plugin\Capable; | ||
use Composer\Plugin\PluginInterface; | ||
|
||
if (!class_exists(__NAMESPACE__.'\\ComposerPlugin', false)) { | ||
if (\PHP_VERSION_ID >= 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', | ||
); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Code in this namespace must be compatible with the lowest PHP version that | ||
Composer supports. |