|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
|
4
|
|
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
|
5
|
|
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
|
6
|
|
|
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
|
7
|
|
|
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
|
8
|
|
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
|
9
|
|
|
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
|
10
|
|
|
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
|
11
|
|
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
|
12
|
|
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
|
13
|
|
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
|
14
|
|
|
* |
|
15
|
|
|
* This software consists of voluntary contributions made by many individuals |
|
16
|
|
|
* and is licensed under the LGPL. For more information please see |
|
17
|
|
|
* <http://phing.info>. |
|
18
|
|
|
*/ |
|
19
|
|
|
|
|
20
|
|
|
use Phing\Exception\BuildException; |
|
21
|
|
|
use Phing\Task; |
|
22
|
|
|
|
|
23
|
|
|
/** |
|
24
|
|
|
* Task that runs a target. |
|
25
|
|
|
* |
|
26
|
|
|
* @author Siad Ardroumli <[email protected]> |
|
27
|
|
|
* @package phing.tasks.system |
|
28
|
|
|
*/ |
|
29
|
|
|
class RunTargetTask extends Task |
|
30
|
|
|
{ |
|
31
|
|
|
/** |
|
32
|
|
|
* The target attribute |
|
33
|
|
|
* |
|
34
|
|
|
* @param string $target the name of a target to execute |
|
35
|
|
|
*/ |
|
36
|
1 |
|
public function setTarget($target) |
|
37
|
|
|
{ |
|
38
|
1 |
|
$this->target = $target; |
|
|
|
|
|
|
39
|
1 |
|
} |
|
40
|
|
|
|
|
41
|
|
|
/** |
|
42
|
|
|
* execute the target |
|
43
|
|
|
* |
|
44
|
|
|
* @throws BuildException if a target is not specified |
|
45
|
|
|
*/ |
|
46
|
1 |
|
public function main() |
|
47
|
|
|
{ |
|
48
|
1 |
|
if ($this->target == null) { |
|
49
|
|
|
throw new BuildException('target property required'); |
|
50
|
|
|
} |
|
51
|
|
|
|
|
52
|
1 |
|
$this->getProject()->executeTarget($this->target); |
|
53
|
1 |
|
} |
|
54
|
|
|
} |
|
55
|
|
|
|
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..