From 592d2f9708bedcf5ef21b02c185c86292c738735 Mon Sep 17 00:00:00 2001 From: davidcallizaya Date: Fri, 4 Aug 2017 17:46:30 -0400 Subject: [PATCH] HOR-3620 Fix ambiguos AbstractTask from phing --- thirdparty/phing/BuildEvent.php | 2 +- thirdparty/phing/PhingTask.php | 266 ------------------ thirdparty/phing/UnknownElement.php | 2 +- thirdparty/phing/parser/TaskHandler.php | 2 +- .../phing/tasks/system/SequentialTask.php | 2 +- thirdparty/phing/util/SourceFileScanner.php | 2 +- 6 files changed, 5 insertions(+), 271 deletions(-) delete mode 100644 thirdparty/phing/PhingTask.php diff --git a/thirdparty/phing/BuildEvent.php b/thirdparty/phing/BuildEvent.php index 6738fcdd6..2a9548c9e 100644 --- a/thirdparty/phing/BuildEvent.php +++ b/thirdparty/phing/BuildEvent.php @@ -57,7 +57,7 @@ class BuildEvent extends EventObject { /** * A reference to the task * - * @var PhingTask + * @var AbstractTask */ protected $task; diff --git a/thirdparty/phing/PhingTask.php b/thirdparty/phing/PhingTask.php deleted file mode 100644 index 924bbcbb1..000000000 --- a/thirdparty/phing/PhingTask.php +++ /dev/null @@ -1,266 +0,0 @@ -. - */ - -require_once 'phing/ProjectComponent.php'; -include_once 'phing/RuntimeConfigurable.php'; - -/** - * The base class for all Tasks. - * - * Use {@link Project#createTask} to register a new Task. - * - * @author Andreas Aderhold - * @copyright © 2001,2002 THYRELL. All rights reserved - * @version $Revision: 1.11 $ - * @see Project#createTask() - * @package phing - */ -abstract class PhingTask extends ProjectComponent { - - /** owning Target object */ - protected $target; - - /** description of the task */ - protected $description; - - /** internal taskname (req) */ - protected $taskType; - - /** taskname for logger */ - protected $taskName; - - /** stored buildfile location */ - protected $location; - - /** wrapper of the task */ - protected $wrapper; - - /** - * Sets the owning target this task belongs to. - * - * @param object Reference to owning target - * @access public - */ - function setOwningTarget(Target $target) { - $this->target = $target; - } - - /** - * Returns the owning target of this task. - * - * @return object The target object that owns this task - * @access public - */ - function getOwningTarget() { - return $this->target; - } - - /** - * Returns the name of task, used only for log messages - * - * @return string Name of this task - * @access public - */ - function getTaskName() { - if ($this->taskName === null) { - // if no task name is set, then it's possible - // this task was created from within another task. We don't - // therefore know the XML tag name for this task, so we'll just - // use the class name stripped of "task" suffix. This is only - // for log messages, so we don't have to worry much about accuracy. - return preg_replace('/task$/i', '', get_class($this)); - } - return $this->taskName; - } - - /** - * Sets the name of this task for log messages - * - * @return string A string representing the name of this task for log - * @access public - */ - function setTaskName($name) { - $this->taskName = (string) $name; - } - - /** - * Returns the name of the task under which it was invoked, - * usually the XML tagname - * - * @return string The type of this task (XML Tag) - */ - function getTaskType() { - return $this->taskType; - } - - /** - * Sets the type of the task. Usually this is the name of the XML tag - * - * @param string The type of this task (XML Tag) - */ - function setTaskType($name) { - $this->taskType = (string) $name; - } - - /** - * Returns a name - * - */ - protected function getRegisterSlot($slotName) { - return Register::getSlot('task.' . $this->getTaskName() . '.' . $slotName); - } - - /** - * Provides a project level log event to the task. - * - * @param string The message to log - * @param integer The priority of the message - * @see BuildEvent - * @see BuildListener - */ - function log($msg, $level = PROJECT_MSG_INFO) { - $this->project->logObject($this, $msg, $level); - } - - /** - * Sets a textual description of the task - * - * @param string The text describing the task - */ - public function setDescription($desc) { - $this->description = $desc; - } - - /** - * Returns the textual description of the task - * - * @return string The text description of the task - */ - public function getDescription() { - return $this->description; - } - - /** - * Called by the parser to let the task initialize properly. - * Should throw a BuildException if something goes wrong with the build - * - * This is abstract here, but may not be overloaded by subclasses. - * - * @throws BuildException - */ - public function init() { - } - - /** - * Called by the project to let the task do it's work. This method may be - * called more than once, if the task is invoked more than once. For - * example, if target1 and target2 both depend on target3, then running - * phing target1 target2 will run all tasks in target3 twice. - * - * Should throw a BuildException if someting goes wrong with the build - * - * This is abstract here. Must be overloaded by real tasks. - * - * @access public - */ - abstract function main(); - - /** - * Returns the location within the buildfile this task occurs. Used - * by {@link BuildException} to give detailed error messages. - * - * @return Location The location object describing the position of this - * task within the buildfile. - */ - function getLocation() { - return $this->location; - } - - /** - * Sets the location within the buildfile this task occurs. Called by - * the parser to set location information. - * - * @return object The location object describing the position of this - * task within the buildfile. - * @access public - */ - function setLocation(Location $location) { - $this->location = $location; - } - - /** - * Returns the wrapper object for runtime configuration - * - * @return object The wrapper object used by this task - * @access public - */ - function getRuntimeConfigurableWrapper() { - if ($this->wrapper === null) { - $this->wrapper = new RuntimeConfigurable($this, $this->getTaskName()); - } - return $this->wrapper; - } - - /** - * Sets the wrapper object this task should use for runtime - * configurable elements. - * - * @param object The wrapper object this task should use - * @access public - */ - function setRuntimeConfigurableWrapper(RuntimeConfigurable $wrapper) { - $this->wrapper = $wrapper; - } - - /** - * Configure this task if it hasn't been done already. - * - * @access public - */ - function maybeConfigure() { - if ($this->wrapper !== null) { - $this->wrapper->maybeConfigure($this->project); - } - } - - /** - * Perfrom this task - * - * @access public - */ - function perform() { - - try { // try executing task - $this->project->fireTaskStarted($this); - $this->maybeConfigure(); - $this->main(); - $this->project->fireTaskFinished($this, $null=null); - } catch (Exception $exc) { - if ($exc instanceof BuildException) { - if ($exc->getLocation() === null) { - $exc->setLocation($this->getLocation()); - } - } - $this->project->fireTaskFinished($this, $exc); - throw $exc; - } - } -} diff --git a/thirdparty/phing/UnknownElement.php b/thirdparty/phing/UnknownElement.php index 244e10926..95daa0e0b 100644 --- a/thirdparty/phing/UnknownElement.php +++ b/thirdparty/phing/UnknownElement.php @@ -171,7 +171,7 @@ class UnknownElement extends TaskPhing { * @param UnknownElement $ue The unknwon element to create a task from * @param RuntimeConfigurable $w The wrapper object * @param boolean $onTopLevel Whether to treat this task as if it is top-level. - * @return PhingTask The freshly created task + * @return AbstractTask The freshly created task */ protected function makeTask(UnknownElement $ue, RuntimeConfigurable $w, $onTopLevel = false) { diff --git a/thirdparty/phing/parser/TaskHandler.php b/thirdparty/phing/parser/TaskHandler.php index 5f6f6ad80..16d162b74 100644 --- a/thirdparty/phing/parser/TaskHandler.php +++ b/thirdparty/phing/parser/TaskHandler.php @@ -52,7 +52,7 @@ class TaskHandler extends AbstractHandler { /** * Reference to the task object that represents the currently parsed * target. - * @var PhingTask + * @var AbstractTask */ private $task; diff --git a/thirdparty/phing/tasks/system/SequentialTask.php b/thirdparty/phing/tasks/system/SequentialTask.php index cbc0229e4..0fe3a25da 100644 --- a/thirdparty/phing/tasks/system/SequentialTask.php +++ b/thirdparty/phing/tasks/system/SequentialTask.php @@ -39,7 +39,7 @@ class SequentialTask extends TaskPhing implements TaskContainer { /** * Add a nested task to Sequential. - * @param PhingTask $nestedTask Nested task to execute Sequential + * @param AbstractTask $nestedTask Nested task to execute Sequential */ public function addTask(TaskPhing $nestedTask) { $this->nestedTasks[] = $nestedTask; diff --git a/thirdparty/phing/util/SourceFileScanner.php b/thirdparty/phing/util/SourceFileScanner.php index d737157cf..883959601 100644 --- a/thirdparty/phing/util/SourceFileScanner.php +++ b/thirdparty/phing/util/SourceFileScanner.php @@ -37,7 +37,7 @@ class SourceFileScanner { private $task; /** - * @param PhingTask The task we should log messages through + * @param AbstractTask The task we should log messages through */ function __construct($task) { $this->task = $task;