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

ConfigApiController::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
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