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
|
|
|
} |