AbstractRenderer   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 61
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getWriter() 0 4 1
A setWriter() 0 4 1
A start() 0 4 1
renderReport() 0 1 ?
A end() 0 4 1
1
<?php
2
/**
3
 * This file is part of PHP Mess Detector.
4
 *
5
 * Copyright (c) Manuel Pichler <[email protected]>.
6
 * All rights reserved.
7
 *
8
 * Licensed under BSD License
9
 * For full copyright and license information, please see the LICENSE file.
10
 * Redistributions of files must retain the above copyright notice.
11
 *
12
 * @author Manuel Pichler <[email protected]>
13
 * @copyright Manuel Pichler. All rights reserved.
14
 * @license https://opensource.org/licenses/bsd-license.php BSD License
15
 * @link http://phpmd.org/
16
 */
17
18
namespace PHPMD;
19
20
/**
21
 * Abstract base class for PHPMD rendering engines.
22
 */
23
abstract class AbstractRenderer
24
{
25
    /**
26
     * The associated output writer instance.
27
     *
28
     * @var \PHPMD\AbstractWriter
29
     */
30
    private $writer = null;
31
32
    /**
33
     * Returns the associated output writer instance.
34
     *
35
     * @return \PHPMD\AbstractWriter
36
     */
37 4
    public function getWriter()
38
    {
39 4
        return $this->writer;
40
    }
41
42
    /**
43
     * Returns the associated output writer instance.
44
     *
45
     * @param \PHPMD\AbstractWriter $writer
46
     * @return void
47
     */
48 4
    public function setWriter(AbstractWriter $writer)
49
    {
50 4
        $this->writer = $writer;
51 4
    }
52
53
    /**
54
     * This method will be called on all renderers before the engine starts the
55
     * real report processing.
56
     *
57
     * @return void
58
     */
59 4
    public function start()
60
    {
61
        // Just a hook
62 4
    }
63
64
    /**
65
     * This method will be called when the engine has finished the source analysis
66
     * phase.
67
     *
68
     * @param \PHPMD\Report $report
69
     * @return void
70
     */
71
    abstract public function renderReport(Report $report);
72
73
    /**
74
     * This method will be called the engine has finished the report processing
75
     * for all registered renderers.
76
     *
77
     * @return void
78
     */
79 4
    public function end()
80
    {
81
        // Just a hook
82 4
    }
83
}
84