From a23f8a3d6c3fde2cbbe3b4459201437c54617d0c Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Tue, 1 Jun 2021 16:05:53 +0200 Subject: [PATCH] Add gitlab-protocol to config command and schema --- res/composer-schema.json | 4 ++++ src/Composer/Command/ConfigCommand.php | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/res/composer-schema.json b/res/composer-schema.json index 96b708f88..bba26f718 100644 --- a/res/composer-schema.json +++ b/res/composer-schema.json @@ -143,6 +143,10 @@ "type": "string" } }, + "gitlab-protocol": { + "enum": ["git", "http", "https"], + "description": "A protocol to force use of when creating a repository URL for the `source` value of the package metadata. One of `git` or `http`. By default, Composer will generate a git URL for private repositories and http one for public repos." + }, "bearer": { "type": "object", "description": "A hash of domain name => bearer authentication token, for example {\"example.com\":\"\"}.", diff --git a/src/Composer/Command/ConfigCommand.php b/src/Composer/Command/ConfigCommand.php index 232bb3742..650daa594 100644 --- a/src/Composer/Command/ConfigCommand.php +++ b/src/Composer/Command/ConfigCommand.php @@ -330,6 +330,14 @@ EOT return $val; }, ), + 'gitlab-protocol' => array( + function ($val) { + return in_array($val, array('git', 'http', 'https'), true); + }, + function ($val) { + return $val; + }, + ), 'store-auths' => array( function ($val) { return in_array($val, array('true', 'false', 'prompt'), true);