Trigger event in validate command
This allows plugins to run additional validations.pull/4850/head
parent
7c3e621102
commit
298e7a218a
|
@ -14,6 +14,9 @@ namespace Composer\Command;
|
|||
|
||||
use Composer\Factory;
|
||||
use Composer\Package\Loader\ValidatingArrayLoader;
|
||||
use Composer\Plugin\CommandEvent;
|
||||
use Composer\Plugin\PluginEvents;
|
||||
use Composer\Script\ScriptEvents;
|
||||
use Composer\Util\ConfigValidator;
|
||||
use Symfony\Component\Console\Input\InputArgument;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
|
@ -111,6 +114,10 @@ EOT
|
|||
}
|
||||
}
|
||||
|
||||
$commandEvent = new CommandEvent(PluginEvents::COMMAND, 'validate', $input, $output);
|
||||
$eventCode = $composer->getEventDispatcher()->dispatch($commandEvent->getName(), $commandEvent);
|
||||
$exitCode = max($eventCode, $exitCode);
|
||||
|
||||
return $exitCode;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue