"phpcbf":"Automatically fixes standards violations where possible.",
"phpcbf":"Automatically fixes standards violations where possible.",
"phpcs":"Checks code for standards compliance.",
"phpcs":"Checks code for standards compliance.",
"test":"Runs PHPUnit tests.",
"test":"Runs PHPUnit tests.",
"core-convert":"Converts this module to a core merge request. Excepts 2 arguments. 1) The core clone directory. 2) The core merge request branch.",
"core-convert":"Converts this module to a core merge request. For arguments and options see \\Drupal\\automatic_updates\\Development\\ConverterCommand::configure().",
"core-commit":"Converts this module to a core merge request. Excepts 1 arguments. The core clone directory."
"core-commit":"Converts this module to a core merge request. Excepts 1 arguments. The core clone directory."
$this->addOption('no_commit',NULL,InputOption::VALUE_NONE,'Do not make commit');
}
/**
/**
* Prints message.
* Prints message.
...
@@ -36,36 +146,15 @@ class Converter {
...
@@ -36,36 +146,15 @@ class Converter {
/**
/**
* Converts the contrib module to core merge request.
* Converts the contrib module to core merge request.
*
* @param \Composer\Script\Event $event
* The Composer event.
*/
*/
publicstaticfunctiondoConvert(Event$event):void{
privatefunctiondoConvert():void{
$args=$event->getArguments();
$count_arg=count($args);
if(!($count_arg===3||$count_arg===4)){
thrownew\Exception("This scripts 3 required arguments: a directory that is a core clone and the branch and to convert either package_manager or automatic_updates.\nIt has 1 optional arguments: the branch of this module to use which defaults to 3.0.x");
}
$core_dir=$args[0];
$core_branch=$args[1];
if(!is_dir($core_dir)){
thrownew\Exception("$core_dir is not a directory.");
}
$package_manager_only=match($args[2]){
'package_manager'=>TRUE,
'automatic_updates'=>FALSE,
default=>thrownew\UnexpectedValueException("The 3nd argument must be package_manager or automatic_updates"),