Skip to content

Commit

Permalink
Renamed arguments + ran php-cs-fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
sebprt committed Jun 26, 2024
1 parent 8b7feef commit f1dbf98
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/Dockerfile.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Check failure on line 17 in src/Dockerfile.php

View workflow job for this annotation

GitHub Actions / phpstan

Property Kiboko\Component\Dockerfile\Dockerfile::$layers (iterable<Kiboko\Component\Dockerfile\Dockerfile\LayerInterface>) does not accept array<int|string, Kiboko\Component\Dockerfile\Dockerfile\LayerInterface|null>.

Check failure on line 17 in src/Dockerfile.php

View workflow job for this annotation

GitHub Actions / phpstan

Property Kiboko\Component\Dockerfile\Dockerfile::$layers (iterable<Kiboko\Component\Dockerfile\Dockerfile\LayerInterface>) does not accept array<int|string, Kiboko\Component\Dockerfile\Dockerfile\LayerInterface|null>.
}
Expand Down
5 changes: 3 additions & 2 deletions src/PHP/ComposerGithubOauthAuthentication.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@
{
public function __construct(
private string $token,
private string $domain = 'github.com',
) {
}

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));
}
}
4 changes: 2 additions & 2 deletions src/PHP/ComposerGitlabOauthAuthentication.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{
public function __construct(
private string $token,
private string $instance = 'gitlab.com',
private string $domain = 'gitlab.com',
) {
}

Expand All @@ -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));
}
}
4 changes: 2 additions & 2 deletions src/PHP/ComposerGitlabTokenAuthentication.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{
public function __construct(
private string $token,
private string $instance = 'gitlab.com',
private string $domain = 'gitlab.com',
) {
}

Expand All @@ -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));
}
}
4 changes: 2 additions & 2 deletions src/PHP/ComposerHttpBasicAuthentication.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
) {
Expand All @@ -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));
}
}
4 changes: 2 additions & 2 deletions src/PHP/ComposerHttpBearerAuthentication.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
final readonly class ComposerHttpBearerAuthentication implements Dockerfile\LayerInterface, \Stringable
{
public function __construct(
private string $url,
private string $domain,
private string $token,
) {
}
Expand All @@ -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));
}
}

0 comments on commit f1dbf98

Please sign in to comment.