Warning::__toString()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 0
cp 0
crap 2
rs 10
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