Skip to content

Commit 2eeff59

Browse files
committed
Added a class to configure repositories
1 parent 1b6c8ff commit 2eeff59

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

src/PHP/ComposerConfigRepository.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Kiboko\Component\Dockerfile\PHP;
6+
7+
use Kiboko\Component\Dockerfile\Dockerfile;
8+
use Kiboko\Component\Dockerfile\Variable;
9+
10+
final readonly class ComposerConfigRepository implements Dockerfile\LayerInterface, \Stringable
11+
{
12+
public function __construct(
13+
private string $name,
14+
private string $type,
15+
private string $url,
16+
) {
17+
}
18+
19+
public function __toString(): string
20+
{
21+
return (string) new Dockerfile\Run(<<<RUN
22+
composer config repositories.{$this->name} {$this->type} {$this->url}
23+
RUN
24+
);
25+
}
26+
}

0 commit comments

Comments
 (0)