AbstractGuesser::get()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
namespace Knp\FriendlyContexts\Guesser;
4
5
use Knp\FriendlyContexts\Faker\Provider\Base;
6
7
abstract class AbstractGuesser
8
{
9
    protected $manager;
10
    protected $fakers = [];
11
12
    public function getManager()
13
    {
14
        return $this->manager;
15
    }
16
17
    public function setManager(GuesserManager $manager)
18
    {
19
        $this->manager = $manager;
20
21
        return $this;
22
    }
23
24
    public function addFaker(Base $faker)
25
    {
26
        if (null !== $faker->getParent()) {
27
            $this->fakers[] = $faker;
28
        }
29
    }
30
31
    protected function get($name)
32
    {
33
        return $this->getManager()->getContainer()->get($name);
34
    }
35
}
36