| Total Complexity | 5 |
| Total Lines | 53 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 14 | trait HasTypeFunctions |
||
| 15 | { |
||
| 16 | /** |
||
| 17 | * Take an input value of any type and convert it into an array value. |
||
| 18 | * |
||
| 19 | * @link https://www.arangodb.com/docs/stable/aql/functions-type-cast.html#to_array |
||
| 20 | */ |
||
| 21 | 2 | public function toArray( |
|
| 22 | mixed $value, |
||
| 23 | ): FunctionExpression { |
||
| 24 | 2 | return new FunctionExpression('TO_ARRAY', [$value]); |
|
| 25 | } |
||
| 26 | |||
| 27 | /** |
||
| 28 | * Take an input value of any type and convert it into the appropriate boolean value. |
||
| 29 | * |
||
| 30 | * @link https://www.arangodb.com/docs/stable/aql/functions-type-cast.html#to_bool |
||
| 31 | */ |
||
| 32 | 1 | public function toBool( |
|
| 33 | mixed $value, |
||
| 34 | ): FunctionExpression { |
||
| 35 | 1 | return new FunctionExpression('TO_BOOL', [$value]); |
|
| 36 | } |
||
| 37 | |||
| 38 | /** |
||
| 39 | * Alias for toArray |
||
| 40 | */ |
||
| 41 | 1 | public function toList( |
|
| 42 | mixed $value, |
||
| 43 | ): FunctionExpression { |
||
| 44 | 1 | return $this->toArray($value); |
|
| 45 | } |
||
| 46 | |||
| 47 | /** |
||
| 48 | * Take an input value of any type and convert it into a numeric value. |
||
| 49 | * |
||
| 50 | * @link https://www.arangodb.com/docs/stable/aql/functions-type-cast.html#to_number |
||
| 51 | */ |
||
| 52 | 1 | public function toNumber( |
|
| 53 | mixed $value, |
||
| 54 | ): FunctionExpression { |
||
| 55 | 1 | return new FunctionExpression('TO_NUMBER', [$value]); |
|
| 56 | } |
||
| 57 | |||
| 58 | /** |
||
| 59 | * Take an input value of any type and convert it into a string value. |
||
| 60 | * |
||
| 61 | * @link https://www.arangodb.com/docs/stable/aql/functions-type-cast.html#to_string |
||
| 62 | */ |
||
| 63 | 1 | public function toString( |
|
| 67 | } |
||
| 68 | } |
||
| 69 |