Completed
Push — master ( c32bd7...f916e0 )
by Hannes
02:12
created

ReturnObj::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace hanneskod\readmetester\Expectation\ReturnObj;
4
5
/**
6
 * Represents the result of an evaluated expectation
7
 */
8
abstract class ReturnObj
9
{
10
    /**
11
     * @var string
12
     */
13
    private $message;
14
15
    /**
16
     * Set message
17
     *
18
     * @param string $message
19
     */
20
    public function __construct($message)
21
    {
22
        $this->message = $message;
23
    }
24
25
    /**
26
     * Get returned message
27
     *
28
     * @return string
29
     */
30
    public function getMessage()
31
    {
32
        return $this->message;
33
    }
34
35
    /**
36
     * Check if expectation validation was a failure
37
     *
38
     * @return boolean
39
     */
40
    public function isFailure()
41
    {
42
        return !$this->isSuccess();
43
    }
44
45
    /**
46
     * Check if expectation validation was a success
47
     *
48
     * @return boolean
49
     */
50
    abstract public function isSuccess();
51
}
52