1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
5
|
|
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
6
|
|
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
7
|
|
|
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
8
|
|
|
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
9
|
|
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
10
|
|
|
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
11
|
|
|
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
12
|
|
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
13
|
|
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
14
|
|
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
15
|
|
|
* |
16
|
|
|
* This software consists of voluntary contributions made by many individuals |
17
|
|
|
* and is licensed under the LGPL. For more information please see |
18
|
|
|
* <http://phing.info>. |
19
|
|
|
*/ |
20
|
|
|
|
21
|
|
|
namespace Phing\Exception; |
22
|
|
|
|
23
|
|
|
use Phing\Parser\Location; |
24
|
|
|
|
25
|
|
|
/** |
26
|
|
|
* BuildException + exit status. |
27
|
|
|
* |
28
|
|
|
* @author Siad Ardroumli <[email protected]> |
29
|
|
|
*/ |
30
|
|
|
class ExitStatusException extends BuildException |
31
|
|
|
{ |
32
|
|
|
/** |
33
|
|
|
* Status code. |
34
|
|
|
*/ |
35
|
|
|
protected $code; |
36
|
|
|
|
37
|
|
|
/** |
38
|
|
|
* Constructs an <code>ExitStatusException</code>. |
39
|
|
|
* |
40
|
|
|
* @param null|int|string $arg1 |
41
|
|
|
* @param int $arg2 |
42
|
|
|
* @param Location|null $arg3 |
43
|
|
|
*/ |
44
|
|
|
public function __construct($arg1 = null, $arg2 = 0, ?Location $arg3 = null) |
45
|
|
|
{ |
46
|
|
|
$methodArgsNum = func_num_args(); |
47
|
|
|
if (1 === $methodArgsNum) { |
48
|
|
|
parent::__construct(); |
49
|
|
|
$this->code = (int) $arg1; |
50
|
|
|
} elseif (2 === $methodArgsNum && is_string($arg1) && is_int($arg2)) { |
51
|
|
|
parent::__construct($arg1); |
52
|
|
|
$this->code = $arg2; |
53
|
|
|
} elseif (3 === $methodArgsNum && is_string($arg1) && is_int($arg2)) { |
54
|
|
|
parent::__construct($arg1, $arg3); |
55
|
|
|
$this->code = $arg2; |
56
|
|
|
} |
57
|
|
|
} |
58
|
|
|
} |
59
|
|
|
|