| Total Complexity | 12 |
| Total Lines | 75 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | class StringType extends ScalarType |
||
| 13 | { |
||
| 14 | /** |
||
| 15 | * @var string |
||
| 16 | */ |
||
| 17 | public $name = Type::STRING; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * @var string |
||
| 21 | */ |
||
| 22 | public $description = |
||
| 23 | 'The `String` scalar type represents textual data, represented as UTF-8 |
||
| 24 | character sequences. The String type is most often used by GraphQL to |
||
| 25 | represent free-form human-readable text.'; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * @param mixed $value |
||
| 29 | * @return mixed|string |
||
| 30 | * @throws Error |
||
| 31 | */ |
||
| 32 | 123 | public function serialize($value) |
|
| 50 | } |
||
| 51 | |||
| 52 | /** |
||
| 53 | * @param mixed $value |
||
| 54 | * @return string |
||
| 55 | * @throws Error |
||
| 56 | */ |
||
| 57 | 21 | public function parseValue($value) |
|
| 60 | } |
||
| 61 | |||
| 62 | /** |
||
| 63 | * @param $valueNode |
||
| 64 | * @param array|null $variables |
||
| 65 | * @return null|string |
||
| 66 | * @throws \Exception |
||
| 67 | */ |
||
| 68 | 54 | public function parseLiteral($valueNode, array $variables = null) |
|
| 76 | } |
||
| 77 | |||
| 78 | 128 | private function coerceString($value) { |
|
| 89 |