1
0
Fork 0

Trigger event in validate command

This allows plugins to run additional validations.
pull/4850/head
Alexander Stehlik 2016-01-29 17:33:16 +01:00
parent 7c3e621102
commit 298e7a218a
1 changed files with 7 additions and 0 deletions

View File

@ -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;
}