Skip to content

Commit

Permalink
Added a new command to configure composer config
Browse files Browse the repository at this point in the history
  • Loading branch information
sebprt committed Dec 22, 2023
1 parent e1084b7 commit aff2e4f
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/PHP/ComposerConfig.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

declare(strict_types=1);

namespace Kiboko\Component\Dockerfile\PHP;

use Kiboko\Component\Dockerfile\Dockerfile;

final readonly class ComposerConfig implements Dockerfile\LayerInterface, \Stringable
{
public function __construct(
private string $host,
private string $token,
)
{
}

public function __toString(): string
{
return (string) new Dockerfile\Run(sprintf(
<<<'RUN'
composer config --global %s %s
RUN,
$this->host,
$this->token,
));
}
}

0 comments on commit aff2e4f

Please sign in to comment.