Passed
Pull Request — master (#9)
by Iakov
04:09 queued 01:26
created

GetEntityFromReflectionStep::execute()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace Kami\ApiCoreBundle\RequestProcessor\Step\Common;
4
5
use Kami\ApiCoreBundle\RequestProcessor\Step\AbstractStep;
6
7
8
class GetEntityFromReflectionStep extends AbstractStep
9
{
10
    public function execute()
11
    {
12
        $class = $this->getFromResponse('reflection')->getName();
13
        $entity = new $class;
14
15
        return $this->createResponse(['entity' => $entity]);
16
    }
17
18
    public function requiresBefore()
19
    {
20
        return [GetReflectionFromRequestStep::class];
21
    }
22
}