AbstractGuesser   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 1

Importance

Changes 0
Metric Value
wmc 5
lcom 2
cbo 1
dl 0
loc 29
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getManager() 0 4 1
A setManager() 0 6 1
A addFaker() 0 6 2
A get() 0 4 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