Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
7 / 7 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
| AddMakerConfigToContext | |
100.00% |
7 / 7 |
|
100.00% |
2 / 2 |
3 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| process | |
100.00% |
6 / 6 |
|
100.00% |
1 / 1 |
2 | |||
| 1 | <?php |
| 2 | namespace Apie\Maker\ContextBuilders; |
| 3 | |
| 4 | use Apie\Core\Context\ApieContext; |
| 5 | use Apie\Core\ContextBuilders\ContextBuilderInterface; |
| 6 | use Apie\Maker\Utils; |
| 7 | |
| 8 | final class AddMakerConfigToContext implements ContextBuilderInterface |
| 9 | { |
| 10 | public function __construct(private readonly ?array $config) |
| 11 | { |
| 12 | } |
| 13 | public function process(ApieContext $context): ApieContext |
| 14 | { |
| 15 | if (is_array($this->config)) { |
| 16 | return $context->withContext( |
| 17 | Utils::MAKER_CONFIG, |
| 18 | $this->config |
| 19 | ); |
| 20 | } |
| 21 | return $context; |
| 22 | } |
| 23 | } |