From 1b01b241aeec9fd7688a8263cbb00a972e894652 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Fri, 4 Dec 2009 16:31:04 +0000 Subject: - Patch #648744 by Crell: specified more @return type definitions for auto-completion in IDEs. --- includes/filetransfer/filetransfer.inc | 15 ++++++++------- includes/filetransfer/ftp.inc | 8 ++++---- 2 files changed, 12 insertions(+), 11 deletions(-) (limited to 'includes/filetransfer') diff --git a/includes/filetransfer/filetransfer.inc b/includes/filetransfer/filetransfer.inc index f9182497b..cdd6e2cbf 100644 --- a/includes/filetransfer/filetransfer.inc +++ b/includes/filetransfer/filetransfer.inc @@ -27,10 +27,11 @@ abstract class FileTransfer { abstract static function factory($jail, $settings); /** - * Implementation of the magic __get() method. If the connection isn't set to - * anything, this will call the connect() method and set it to and return the - * result; afterwards, the connection will be returned directly without using - * this method. + * Implementation of the magic __get() method. + * + * If the connection isn't set to anything, this will call the connect() method + * and set it to and return the result; afterwards, the connection will be + * returned directly without using this method. */ function __get($name) { if ($name == 'connection') { @@ -80,7 +81,7 @@ abstract class FileTransfer { $this->checkPath($path); $this->chmodJailed($path, $mode, $recursive); } - + /** * Creates a directory. * @@ -156,7 +157,7 @@ abstract class FileTransfer { * @param $path * @param $strip_chroot * - * @return string; + * @return string */ protected final function fixRemotePath($path, $strip_chroot = TRUE) { $path = $this->sanitizePath($path); @@ -173,7 +174,7 @@ abstract class FileTransfer { * Changes backslahes to slashes, also removes a trailing slash. * * @param string $path - * @return string; + * @return string */ function sanitizePath($path) { $path = str_replace('\\', '/', $path); // Windows path sanitiation. diff --git a/includes/filetransfer/ftp.inc b/includes/filetransfer/ftp.inc index e4d83bcc9..d392e16cb 100644 --- a/includes/filetransfer/ftp.inc +++ b/includes/filetransfer/ftp.inc @@ -5,7 +5,7 @@ * Base class for FTP implementations. */ abstract class FileTransferFTP extends FileTransfer { - + public function __construct($jail, $username, $password, $hostname, $port) { $this->username = $username; $this->password = $password; @@ -19,7 +19,7 @@ abstract class FileTransferFTP extends FileTransfer { * * @param string $jail * @param array $settings - * @return + * @return FileTransferFTP * The appropriate FileTransferFTP subclass based on the available * options. If the FTP PHP extension is available, use it. Otherwise, we * try to use the FTP file stream support. @@ -27,7 +27,7 @@ abstract class FileTransferFTP extends FileTransfer { static function factory($jail, $settings) { $settings['hostname'] = empty($settings['hostname']) ? 'localhost' : $settings['hostname']; $settings['port'] = empty($settings['port']) ? 21 : $settings['port']; - + if (function_exists('ftp_connect')) { $class = 'FileTransferFTPExtension'; } @@ -46,7 +46,7 @@ abstract class FileTransferFTP extends FileTransfer { * Connection class using the FTP URL wrapper. */ class FileTransferFTPWrapper extends FileTransferFTP { - + function connect() { $this->connection = 'ftp://' . urlencode($this->username) . ':' . urlencode($this->password) . '@' . $this->hostname . ':' . $this->port . '/'; if (!is_dir($this->connection)) { -- cgit v1.2.3