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

AbstractSeoConfigurator::__construct()   A

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 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