AbstractGuesser::get()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
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)
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
32
    {
33
        return $this->getManager()->getContainer()->get($name);
0 ignored issues
show
Bug introduced by
The method getContainer() does not seem to exist on object<Knp\FriendlyConte...Guesser\GuesserManager>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
34
    }
35
}
36