Warning   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Test Coverage

Coverage 75%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 47
ccs 6
cts 8
cp 0.75
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __toString() 0 3 1
A message() 0 3 1
A code() 0 3 1
A RFCNumber() 0 3 1
1
<?php
2
3
namespace Egulias\EmailValidator\Warning;
4
5
abstract class Warning
6
{
7
    /**
8
     * @var int CODE
9
     */
10
    public const CODE = 0;
11
12
    /**
13
     * @var string
14
     */
15
    protected $message = '';
16
17
    /**
18
     * @var int
19
     */
20
    protected $rfcNumber = 0;
21
22 12
    /**
23
     * @return string
24 12
     */
25
    public function message()
26
    {
27
        return $this->message;
28
    }
29
30 12
    /**
31
     * @return int
32 12
     */
33
    public function code()
34
    {
35
        return self::CODE;
36
    }
37
38
    /**
39
     * @return int
40
     */
41
    public function RFCNumber()
42
    {
43 12
        return $this->rfcNumber;
44
    }
45 12
46
    /**
47
     * @return string
48
     */
49
    public function __toString(): string
50
    {
51
        return $this->message() . " rfc: " .  $this->rfcNumber . "internal code: " . strval(static::CODE);
52
    }
53
}
54