Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
66.67% |
4 / 6 |
|
50.00% |
2 / 4 |
CRAP | |
0.00% |
0 / 1 |
| ApplicationConfig | |
66.67% |
4 / 6 |
|
50.00% |
2 / 4 |
5.93 | |
0.00% |
0 / 1 |
| __construct | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getDatalayerImplementation | |
66.67% |
2 / 3 |
|
0.00% |
0 / 1 |
2.15 | |||
| doesIncludeTemplating | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| doesIncludeSecurity | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | namespace Apie\IntegrationTests\Config; |
| 3 | |
| 4 | use Apie\Core\Datalayers\ApieDatalayer; |
| 5 | use Apie\IntegrationTests\Config\Enums\DatalayerImplementation; |
| 6 | use ReflectionClass; |
| 7 | |
| 8 | final class ApplicationConfig |
| 9 | { |
| 10 | /** |
| 11 | * @param ReflectionClass<ApieDataLayer>|DatalayerImplementation $datalayerImplementation |
| 12 | */ |
| 13 | public function __construct( |
| 14 | private bool $includeTemplating, |
| 15 | private bool $includeSecurity, |
| 16 | private ReflectionClass|DatalayerImplementation $datalayerImplementation = DatalayerImplementation::IN_MEMORY |
| 17 | ) { |
| 18 | } |
| 19 | |
| 20 | /** |
| 21 | * @return ReflectionClass<ApieDataLayer> |
| 22 | */ |
| 23 | public function getDatalayerImplementation(): ReflectionClass |
| 24 | { |
| 25 | if ($this->datalayerImplementation instanceof ReflectionClass) { |
| 26 | return $this->datalayerImplementation; |
| 27 | } |
| 28 | return $this->datalayerImplementation->toClass(); |
| 29 | } |
| 30 | |
| 31 | |
| 32 | public function doesIncludeTemplating(): bool |
| 33 | { |
| 34 | return $this->includeTemplating; |
| 35 | } |
| 36 | |
| 37 | public function doesIncludeSecurity(): bool |
| 38 | { |
| 39 | return $this->includeSecurity; |
| 40 | } |
| 41 | } |