From 32f01c546c44db025636fa665b834b40bdfef940 Mon Sep 17 00:00:00 2001 From: Damyon Wiese Date: Fri, 24 Mar 2017 15:37:45 +0800 Subject: [PATCH] MDL-58280 fileconverter_googledrive: Fix cibot complaints --- files/converter/googledrive/classes/converter.php | 5 +++-- .../googledrive/lang/en/fileconverter_googledrive.php | 4 ++-- files/converter/googledrive/test.php | 4 ++-- lib/filelib.php | 4 ++-- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/files/converter/googledrive/classes/converter.php b/files/converter/googledrive/classes/converter.php index 13c3605f4b1b..831c20f31d8c 100644 --- a/files/converter/googledrive/classes/converter.php +++ b/files/converter/googledrive/classes/converter.php @@ -39,6 +39,7 @@ */ class converter implements \core_files\converter_interface { + /** @var array $imports List of supported import file formats */ private static $imports = [ 'doc' => 'application/vnd.google-apps.document', 'docx' => 'application/vnd.google-apps.document', @@ -49,6 +50,7 @@ class converter implements \core_files\converter_interface { 'pptx' => 'application/vnd.google-apps.presentation' ]; + /** @var array $export List of supported export file formats */ private static $exports = [ 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'rtf' => 'application/rtf', @@ -61,8 +63,7 @@ class converter implements \core_files\converter_interface { /** * Convert a document to a new format and return a conversion object relating to the conversion in progress. * - * @param conversion $conversion The file to be converted - * @param string $format The target file format + * @param \core_files\conversion $conversion The file to be converted * @return this */ public function start_document_conversion(\core_files\conversion $conversion) { diff --git a/files/converter/googledrive/lang/en/fileconverter_googledrive.php b/files/converter/googledrive/lang/en/fileconverter_googledrive.php index b796bba4f02b..f118f0ef7113 100644 --- a/files/converter/googledrive/lang/en/fileconverter_googledrive.php +++ b/files/converter/googledrive/lang/en/fileconverter_googledrive.php @@ -15,9 +15,9 @@ // along with Moodle. If not, see . /** - * Strings for plugin 'fileconverter_example' + * Strings for plugin 'fileconverter_googledrive' * - * @package fileconverter_example + * @package fileconverter_googledrive * @copyright 2017 Damyon Wiese * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/files/converter/googledrive/test.php b/files/converter/googledrive/test.php index 426d41ab422b..fa764caad90e 100644 --- a/files/converter/googledrive/test.php +++ b/files/converter/googledrive/test.php @@ -15,9 +15,9 @@ // along with Moodle. If not, see . /** - * Test that unoconv is configured correctly + * Test that googledrive is configured correctly * - * @package fileconverter_unoconv + * @package fileconverter_googledrive * @copyright 2017 Andrew Nicols * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/lib/filelib.php b/lib/filelib.php index 34434a0a90b3..b1dafb9e3a22 100644 --- a/lib/filelib.php +++ b/lib/filelib.php @@ -3607,7 +3607,7 @@ public function put($url, $params = array(), $options = array()) { $fp = false; if (isset($params['file'])) { $file = $params['file']; - if(is_file($file)) { + if (is_file($file)) { $fp = fopen($file, 'r'); $size = filesize($file); $options['CURLOPT_PUT'] = 1; @@ -3617,7 +3617,7 @@ public function put($url, $params = array(), $options = array()) { return null; } if (!isset($this->options['CURLOPT_USERPWD'])) { - $this->setopt(array('CURLOPT_USERPWD'=>'anonymous: noreply@moodle.org')); + $this->setopt(array('CURLOPT_USERPWD' => 'anonymous: noreply@moodle.org')); } } else { $options['CURLOPT_CUSTOMREQUEST'] = 'PUT';