Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
42.86% |
3 / 7 |
|
50.00% |
1 / 2 |
CRAP | |
0.00% |
0 / 1 |
| LogoutUrlContextBuilder | |
42.86% |
3 / 7 |
|
50.00% |
1 / 2 |
4.68 | |
0.00% |
0 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| process | |
33.33% |
2 / 6 |
|
0.00% |
0 / 1 |
3.19 | |||
| 1 | <?php |
| 2 | namespace Apie\LaravelApie\ContextBuilders; |
| 3 | |
| 4 | use Apie\Core\Context\ApieContext; |
| 5 | use Apie\Core\ContextBuilders\ContextBuilderInterface; |
| 6 | use Apie\Core\ContextConstants; |
| 7 | |
| 8 | class LogoutUrlContextBuilder implements ContextBuilderInterface |
| 9 | { |
| 10 | public function __construct(private readonly ?string $logoutUrl) |
| 11 | { |
| 12 | } |
| 13 | |
| 14 | public function process(ApieContext $context): ApieContext |
| 15 | { |
| 16 | if ($this->logoutUrl) { |
| 17 | return $context->withContext( |
| 18 | ContextConstants::LOGOUT_URL, |
| 19 | $this->logoutUrl |
| 20 | ); |
| 21 | } |
| 22 | return $context; |
| 23 | } |
| 24 | } |