diff --git a/src/Dockerfile.php b/src/Dockerfile.php index 6308ad4..59f85f8 100644 --- a/src/Dockerfile.php +++ b/src/Dockerfile.php @@ -12,7 +12,7 @@ final class Dockerfile implements \IteratorAggregate, \Countable, FileInterface, /** @var iterable|Dockerfile\LayerInterface[] */ private iterable $layers; - public function __construct(null|LayerInterface ...$layers) + public function __construct(?LayerInterface ...$layers) { $this->layers = $layers; } diff --git a/src/PHP/ComposerGithubOauthAuthentication.php b/src/PHP/ComposerGithubOauthAuthentication.php index c5a260e..1c34ce2 100644 --- a/src/PHP/ComposerGithubOauthAuthentication.php +++ b/src/PHP/ComposerGithubOauthAuthentication.php @@ -10,6 +10,7 @@ { public function __construct( private string $token, + private string $domain = 'github.com', ) { } @@ -17,7 +18,7 @@ public function __toString(): string { return (string) new Dockerfile\Run(sprintf(<<<'RUN' set -ex \ - && composer config --auth github-oauth.github.com %s - RUN, $this->token)); + && composer config --auth github-oauth.%s %s + RUN, $this->domain, $this->token)); } } diff --git a/src/PHP/ComposerGitlabOauthAuthentication.php b/src/PHP/ComposerGitlabOauthAuthentication.php index 857f419..03cdb61 100644 --- a/src/PHP/ComposerGitlabOauthAuthentication.php +++ b/src/PHP/ComposerGitlabOauthAuthentication.php @@ -10,7 +10,7 @@ { public function __construct( private string $token, - private string $instance = 'gitlab.com', + private string $domain = 'gitlab.com', ) { } @@ -19,6 +19,6 @@ public function __toString(): string return (string) new Dockerfile\Run(sprintf(<<<'RUN' set -ex \ && composer config --auth gitlab-oauth.%s %s - RUN, $this->instance, $this->token)); + RUN, $this->domain, $this->token)); } } diff --git a/src/PHP/ComposerGitlabTokenAuthentication.php b/src/PHP/ComposerGitlabTokenAuthentication.php index 55e3437..bd8414e 100644 --- a/src/PHP/ComposerGitlabTokenAuthentication.php +++ b/src/PHP/ComposerGitlabTokenAuthentication.php @@ -10,7 +10,7 @@ { public function __construct( private string $token, - private string $instance = 'gitlab.com', + private string $domain = 'gitlab.com', ) { } @@ -19,6 +19,6 @@ public function __toString(): string return (string) new Dockerfile\Run(sprintf(<<<'RUN' set -ex \ && composer config --auth gitlab-token.%s %s - RUN, $this->instance, $this->token)); + RUN, $this->domain, $this->token)); } } diff --git a/src/PHP/ComposerHttpBasicAuthentication.php b/src/PHP/ComposerHttpBasicAuthentication.php index 9e733fc..b670442 100644 --- a/src/PHP/ComposerHttpBasicAuthentication.php +++ b/src/PHP/ComposerHttpBasicAuthentication.php @@ -9,7 +9,7 @@ final readonly class ComposerHttpBasicAuthentication implements Dockerfile\LayerInterface, \Stringable { public function __construct( - private string $url, + private string $domain, private string $username, private string $password, ) { @@ -20,6 +20,6 @@ public function __toString(): string return (string) new Dockerfile\Run(sprintf(<<<'RUN' set -ex \ && composer config --auth http-basic.%s %s %s - RUN, $this->url, $this->username, $this->password)); + RUN, $this->domain, $this->username, $this->password)); } } diff --git a/src/PHP/ComposerHttpBearerAuthentication.php b/src/PHP/ComposerHttpBearerAuthentication.php index acfa265..dd4f74d 100644 --- a/src/PHP/ComposerHttpBearerAuthentication.php +++ b/src/PHP/ComposerHttpBearerAuthentication.php @@ -9,7 +9,7 @@ final readonly class ComposerHttpBearerAuthentication implements Dockerfile\LayerInterface, \Stringable { public function __construct( - private string $url, + private string $domain, private string $token, ) { } @@ -19,6 +19,6 @@ public function __toString(): string return (string) new Dockerfile\Run(sprintf(<<<'RUN' set -ex \ && composer config --auth bearer.%s %s - RUN, $this->url, $this->token)); + RUN, $this->domain, $this->token)); } }