Adjust the CommandProvider to use plugin capabilities and test actual command creation, refs #3377
parent
4319435154
commit
090295dbcb
@ -0,0 +1,33 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Installer;
|
||||||
|
|
||||||
|
use Composer\Plugin\Capability\CommandProvider;
|
||||||
|
use Symfony\Component\Console\Input\InputInterface;
|
||||||
|
use Symfony\Component\Console\Output\OutputInterface;
|
||||||
|
use Composer\Command\BaseCommand;
|
||||||
|
|
||||||
|
class CommandProvider implements CommandProvider
|
||||||
|
{
|
||||||
|
public function __construct(array $args)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getCommands()
|
||||||
|
{
|
||||||
|
return array(new Command);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class Command extends BaseCommand
|
||||||
|
{
|
||||||
|
protected function configure()
|
||||||
|
{
|
||||||
|
$this->setName('custom-plugin-command');
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function execute(InputInterface $input, OutputInterface $output)
|
||||||
|
{
|
||||||
|
return 5;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue