QuoteHandler   A
last analyzed

Coupling/Cohesion

Components 0
Dependencies 1

Complexity

Total Complexity 4

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 1
dl 0
loc 36
ccs 16
cts 16
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A draw() 0 18 3
1
<?php
2
3
namespace Kaloa\Renderer\Inigo\Handler;
4
5
use Kaloa\Renderer\Inigo\Handler\ProtoHandler;
6
use Kaloa\Renderer\Inigo\Parser;
7
8
/**
9
 *
10
 */
11
final class QuoteHandler extends ProtoHandler
0 ignored issues
show
Duplication introduced by Marc Ermshaus
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
12
{
13
    /**
14
     *
15
     */
16 18
    public function __construct()
17
    {
18 18
        $this->name = 'quote';
19 18
        $this->type = Parser::TAG_OUTLINE | Parser::TAG_FORCE_PARAGRAPHS;
20 18
        $this->defaultParam = 'author';
21 18
    }
22
23
    /**
24
     *
25
     * @param  array  $data
26
     * @return string
27
     */
28 1
    public function draw(array $data)
29
    {
30 1
        $ret = '';
31
32 1
        if ($data['front']) {
33 1
            $author = $this->fillParam($data, 'author', '');
34
35 1
            if ('' !== $author) {
36 1
                $ret .= '<p>' . $this->e($author) . ':</p>' . "\n\n";
37 1
            }
38
39 1
            $ret .= '<blockquote>' . "\n";
40 1
        } else {
41 1
            $ret .= '</blockquote>' . "\n\n";
42
        }
43
44 1
        return $ret;
45
    }
46
}
47