Skip to content

Commit

Permalink
Added a class to configure repositories
Browse files Browse the repository at this point in the history
  • Loading branch information
sebprt committed Feb 7, 2024
1 parent 1b6c8ff commit 2eeff59
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/PHP/ComposerConfigRepository.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

declare(strict_types=1);

namespace Kiboko\Component\Dockerfile\PHP;

use Kiboko\Component\Dockerfile\Dockerfile;
use Kiboko\Component\Dockerfile\Variable;

final readonly class ComposerConfigRepository implements Dockerfile\LayerInterface, \Stringable
{
public function __construct(
private string $name,
private string $type,
private string $url,
) {
}

public function __toString(): string
{
return (string) new Dockerfile\Run(<<<RUN
composer config repositories.{$this->name} {$this->type} {$this->url}
RUN
);
}
}

0 comments on commit 2eeff59

Please sign in to comment.