Completed
Pull Request — master (#9)
by Roman
03:37
created

KamiApiCoreDescriber::describe()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 2
nc 2
nop 3
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace Kami\ApiCoreBundle\Bridge\NelmioApiDoc\RouteDescriber;
4
5
6
use EXSyst\Component\Swagger\Swagger;
7
use Kami\ApiCoreBundle\Controller\ApiController;
8
use Kami\ApiCoreBundle\Stenographer\Stenographer;
9
use Nelmio\ApiDocBundle\RouteDescriber\RouteDescriberInterface;
10
use Symfony\Component\Routing\Route;
11
12
13
class KamiApiCoreDescriber implements RouteDescriberInterface
14
{
15
16
    private $stenographer;
17
18
    public function __construct(Stenographer $stenographer)
19
    {
20
        $this->stenographer = $stenographer;
21
    }
22
23
    public function describe(Swagger $api, Route $route, \ReflectionMethod $reflectionMethod)
24
    {
25
        if (ApiController::class === $reflectionMethod->getDeclaringClass()->getName()) {
26
27
            $this->stenographer->getStenography($api, $route);
28
        }
29
    }
30
31
}