Completed
Push — master ( fe7ae6...ea593a )
by claudio
07:25
created

OptimiseException::setEmpty()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 1 Features 0
Metric Value
c 1
b 1
f 0
dl 0
loc 4
ccs 0
cts 3
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 2
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: Claudio Cardinale <[email protected]>
5
 * Date: 07/12/15
6
 * Time: 21.24
7
 * This program is free software; you can redistribute it and/or
8
 * modify it under the terms of the GNU General Public License
9
 * as published by the Free Software Foundation; either version 2
10
 * of the License, or (at your option) any later version.
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
18
 */
19
20
namespace plunner\Console\Commands\Optimise;
21
22
23
use Exception;
24
25
class OptimiseException extends \Exception
26
{
27
    /**
28
     * @var bool
29
     */
30
    private $empty = false;
31
32
    /**
33
     * OptimiseException constructor.
34
     * @param string $message
35
     * @param int $code
36
     * @param Exception $previous
37
     * @param bool $empty
38
     */
39 6
    public function __construct($message =  "", $code = 0, Exception $previous = null, $empty = false)
40
    {
41 6
        parent::__construct($message, $code, $previous);
42 6
        $this->empty = $empty;
43 6
    }
44
45
    /**
46
     * @return boolean
47
     */
48 6
    public function isEmpty()
49
    {
50 6
        return $this->empty;
51
    }
52
53
    /**
54
     * @param boolean $empty
55
     */
56
    public function setEmpty($empty)
57
    {
58
        $this->empty = $empty;
59
    }
60
61
    /**
62
     * @param boolean $empty
63
     * @return OptimiseException
64
     */
65 6
    public function withEmpty($empty)
66
    {
67 6
        $this->empty = $empty;
68 6
        return $this;
69
    }
70
}