diff --git a/etc/default.tasks.properties b/etc/default.tasks.properties index 0701544b7c..6b90bd2682 100644 --- a/etc/default.tasks.properties +++ b/etc/default.tasks.properties @@ -89,31 +89,31 @@ xmlproperty=Phing\Task\System\XmlPropertyTask package-as-path=Phing\Task\System\PackageAsPathTask ; "ext" tasks -mail=phing.tasks.ext.MailTask +mail=Phing\Task\Optional\MailTask +xmllint=Phing\Task\Optional\XmlLintTask +jsllint=Phing\Task\Optional\JslLintTask +phpcs=Phing\Task\Optional\PhpCSTask +patch=Phing\Task\Optional\PatchTask +rST=Phing\Task\Optional\RSTTask +parallel=Phing\Task\Optional\ParallelTask +filesync=Phing\Task\Optional\FileSyncTask +composer=Phing\Task\Optional\ComposerTask +notifysend=Phing\Task\Optional\NotifySendTask +growlnotify=Phing\Task\Optional\GrowlNotifyTask +wikipublish=Phing\Task\Optional\WikiPublishTask +stopwatch=Phing\Task\Optional\StopwatchTask +phpstan=phing.tasks.ext.PHPStanTask phpunit=phing.tasks.ext.phpunit.PHPUnitTask phpunitreport=phing.tasks.ext.phpunit.PHPUnitReportTask -xmllint=phing.tasks.ext.XmlLintTask -jsllint=phing.tasks.ext.JslLintTask -phpcs=phing.tasks.ext.PhpCSTask phpcpd=phing.tasks.ext.phpcpd.PHPCPDTask phploc=phing.tasks.ext.phploc.PHPLocTask phpmd=phing.tasks.ext.phpmd.PHPMDTask phpdepend=phing.tasks.ext.pdepend.PhpDependTask -filesync=phing.tasks.ext.FileSyncTask -patch=phing.tasks.ext.PatchTask s3get=phing.tasks.ext.Service.Amazon.S3.S3GetTask s3put=phing.tasks.ext.Service.Amazon.S3.S3PutTask zendguardencode=phing.tasks.ext.zendguard.ZendGuardEncodeTask zendguardlicense=phing.tasks.ext.zendguard.ZendGuardLicenseTask -rST=phing.tasks.ext.RSTTask sass=phing.tasks.ext.sass.SassTask -parallel=phing.tasks.ext.ParallelTask symfonyconsole=phing.tasks.ext.SymfonyConsole.SymfonyConsoleTask -composer=phing.tasks.ext.ComposerTask -notifysend=phing.tasks.ext.NotifySendTask -growlnotify=phing.tasks.ext.GrowlNotifyTask -wikipublish=phing.tasks.ext.WikiPublishTask -stopwatch=phing.tasks.ext.StopwatchTask sonar=phing.tasks.ext.sonar.SonarTask hipchat=phing.tasks.ext.hipchat.HipchatTask -phpstan=phing.tasks.ext.PHPStanTask diff --git a/classes/phing/tasks/ext/ComposerTask.php b/src/Phing/Task/Optional/ComposerTask.php similarity index 99% rename from classes/phing/tasks/ext/ComposerTask.php rename to src/Phing/Task/Optional/ComposerTask.php index 377e75e02e..4705090a14 100644 --- a/classes/phing/tasks/ext/ComposerTask.php +++ b/src/Phing/Task/Optional/ComposerTask.php @@ -17,6 +17,8 @@ * . */ +namespace Phing\Task\Optional; + use Phing\Exception\BuildException; use Phing\Io\FileSystem; use Phing\Io\IOException; @@ -24,6 +26,7 @@ use Phing\Task; use Phing\Type\Commandline; use Phing\Type\CommandlineArgument; +use SplFileInfo; /** * Composer Task diff --git a/classes/phing/tasks/ext/FileSyncTask.php b/src/Phing/Task/Optional/FileSyncTask.php similarity index 96% rename from classes/phing/tasks/ext/FileSyncTask.php rename to src/Phing/Task/Optional/FileSyncTask.php index 212f70608e..ef67c18bb9 100644 --- a/classes/phing/tasks/ext/FileSyncTask.php +++ b/src/Phing/Task/Optional/FileSyncTask.php @@ -17,6 +17,8 @@ * . */ +namespace Phing\Task\Optional; + use Phing\Exception\BuildException; use Phing\Project; use Phing\Task; @@ -346,7 +348,7 @@ public function getCommand() /** * Returns an error message based on a given error code. * - * @param int $code Error code + * @param int $code Error code * @return null|string */ public function getErrorMessage($code) @@ -381,7 +383,7 @@ public function getErrorMessage($code) /** * Sets the path to the rsync command. * - * @param string $path + * @param string $path * @return void */ public function setRsyncPath($path) @@ -392,7 +394,7 @@ public function setRsyncPath($path) /** * Sets the isRemoteConnection property. * - * @param boolean $isRemote + * @param boolean $isRemote * @return void */ protected function setIsRemoteConnection($isRemote) @@ -403,7 +405,7 @@ protected function setIsRemoteConnection($isRemote) /** * Sets the source directory. * - * @param string $dir + * @param string $dir * @return void */ public function setSourceDir($dir) @@ -414,7 +416,7 @@ public function setSourceDir($dir) /** * Sets the command options. * - * @param string $options + * @param string $options * @return void */ public function setOptions($options) @@ -426,7 +428,7 @@ public function setOptions($options) * Sets the destination directory. If the option remotehost is not included * in the build.xml file, rsync will point to a local directory instead. * - * @param string $dir + * @param string $dir * @return void */ public function setDestinationDir($dir) @@ -437,7 +439,7 @@ public function setDestinationDir($dir) /** * Sets the remote host. * - * @param string $host + * @param string $host * @return void */ public function setRemoteHost($host) @@ -449,7 +451,7 @@ public function setRemoteHost($host) * Specifies the user to log in as on the remote machine. This also may be * specified in the properties file. * - * @param string $user + * @param string $user * @return void */ public function setRemoteUser($user) @@ -462,7 +464,7 @@ public function setRemoteUser($user) * daemon. Note that this option is only useful when accessing an rsync daemon * using the built in transport, not when using a remote shell as the transport. * - * @param string $pass + * @param string $pass * @return void */ public function setRemotePass($pass) @@ -476,7 +478,7 @@ public function setRemotePass($pass) * rsync is configured to use ssh by default, but you may prefer to use rsh * on a local network. * - * @param string $shell + * @param string $shell * @return void */ public function setRemoteShell($shell) @@ -490,7 +492,7 @@ public function setRemoteShell($shell) * information about what files are being transferred and a brief summary at * the end. * - * @param boolean $verbose + * @param boolean $verbose * @return void */ public function setVerbose(bool $verbose) @@ -504,7 +506,7 @@ public function setVerbose(bool $verbose) * size and time of last modification match between the sender and receiver. * This option changes this to compare a 128-bit checksum for each file that has a matching size. * - * @param boolean $checksum + * @param boolean $checksum * @return void */ public function setChecksum(bool $checksum) @@ -517,7 +519,7 @@ public function setChecksum(bool $checksum) * output as a real run). It is most commonly used in combination with the -v, --verbose and/or * -i, --itemize-changes options to see what an rsync command is going to do before one actually runs it. * - * @param boolean $dryRun + * @param boolean $dryRun * @return void */ public function setDryRun(bool $dryRun) @@ -528,7 +530,7 @@ public function setDryRun(bool $dryRun) /** * Requests a simple itemized list of the changes that are being made to each file, including attribute changes. * - * @param boolean $itemizeChanges + * @param boolean $itemizeChanges * @return void */ public function setItemizeChanges(bool $itemizeChanges) @@ -541,7 +543,7 @@ public function setItemizeChanges(bool $itemizeChanges) * for the directories that are being synchronized. Files that are excluded * from transfer are also excluded from being deleted. * - * @param boolean $delete + * @param boolean $delete * @return void */ public function setDelete(bool $delete) @@ -553,7 +555,7 @@ public function setDelete(bool $delete) * Exclude files matching patterns from $file, Blank lines in $file and * lines starting with ';' or '#' are ignored. * - * @param string $file + * @param string $file * @return void */ public function setExcludeFile($file) @@ -564,7 +566,7 @@ public function setExcludeFile($file) /** * Makes backups into hierarchy based in $dir. * - * @param string dir + * @param string dir * @return void */ public function setBackupDir($dir) @@ -575,7 +577,7 @@ public function setBackupDir($dir) /** * Sets the identity file for public key transfers. * - * @param string location of ssh identity file + * @param string location of ssh identity file * @return void */ public function setIdentityFile($identity) @@ -596,7 +598,7 @@ public function setRemotePort($remotePort) /** * Sets exclude matching pattern. * - * @param string $exclude + * @param string $exclude * @return void */ public function setExclude($exclude) diff --git a/classes/phing/tasks/ext/GrowlNotifyTask.php b/src/Phing/Task/Optional/GrowlNotifyTask.php similarity index 99% rename from classes/phing/tasks/ext/GrowlNotifyTask.php rename to src/Phing/Task/Optional/GrowlNotifyTask.php index dc51a6fd3a..7479abb7ac 100644 --- a/classes/phing/tasks/ext/GrowlNotifyTask.php +++ b/src/Phing/Task/Optional/GrowlNotifyTask.php @@ -38,6 +38,10 @@ * @link https://github.com/llaville/phing-GrowlNotifyTask */ +namespace Phing\Task\Optional; + +use Net_Growl; +use Net_Growl_Exception; use Phing\Exception\BuildException; use Phing\Project; use Phing\Task; diff --git a/classes/phing/tasks/ext/JslLintTask.php b/src/Phing/Task/Optional/JslLintTask.php similarity index 99% rename from classes/phing/tasks/ext/JslLintTask.php rename to src/Phing/Task/Optional/JslLintTask.php index e1f3d3d954..6e0d3fb956 100644 --- a/classes/phing/tasks/ext/JslLintTask.php +++ b/src/Phing/Task/Optional/JslLintTask.php @@ -17,6 +17,8 @@ * . */ +namespace Phing\Task\Optional; + use Phing\Exception\BuildException; use Phing\Io\FileWriter; use Phing\Io\File; @@ -249,9 +251,9 @@ public function main() * * @param string $file * + * @return bool|void * @throws BuildException * - * @return bool|void */ protected function lint($file) { diff --git a/classes/phing/tasks/ext/MailTask.php b/src/Phing/Task/Optional/MailTask.php similarity index 99% rename from classes/phing/tasks/ext/MailTask.php rename to src/Phing/Task/Optional/MailTask.php index b1f9621042..ee1638c20f 100644 --- a/classes/phing/tasks/ext/MailTask.php +++ b/src/Phing/Task/Optional/MailTask.php @@ -17,6 +17,8 @@ * . */ +namespace Phing\Task\Optional; + use Phing\Exception\BuildException; use Phing\Task; use Phing\Type\Element\FileSetAware; diff --git a/classes/phing/tasks/ext/NotifySendTask.php b/src/Phing/Task/Optional/NotifySendTask.php similarity index 99% rename from classes/phing/tasks/ext/NotifySendTask.php rename to src/Phing/Task/Optional/NotifySendTask.php index ff8e69a7f8..18b7c7ae22 100644 --- a/classes/phing/tasks/ext/NotifySendTask.php +++ b/src/Phing/Task/Optional/NotifySendTask.php @@ -11,6 +11,8 @@ * @link https://github.com/kenguest/Phing-NotifySendTask */ +namespace Phing\Task\Optional; + use Phing\Exception\BuildException; use Phing\Io\FileSystem; use Phing\Io\File; @@ -122,8 +124,8 @@ public function getMsg() /** * The main entry point method. * - * @throws BuildException * @return void + * @throws BuildException */ public function main() { diff --git a/classes/phing/tasks/ext/ParallelTask.php b/src/Phing/Task/Optional/ParallelTask.php similarity index 98% rename from classes/phing/tasks/ext/ParallelTask.php rename to src/Phing/Task/Optional/ParallelTask.php index b8c5ca2d3c..1e4d7c18ad 100644 --- a/classes/phing/tasks/ext/ParallelTask.php +++ b/src/Phing/Task/Optional/ParallelTask.php @@ -19,6 +19,9 @@ * @package phing.tasks.ext */ +namespace Phing\Task\Optional; + +use MehrAlsNix; use Phing\Exception\BuildException; use Phing\Task\System\SequentialTask; diff --git a/classes/phing/tasks/ext/PatchTask.php b/src/Phing/Task/Optional/PatchTask.php similarity index 92% rename from classes/phing/tasks/ext/PatchTask.php rename to src/Phing/Task/Optional/PatchTask.php index 9e41655ce1..553a1d5b06 100644 --- a/classes/phing/tasks/ext/PatchTask.php +++ b/src/Phing/Task/Optional/PatchTask.php @@ -22,6 +22,8 @@ * limitations under the License. */ +namespace Phing\Task\Optional; + use Phing\Exception\BuildException; use Phing\Io\IOException; use Phing\Io\File; @@ -81,7 +83,7 @@ public function __construct() * * Required. * - * @param File $file File containing the diff output + * @param File $file File containing the diff output * @return void * @throws BuildException if $file not exists */ @@ -124,7 +126,7 @@ public function setIgnorewhitespace($ignore) * * Optional if it can be inferred from the diff file. * - * @param File $file File to patch + * @param File $file File to patch * @return void */ public function setOriginalFile(File $file) @@ -138,7 +140,7 @@ public function setOriginalFile(File $file) * * Optional. * - * @param File $file File to send the output to + * @param File $file File to send the output to * @return void */ public function setDestFile(File $file) @@ -153,7 +155,7 @@ public function setDestFile(File $file) * * patch's --strip option. * - * @param int $num number of lines to strip + * @param int $num number of lines to strip * @return void * @throws BuildException if num is < 0, or other errors */ @@ -171,7 +173,7 @@ public function setStrip($num) * * Optional, default - false * - * @param bool $flag If true suppress set the -s option on the patch command + * @param bool $flag If true suppress set the -s option on the patch command * @return void */ public function setQuiet($flag) @@ -186,7 +188,7 @@ public function setQuiet($flag) * * Optional, default - false * - * @param bool $flag If true set the -R option on the patch command + * @param bool $flag If true set the -R option on the patch command * @return void */ public function setReverse($flag) @@ -201,7 +203,7 @@ public function setReverse($flag) * * Defaults to the project's base directory. * - * @param File $directory Directory to run the patch command in + * @param File $directory Directory to run the patch command in * @return void */ public function setDir(File $directory) @@ -212,7 +214,7 @@ public function setDir(File $directory) /** * Ignore patches that seem to be reversed or already applied * - * @param bool $flag If true set the -N (--forward) option + * @param bool $flag If true set the -N (--forward) option * @return void */ public function setForward($flag) @@ -227,7 +229,7 @@ public function setForward($flag) * * Defaults to 0 * - * @param string $value Value of a fuzz factor + * @param string $value Value of a fuzz factor * @return void */ public function setFuzz($value) @@ -241,7 +243,7 @@ public function setFuzz($value) * * The default is "false" * - * @param bool $value "true" if it should halt, otherwise "false" + * @param bool $value "true" if it should halt, otherwise "false" * @return void */ public function setFailOnError($value) diff --git a/classes/phing/tasks/ext/PhpCSTask.php b/src/Phing/Task/Optional/PhpCSTask.php similarity index 99% rename from classes/phing/tasks/ext/PhpCSTask.php rename to src/Phing/Task/Optional/PhpCSTask.php index f17f4da535..fe87609e94 100644 --- a/classes/phing/tasks/ext/PhpCSTask.php +++ b/src/Phing/Task/Optional/PhpCSTask.php @@ -17,6 +17,8 @@ * . */ +namespace Phing\Task\Optional; + use Phing\Exception\BuildException; use Phing\Io\File; use Phing\Task; diff --git a/classes/phing/tasks/ext/RSTTask.php b/src/Phing/Task/Optional/RSTTask.php similarity index 99% rename from classes/phing/tasks/ext/RSTTask.php rename to src/Phing/Task/Optional/RSTTask.php index 10202c6e7c..68b8e96478 100644 --- a/classes/phing/tasks/ext/RSTTask.php +++ b/src/Phing/Task/Optional/RSTTask.php @@ -11,6 +11,8 @@ * @link http://www.phing.info/ */ +namespace Phing\Task\Optional; + use Phing\Exception\BuildException; use Phing\Io\FileSystem; use Phing\Io\FileUtils; @@ -145,8 +147,8 @@ public function __construct() /** * The main entry point method. * - * @throws BuildException * @return void + * @throws BuildException */ public function main() { @@ -398,10 +400,10 @@ public function setToolparam($param) * The setter for the attribute "toolpath" * * @param $path + * @return void * @throws BuildException * @internal param string $param Full path to tool path, i.e. /usr/local/bin/rst2html * - * @return void */ public function setToolpath($path) { diff --git a/classes/phing/tasks/ext/StopwatchTask.php b/src/Phing/Task/Optional/StopwatchTask.php similarity index 99% rename from classes/phing/tasks/ext/StopwatchTask.php rename to src/Phing/Task/Optional/StopwatchTask.php index 98cdc0d3a0..78770b7c72 100644 --- a/classes/phing/tasks/ext/StopwatchTask.php +++ b/src/Phing/Task/Optional/StopwatchTask.php @@ -17,6 +17,8 @@ * . */ +namespace Phing\Task\Optional; + use Phing\Dispatch\DispatchTask; use Phing\Exception\BuildException; use Phing\Project; diff --git a/classes/phing/tasks/ext/WikiPublishTask.php b/src/Phing/Task/Optional/WikiPublishTask.php similarity index 99% rename from classes/phing/tasks/ext/WikiPublishTask.php rename to src/Phing/Task/Optional/WikiPublishTask.php index 9fcc1e8572..4c2c79e9b1 100644 --- a/classes/phing/tasks/ext/WikiPublishTask.php +++ b/src/Phing/Task/Optional/WikiPublishTask.php @@ -17,6 +17,8 @@ * . */ +namespace Phing\Task\Optional; + use Phing\Exception\BuildException; use Phing\Io\FileUtils; use Phing\Task; diff --git a/classes/phing/tasks/ext/XmlLintTask.php b/src/Phing/Task/Optional/XmlLintTask.php similarity index 99% rename from classes/phing/tasks/ext/XmlLintTask.php rename to src/Phing/Task/Optional/XmlLintTask.php index f40f22b8c9..83397cdae3 100644 --- a/classes/phing/tasks/ext/XmlLintTask.php +++ b/src/Phing/Task/Optional/XmlLintTask.php @@ -17,6 +17,9 @@ * . */ +namespace Phing\Task\Optional; + +use DOMDocument; use Phing\Exception\BuildException; use Phing\Io\File; use Phing\Project; @@ -86,9 +89,9 @@ public function setHaltonfailure(bool $haltonfailure) * * {@inheritdoc} * + * @return void * @throws BuildException * - * @return void */ public function main() { diff --git a/tests/Phing/Task/Optional/ComposerTaskTest.php b/tests/Phing/Task/Optional/ComposerTaskTest.php index c0304aeabc..61cbd976af 100644 --- a/tests/Phing/Task/Optional/ComposerTaskTest.php +++ b/tests/Phing/Task/Optional/ComposerTaskTest.php @@ -19,7 +19,7 @@ namespace Phing\Task\Optional; -use ComposerTask; +use Phing\Task\Optional\ComposerTask; use Phing\Io\FileSystem; use Phing\Project; use Phing\Type\CommandlineArgument; @@ -87,7 +87,7 @@ public function testSetComposer() $o = $this->object; $o->setComposer($composer); - $prop = new ReflectionProperty('ComposerTask', 'composer'); + $prop = new ReflectionProperty(ComposerTask::class, 'composer'); $prop->setAccessible(true); $this->assertEquals($composer, $prop->getValue($o)); @@ -103,7 +103,7 @@ public function testGetComposerNotOnPath() $orgPath = getenv("PATH"); - $prop = new ReflectionProperty('ComposerTask', 'composer'); + $prop = new ReflectionProperty(ComposerTask::class, 'composer'); $prop->setAccessible(true); $prop->setValue($o, $composer); @@ -156,7 +156,7 @@ public function testMultipleCalls() $o->setCommand('install'); $o->createArg()->setValue('--dry-run'); $composer = $o->getComposer(); - $method = new ReflectionMethod('ComposerTask', 'prepareCommandLine'); + $method = new ReflectionMethod(ComposerTask::class, 'prepareCommandLine'); $method->setAccessible(true); $this->assertEquals('php ' . $composer . ' install --dry-run', (string) $method->invoke($o)); $o->setCommand('update'); diff --git a/tests/Phing/Task/Optional/GrowlNotifyTaskErrorTest.php b/tests/Phing/Task/Optional/GrowlNotifyTaskErrorTest.php index ca05715018..7682e54b57 100644 --- a/tests/Phing/Task/Optional/GrowlNotifyTaskErrorTest.php +++ b/tests/Phing/Task/Optional/GrowlNotifyTaskErrorTest.php @@ -39,7 +39,7 @@ namespace Phing\Task\Optional; -use GrowlNotifyTask; +use Phing\Task\Optional\GrowlNotifyTask; use Net_Growl; use Phing\Exception\BuildException; use Phing\Support\BuildFileTest; diff --git a/tests/Phing/Task/Optional/GrowlNotifyTaskTest.php b/tests/Phing/Task/Optional/GrowlNotifyTaskTest.php index 006de3c673..61c01ed054 100644 --- a/tests/Phing/Task/Optional/GrowlNotifyTaskTest.php +++ b/tests/Phing/Task/Optional/GrowlNotifyTaskTest.php @@ -39,7 +39,7 @@ namespace Phing\Task\Optional; -use GrowlNotifyTask; +use Phing\Task\Optional\GrowlNotifyTask; use Net_Growl; use Phing\Exception\BuildException; use Phing\Project; diff --git a/tests/Phing/Task/Optional/NotifySendTaskTest.php b/tests/Phing/Task/Optional/NotifySendTaskTest.php index 688fb71d95..5e2816a28b 100644 --- a/tests/Phing/Task/Optional/NotifySendTaskTest.php +++ b/tests/Phing/Task/Optional/NotifySendTaskTest.php @@ -2,7 +2,7 @@ namespace Phing\Task\Optional; -use NotifySendTask; +use Phing\Task\Optional\NotifySendTask; use Phing\Project; use Phing\Support\BuildFileTest; diff --git a/tests/Phing/Task/Optional/RSTTaskTest.php b/tests/Phing/Task/Optional/RSTTaskTest.php index 89be5f7348..7d313c98da 100644 --- a/tests/Phing/Task/Optional/RSTTaskTest.php +++ b/tests/Phing/Task/Optional/RSTTaskTest.php @@ -23,7 +23,7 @@ use Phing\Support\BuildFileTest; use ReflectionClass; use ReflectionException; -use RSTTask; +use Phing\Task\Optional\RSTTask; /** * Unit test for reStructuredText rendering task. diff --git a/tests/Phing/Task/Optional/WikiPublishTaskTest.php b/tests/Phing/Task/Optional/WikiPublishTaskTest.php index 3815c38c25..06421f0461 100644 --- a/tests/Phing/Task/Optional/WikiPublishTaskTest.php +++ b/tests/Phing/Task/Optional/WikiPublishTaskTest.php @@ -21,7 +21,7 @@ use Phing\Exception\BuildException; use Phing\Support\BuildFileTest; -use WikiPublishTask; +use Phing\Task\Optional\WikiPublishTask; /** * WikiPublish task test @@ -89,7 +89,7 @@ public function testInvalidAttributes() */ private function getWikiPublishMock() { - $result = $this->getMockBuilder('WikiPublishTask'); + $result = $this->getMockBuilder(WikiPublishTask::class); return $result->onlyMethods(['callApi'])->getMock(); }