Completed
Pull Request — master (#244)
by Łukasz
11:47
created

RequestStackWorker::mount()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 3
nc 2
nop 1
1
<?php
2
3
namespace FSi\Bundle\AdminBundle\Factory\Worker;
4
5
use Doctrine\Common\Persistence\ManagerRegistry;
6
use FSi\Bundle\AdminBundle\Admin\Element;
7
use FSi\Bundle\AdminBundle\Admin\RequestStackAware;
8
use FSi\Bundle\AdminBundle\Factory\Worker;
9
use Symfony\Component\HttpFoundation\RequestStack;
10
11
class RequestStackWorker implements Worker
12
{
13
    /**
14
     * @var RequestStack
15
     */
16
    private $requestStack;
17
18
    /**
19
     * @param RequestStack $requestStack
20
     */
21
    function __construct(RequestStack $requestStack)
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
22
    {
23
        $this->requestStack = $requestStack;
24
    }
25
26
    /**
27
     * @inheritdoc
28
     */
29
    public function mount(Element $element)
30
    {
31
        if ($element instanceof RequestStackAware) {
32
            $element->setRequestStack($this->requestStack);
33
        }
34
    }
35
}
36