Completed
Branch master (0b86d9)
by Léo
02:17
created

AbstractSeoConfigurator   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 0
dl 0
loc 36
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
configure() 0 1 ?
A getConfig() 0 8 2
1
<?php
2
3
namespace Leogout\Bundle\SeoBundle\Seo;
4
5
/**
6
 * Description of AbstractSeoConfigurator.
7
 *
8
 * @author: leogout
9
 */
10
abstract class AbstractSeoConfigurator
11
{
12
    /**
13
     * @var array
14
     */
15
    protected $config;
16
17
    /**
18
     * TwitterSeoConfigurator constructor.
19
     *
20
     * @param array $config
21
     */
22
    public function __construct(array $config)
23
    {
24
        $this->config = $config;
25
    }
26
27
    /**
28
     * @param AbstractSeoGenerator $generator
29
     */
30
    abstract public function configure(AbstractSeoGenerator $generator);
31
32
    /**
33
     * @param string $name
34
     *
35
     * @return mixed|null
36
     */
37
    protected function getConfig($name)
38
    {
39
        if (!isset($this->config[$name])) {
40
            return null;
41
        }
42
43
        return $this->config[$name];
44
    }
45
}
46