We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
Conditions | 3 |
Paths | 2 |
Total Lines | 20 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Tests | 11 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
11 | 3 | public function toMappingDefinition(array $config): array |
|
12 | { |
||
13 | 3 | if (!isset($config['edgeType']) || !\is_string($config['edgeType'])) { |
|
14 | 2 | throw new \InvalidArgumentException('Using the Relay Connection fields builder, the key "edgeType" defining the GraphQL type of edges is required and must be a string.'); |
|
15 | } |
||
16 | |||
17 | 1 | $edgeType = $config['edgeType']; |
|
18 | 1 | $edgeDescription = $config['edgeDescription'] ?? 'Edges of the connection'; |
|
19 | |||
20 | 1 | $pageInfoType = $config['pageInfoType'] ?? 'PageInfo'; |
|
21 | 1 | $pageInfoDescription = $config['pageInfoDescription'] ?? 'Page info of the connection'; |
|
22 | |||
23 | return [ |
||
24 | 'edges' => [ |
||
25 | 1 | 'description' => $edgeDescription, |
|
26 | 1 | 'type' => \sprintf('[%s]', $edgeType), |
|
27 | ], |
||
28 | 'pageInfo' => [ |
||
29 | 1 | 'description' => $pageInfoDescription, |
|
30 | 1 | 'type' => $pageInfoType, |
|
31 | ], |
||
35 |