Passed
Pull Request — master (#9)
by Roman
03:21
created

GetEntityFromReflectionStep   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 13
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A execute() 0 6 1
A requiresBefore() 0 3 1
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
}