Completed
Push — develop ( c5b154...f7cec4 )
by Léo
02:07
created

AbstractSeoGenerator::render()   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 0
1
<?php
2
3
namespace Leogout\Bundle\SeoBundle\Seo;
4
5
use Leogout\Bundle\SeoBundle\Builder\TagBuilder;
6
use Leogout\Bundle\SeoBundle\Model\RenderableInterface;
7
8
/**
9
 * Description of AbstractSeoGenerator.
10
 *
11
 * @author: leogout
12
 */
13
abstract class AbstractSeoGenerator implements RenderableInterface
14
{
15
    /**
16
     * @var TagBuilder
17
     */
18
    protected $tagBuilder;
19
20
    /**
21
     * BasicSeoBuilder constructor.
22
     *
23
     * @param TagBuilder $tagBuilder
24
     */
25
    public function __construct(TagBuilder $tagBuilder)
26
    {
27
        $this->tagBuilder = $tagBuilder;
28
    }
29
30
    /**
31
     * @param $resource
32
     *
33
     * @return $this
34
     */
35
    abstract public function fromResource($resource);
36
37
    /**
38
     * @return string
39
     */
40
    public function render()
41
    {
42
        return $this->tagBuilder->render();
43
    }
44
45
    /**
46
     * @return string
47
     */
48
    public function __toString()
49
    {
50
        return $this->render();
51
    }
52
}
53