1
0
Fork 0

Merge pull request #4850 from astehlik/issue-validate_event

Trigger event in validate command
pull/4431/merge
Jordi Boggiano 2016-02-13 16:35:04 +00:00
commit d9a7d4c93a
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;
}