Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 8 |
|
0.00% |
0 / 5 |
CRAP | |
0.00% |
0 / 1 |
| BoundedContextDeclaration | |
0.00% |
0 / 8 |
|
0.00% |
0 / 5 |
30 | |
0.00% |
0 / 1 |
| __construct | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
2 | |||
| toTypescript | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| toJavascript | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| providesDefinitions | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| needsDefinitions | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | namespace Apie\TypescriptClientBuilder\Dto; |
| 3 | |
| 4 | use Apie\Core\BoundedContext\BoundedContext; |
| 5 | use Apie\TypescriptCodeBuilder\Dto\Typehints\InterfaceDefinition; |
| 6 | use Apie\TypescriptCodeBuilder\Lists\ArgumentList; |
| 7 | use Apie\TypescriptCodeBuilder\Lists\JavascriptIdentifierList; |
| 8 | use Apie\TypescriptCodeBuilder\TypescriptTypeDeclarationInterface; |
| 9 | use Apie\TypescriptCodeBuilder\ValueObjects\JavascriptIdentifier; |
| 10 | |
| 11 | class BoundedContextDeclaration implements TypescriptTypeDeclarationInterface |
| 12 | { |
| 13 | private InterfaceDefinition $internal; |
| 14 | |
| 15 | public function __construct( |
| 16 | BoundedContext $hashmap, |
| 17 | string $apieClassPrefix |
| 18 | ) { |
| 19 | $this->internal = (new InterfaceDefinition( |
| 20 | new JavascriptIdentifier($apieClassPrefix . 'BoundedContext' . $hashmap->getId()), |
| 21 | new ArgumentList() |
| 22 | )); |
| 23 | } |
| 24 | |
| 25 | public function toTypescript(): string |
| 26 | { |
| 27 | return $this->internal->toTypescript(); |
| 28 | } |
| 29 | public function toJavascript(): string |
| 30 | { |
| 31 | return ''; |
| 32 | } |
| 33 | public function providesDefinitions(bool $applyBlockScope): JavascriptIdentifierList |
| 34 | { |
| 35 | return $this->internal->providesDefinitions($applyBlockScope); |
| 36 | } |
| 37 | public function needsDefinitions(): JavascriptIdentifierList |
| 38 | { |
| 39 | return $this->internal->needsDefinitions(); |
| 40 | } |
| 41 | } |