OgSeoConfigurator   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 7
c 0
b 0
f 0
lcom 0
cbo 3
dl 0
loc 27
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
B configure() 0 21 7
1
<?php
2
3
namespace Leogout\Bundle\SeoBundle\Seo\Og;
4
5
use Leogout\Bundle\SeoBundle\Exception\InvalidSeoGeneratorException;
6
use Leogout\Bundle\SeoBundle\Seo\AbstractSeoConfigurator;
7
use Leogout\Bundle\SeoBundle\Seo\AbstractSeoGenerator;
8
9
/**
10
 * Description of OgSeoConfigurator.
11
 *
12
 * @author: leogout
13
 */
14
class OgSeoConfigurator extends AbstractSeoConfigurator
15
{
16
    /**
17
     * @param AbstractSeoGenerator $generator
18
     */
19
    public function configure(AbstractSeoGenerator $generator)
20
    {
21
        if (!($generator instanceof OgSeoGenerator)) {
22
            throw new InvalidSeoGeneratorException(__CLASS__, OgSeoGenerator::class, get_class($generator));
23
        }
24
        if (null !== $title = $this->getConfig('title')) {
25
            $generator->setTitle($title);
26
        }
27
        if (null !== $description = $this->getConfig('description')) {
28
            $generator->setDescription($description);
29
        }
30
        if (null !== $image = $this->getConfig('image')) {
31
            $generator->setImage($image);
32
        }
33
        if (null !== $type = $this->getConfig('type')) {
34
            $generator->setType($type);
35
        }
36
        if (null !== $url = $this->getConfig('url')) {
37
            $generator->setImage($url);
38
        }
39
    }
40
}
41