Passed
Push — master ( 94bd17...112d90 )
by Alex
02:16
created

AbstractPresenter   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 88
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 10
dl 0
loc 88
rs 10
c 1
b 0
f 1
wmc 6

6 Methods

Rating   Name   Duplication   Size   Complexity  
A setErrorMessage() 0 3 1
A getPresenterName() 0 3 1
A getErrorCode() 0 3 1
A getErrorMessage() 0 3 1
A setPresenterName() 0 3 1
A setErrorCode() 0 3 1
1
<?php
2
namespace Mezon\Application;
3
4
/**
5
 * Interface PresenterInterface
6
 *
7
 * @package Application
8
 * @subpackage PresenterInterface
9
 * @author Dodonov A.A.
10
 * @version v.1.0 (2020/06/23)
11
 * @copyright Copyright (c) 2020, aeon.org
12
 */
13
14
/**
15
 * Base class for all presenters
16
 */
17
abstract class AbstractPresenter implements PresenterInterface
18
{
19
20
    /**
21
     * Presenter's name
22
     *
23
     * @var string
24
     */
25
    private $presenterName = '';
26
27
    /**
28
     * Error code
29
     * 
30
     * @var integer
31
     */
32
    private $errorCode = 0;
33
34
    /**
35
     * Error message
36
     * 
37
     * @var string
38
     */
39
    private $errorMessage = '';
40
41
    /**
42
     * Method returns presenter's name
43
     *
44
     * @return string presenter's name
45
     */
46
    public function getPresenterName(): string
47
    {
48
        return $this->presenterName;
49
    }
50
51
    /**
52
     * Method returns presenter's name
53
     *
54
     * @return string presenter's name
55
     */
56
    public function setPresenterName(string $presenterName): void
57
    {
58
        $this->presenterName = $presenterName;
59
    }
60
    
61
    /**
62
     * Method returns code of the last error
63
     *
64
     * @return int code of the last error
65
     * @codeCoverageIgnore
66
     */
67
    public function getErrorCode(): int
68
    {
69
        return $this->errorCode;
70
    }
71
72
    /**
73
     * Method sets code of the last error
74
     *
75
     * @param int $code
76
     *            code of the last error
77
     * @codeCoverageIgnore
78
     */
79
    public function setErrorCode(int $errorCode): void
80
    {
81
        $this->errorCode = $errorCode;
82
    }
83
84
    /**
85
     * Method return last error description
86
     *
87
     * @return string last error description
88
     * @codeCoverageIgnore
89
     */
90
    public function getErrorMessage(): string
91
    {
92
        return $this->errorMessage;
93
    }
94
95
    /**
96
     * Method sets last error description
97
     *
98
     * @param
99
     *            string last error description
100
     * @codeCoverageIgnore
101
     */
102
    public function setErrorMessage(string $errorMessage): void
103
    {
104
        $this->errorMessage = $errorMessage;
105
    }
106
}
107