TitleTag   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 0
dl 0
loc 43
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getContent() 0 4 1
A setContent() 0 6 1
A render() 0 4 1
A __toString() 0 4 1
1
<?php
2
3
namespace Leogout\Bundle\SeoBundle\Model;
4
5
/**
6
 * Description of TitleTag.
7
 *
8
 * @author: leogout
9
 */
10
class TitleTag implements RenderableInterface
11
{
12
    /**
13
     * @var string
14
     */
15
    protected $content;
16
17
    /**
18
     * @return string
19
     */
20
    public function getContent()
21
    {
22
        return $this->content;
23
    }
24
25
    /**
26
     * @param string $content
27
     *
28
     * @return $this
29
     */
30
    public function setContent($content)
31
    {
32
        $this->content = (string) $content;
33
34
        return $this;
35
    }
36
37
    /**
38
     * @return string
39
     */
40
    public function render()
41
    {
42
        return sprintf('<title>%s</title>', $this->getContent());
43
    }
44
45
    /**
46
     * @return string
47
     */
48
    public function __toString()
49
    {
50
        return $this->render();
51
    }
52
}
53