| Conditions | 1 |
| Paths | 1 |
| Total Lines | 18 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 1.0233 |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | 1 | public static function build(): array |
|
| 14 | { |
||
| 15 | 1 | return |
|
| 16 | 1 | [ |
|
| 17 | 1 | 'name' => 'configuration', |
|
| 18 | 1 | 'type' => Type::nonNull(Type::string()), |
|
| 19 | 1 | 'description' => 'Return configuration value for given key. The value might be any format (HTML, JSON, text) as defined by client', |
|
| 20 | 1 | 'args' => [ |
|
| 21 | 1 | 'key' => Type::nonNull(Type::string()), |
|
| 22 | 1 | ], |
|
| 23 | 1 | 'resolve' => function ($root, array $args): string { |
|
| 24 | $key = $args['key']; |
||
| 25 | |||
| 26 | /** @var ConfigurationRepository $configurationRepository */ |
||
| 27 | $configurationRepository = _em()->getRepository(\Application\Model\Configuration::class); |
||
| 28 | $configuration = $configurationRepository->getOrCreate($key); |
||
| 29 | |||
| 30 | return $configuration->getValue(); |
||
| 31 | 1 | }, |
|
| 35 |