Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
50.00% |
2 / 4 |
|
50.00% |
2 / 4 |
CRAP | |
0.00% |
0 / 1 |
| TypescriptType | |
50.00% |
2 / 4 |
|
50.00% |
2 / 4 |
6.00 | |
0.00% |
0 / 1 |
| toTypescript | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| toJavascript | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| needsDefinitions | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| providesDefinitions | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | namespace Apie\TypescriptCodeBuilder\Enums; |
| 3 | |
| 4 | use Apie\TypescriptCodeBuilder\Lists\JavascriptIdentifierList; |
| 5 | use Apie\TypescriptCodeBuilder\TypescriptTypeDeclarationInterface; |
| 6 | |
| 7 | enum TypescriptType: string implements TypescriptTypeDeclarationInterface |
| 8 | { |
| 9 | case String = 'string'; |
| 10 | case Number = 'number'; |
| 11 | case Boolean = 'boolean'; |
| 12 | case Any = 'any'; |
| 13 | case Unknown = 'unknown'; |
| 14 | case Void = 'void'; |
| 15 | case BigInt = 'bigint'; |
| 16 | case Symbol = 'symbol'; |
| 17 | |
| 18 | public function toTypescript(): string |
| 19 | { |
| 20 | return $this->value; |
| 21 | } |
| 22 | |
| 23 | public function toJavascript(): string |
| 24 | { |
| 25 | return ''; |
| 26 | } |
| 27 | |
| 28 | public function needsDefinitions(): JavascriptIdentifierList |
| 29 | { |
| 30 | return new JavascriptIdentifierList(); |
| 31 | } |
| 32 | |
| 33 | public function providesDefinitions(): JavascriptIdentifierList |
| 34 | { |
| 35 | return new JavascriptIdentifierList(); |
| 36 | } |
| 37 | } |