Completed
Push — main ( 44b1b8...7fdac8 )
by Roni
27s queued 14s
created

ConfigApiController   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 18
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getByGroup() 0 3 1
A getByKey() 0 3 1
1
<?php
2
3
namespace Xiidea\EasyConfigBundle\Controller;
4
5
use Symfony\Component\HttpFoundation\JsonResponse;
6
use Xiidea\EasyConfigBundle\Services\Manager\ConfigManager;
7
8
class ConfigApiController
9
{
10
    /**
11
     * @param  string  $key
12
     * @return JsonResponse
13
     */
14
    public function getByGroup(string $key, ConfigManager $manager): JsonResponse
15
    {
16
        return new JsonResponse($manager->getConfigurationsByGroup($key));
17
    }
18
19
    /**
20
     * @param  string  $key
21
     * @return JsonResponse
22
     */
23
    public function getByKey(string $key, ConfigManager $manager): JsonResponse
24
    {
25
        return new JsonResponse($manager->getConfigurationValueByKey($key));
26
    }
27
}
28