Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
5 / 5 |
|
100.00% |
5 / 5 |
CRAP | |
100.00% |
1 / 1 |
| ExportStatement | |
100.00% |
5 / 5 |
|
100.00% |
5 / 5 |
5 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| toTypescript | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| toJavascript | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| providesDefinitions | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| needsDefinitions | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | namespace Apie\TypescriptCodeBuilder\Dto; |
| 3 | |
| 4 | use Apie\TypescriptCodeBuilder\Lists\JavascriptIdentifierList; |
| 5 | use Apie\TypescriptCodeBuilder\TypescriptFileExpressionInterface; |
| 6 | |
| 7 | class ExportStatement implements TypescriptFileExpressionInterface |
| 8 | { |
| 9 | public function __construct(public JavascriptIdentifierList $exports) |
| 10 | { |
| 11 | } |
| 12 | |
| 13 | public function toTypescript(): string |
| 14 | { |
| 15 | return 'export { ' . implode(', ', $this->exports->toStringArray()) . ' }'; |
| 16 | } |
| 17 | |
| 18 | public function toJavascript(): string |
| 19 | { |
| 20 | return $this->toTypescript(); |
| 21 | } |
| 22 | |
| 23 | public function providesDefinitions(bool $applyBlockScope): JavascriptIdentifierList |
| 24 | { |
| 25 | return new JavascriptIdentifierList(); |
| 26 | } |
| 27 | |
| 28 | public function needsDefinitions(): JavascriptIdentifierList |
| 29 | { |
| 30 | return $this->exports; |
| 31 | } |
| 32 | } |