diff --git a/classes/local/manager.php b/classes/local/manager.php index d91ba1db..5d791f97 100644 --- a/classes/local/manager.php +++ b/classes/local/manager.php @@ -28,8 +28,6 @@ use stdClass; use tool_objectfs\local\store\object_file_system; -defined('MOODLE_INTERNAL') || die(); - /** * [Description manager] */ diff --git a/classes/local/object_manipulator/candidates/candidates_factory.php b/classes/local/object_manipulator/candidates/candidates_factory.php index 40b2bc45..369589da 100644 --- a/classes/local/object_manipulator/candidates/candidates_factory.php +++ b/classes/local/object_manipulator/candidates/candidates_factory.php @@ -52,7 +52,7 @@ class candidates_factory { * Finder * @param mixed $manipulator * @param stdClass $config - * + * * @return mixed * @throws moodle_exception */ diff --git a/classes/local/object_manipulator/candidates/pusher_candidates.php b/classes/local/object_manipulator/candidates/pusher_candidates.php index a881d6d2..4c967710 100644 --- a/classes/local/object_manipulator/candidates/pusher_candidates.php +++ b/classes/local/object_manipulator/candidates/pusher_candidates.php @@ -24,8 +24,6 @@ namespace tool_objectfs\local\object_manipulator\candidates; -defined('MOODLE_INTERNAL') || die(); - /** * pusher_candidates */ diff --git a/classes/local/object_manipulator/logger.php b/classes/local/object_manipulator/logger.php index b42fc00d..9bb8e61a 100644 --- a/classes/local/object_manipulator/logger.php +++ b/classes/local/object_manipulator/logger.php @@ -81,7 +81,7 @@ public function end_timing() { /** * set_action * @param mixed $action - * + * * @return void */ public function set_action($action) { @@ -91,7 +91,7 @@ public function set_action($action) { /** * add_object_manipulation * @param int $filesize - * + * * @return void */ public function add_object_manipulation($filesize) { @@ -115,7 +115,7 @@ public function log_object_manipulation() { /** * log_object_manipulation_query * @param mixed $totalobjectsfound - * + * * @return void */ public function log_object_manipulation_query($totalobjectsfound) { diff --git a/classes/local/object_manipulator/orphaner.php b/classes/local/object_manipulator/orphaner.php index 7033c3c2..95463522 100644 --- a/classes/local/object_manipulator/orphaner.php +++ b/classes/local/object_manipulator/orphaner.php @@ -16,7 +16,7 @@ /** * Orphans records for files deleted - * + * * Orphans {tool_objectfs_objects} records for files that have been * deleted from the core {files} table. * diff --git a/classes/local/report/log_size_report_builder.php b/classes/local/report/log_size_report_builder.php index 8755237b..2295454f 100644 --- a/classes/local/report/log_size_report_builder.php +++ b/classes/local/report/log_size_report_builder.php @@ -33,7 +33,7 @@ class log_size_report_builder extends objectfs_report_builder { /** * build_report * @param int $reportid - * + * * @return objectfs_report */ public function build_report($reportid) { @@ -61,7 +61,7 @@ public function build_report($reportid) { /** * compress_small_log_sizes * @param mixed $stats - * + * * @return void */ public function compress_small_log_sizes(&$stats) { diff --git a/classes/local/report/mime_type_report_builder.php b/classes/local/report/mime_type_report_builder.php index 41ceb615..964481ba 100644 --- a/classes/local/report/mime_type_report_builder.php +++ b/classes/local/report/mime_type_report_builder.php @@ -33,7 +33,7 @@ class mime_type_report_builder extends objectfs_report_builder { /** * build_report * @param int $reportid - * + * * @return objectfs_report */ public function build_report($reportid) { diff --git a/classes/local/report/object_status_history_table.php b/classes/local/report/object_status_history_table.php index 0f71f124..31191602 100644 --- a/classes/local/report/object_status_history_table.php +++ b/classes/local/report/object_status_history_table.php @@ -54,7 +54,7 @@ class object_status_history_table extends \table_sql { /** * Constructor for the file status history table. - * + * * @param string $reporttype * @param int $reportid */ diff --git a/classes/local/report/objectfs_report_builder.php b/classes/local/report/objectfs_report_builder.php index 4983775a..dd3046f1 100644 --- a/classes/local/report/objectfs_report_builder.php +++ b/classes/local/report/objectfs_report_builder.php @@ -33,7 +33,7 @@ abstract class objectfs_report_builder { /** * build_report * @param int $reportid - * + * * @return objectfs_report */ abstract public function build_report($reportid); diff --git a/classes/local/store/azure/client.php b/classes/local/store/azure/client.php index 96dbf207..2a6e3fa4 100644 --- a/classes/local/store/azure/client.php +++ b/classes/local/store/azure/client.php @@ -174,7 +174,7 @@ private function clean_sastoken($sastoken) { /** * get_md5_from_hash * @param string $contenthash - * + * * @return string */ private function get_md5_from_hash($contenthash) { @@ -202,7 +202,7 @@ private function get_md5_from_hash($contenthash) { * verify_objectverify_object * @param string $contenthash * @param string $localpath - * + * * @return bool */ public function verify_object($contenthash, $localpath) { @@ -219,7 +219,7 @@ public function verify_object($contenthash, $localpath) { /** * get_filepath_from_hash * @param string $contenthash - * + * * @return string */ protected function get_filepath_from_hash($contenthash) { @@ -253,7 +253,7 @@ public function test_connection() { /** * test_permissions * @param mixed $testdelete - * + * * @return stdClass */ public function test_permissions($testdelete) { @@ -307,7 +307,7 @@ public function test_permissions($testdelete) { /** * get_exception_details * @param \MicrosoftAzure\Storage\Common\Exceptions\ServiceException $exception - * + * * @return string */ protected function get_exception_details(\MicrosoftAzure\Storage\Common\Exceptions\ServiceException $exception) { diff --git a/classes/local/store/azure/file_system.php b/classes/local/store/azure/file_system.php index dbdbdeaf..aa91803a 100644 --- a/classes/local/store/azure/file_system.php +++ b/classes/local/store/azure/file_system.php @@ -39,7 +39,7 @@ class file_system extends object_file_system { /** * initialise_external_client * @param mixed $config - * + * * @return client */ protected function initialise_external_client($config) { diff --git a/classes/local/store/azure/stream_wrapper.php b/classes/local/store/azure/stream_wrapper.php index 9b1230eb..47a67a87 100644 --- a/classes/local/store/azure/stream_wrapper.php +++ b/classes/local/store/azure/stream_wrapper.php @@ -91,10 +91,10 @@ public static function register(BlobRestProxy $client, $protocol = 'blob') { /** * stream_cast * @param mixed $cast_as - * + * * @return boolean */ - public function stream_cast($cast_as) { + public function stream_cast($castas) { return false; } @@ -113,10 +113,10 @@ public function stream_close() { * @param mixed $mode * @param mixed $options * @param mixed $opened_path - * + * * @return bool */ - public function stream_open($path, $mode, $options, &$opened_path) { + public function stream_open($path, $mode, $options, &$openedpath) { $this->initProtocol($path); $this->params = $this->getContainerKey($path); $this->mode = rtrim($mode, 'bt'); @@ -129,9 +129,12 @@ public function stream_open($path, $mode, $options, &$opened_path) { return $this->boolCall(function() use ($path) { switch ($this->mode) { - case 'r': return $this->openReadStream(); - case 'a': return $this->openAppendStream(); - default: return $this->openWriteStream(); + case 'r': +return $this->openReadStream(); + case 'a': +return $this->openAppendStream(); + default: +return $this->openWriteStream(); } }); } @@ -186,7 +189,7 @@ public function stream_flush() { /** * stream_read * @param int $count - * + * * @return string */ public function stream_read($count) { @@ -198,7 +201,7 @@ public function stream_read($count) { * stream_seek * @param int $offset * @param int $whence - * + * * @return bool */ public function stream_seek($offset, $whence = SEEK_SET) { @@ -215,13 +218,14 @@ public function stream_seek($offset, $whence = SEEK_SET) { * @return bool */ public function stream_tell() { - return $this->boolCall(function() { return $this->body->tell(); }); + return $this->boolCall(function() { return $this->body->tell(); + }); } /** * stream_write * @param string $data - * + * * @return int */ public function stream_write($data) { @@ -243,14 +247,14 @@ public function stream_stat() { /** * url_stat - * + * * Provides information for is_dir, is_file, filesize, etc. Works on * buckets, keys, and prefixes. * @link http://www.php.net/manual/en/streamwrapper.url-stat.php - * + * * @param string $path * @param mixed $flags - * + * * @return mixed */ public function url_stat($path, $flags) { @@ -285,7 +289,7 @@ public function url_stat($path, $flags) { * * @param string $path */ - private function initProtocol($path) { + private function initprotocol($path) { $parts = explode('://', $path, 2); $this->protocol = $parts[0] ?: 'blob'; } @@ -293,13 +297,13 @@ private function initProtocol($path) { /** * getContainerKey * @param string $path - * + * * @return array */ - private function getContainerKey($path) { - // Remove the protocol + private function getcontainerkey($path) { + // Remove the protocol. $parts = explode('://', $path); - // Get the container, key + // Get the container, key. $parts = explode('/', $parts[1], 2); return [ @@ -317,7 +321,7 @@ private function getContainerKey($path) { * of errors. * @param string $path * @param string $mode - * + * * @return [type] */ private function validate($path, $mode) { @@ -333,8 +337,7 @@ private function validate($path, $mode) { . "Use one 'r', 'w', 'a', or 'x'."; } - // When using mode "x" validate if the file exists before attempting - // to read + // When using mode "x" validate if the file exists before attempting to read. if ($mode == 'x' && $this->getClient()->getBlobProperties( $this->getOption('Container'), @@ -366,8 +369,8 @@ private function validate($path, $mode) { * * @return array */ - private function getOptions($removeContextData = false) { - // Context is not set when doing things like stat + private function getoptions($removecontextdata = false) { + // Context is not set when doing things like stat. if ($this->context === null) { $options = []; } else { @@ -383,7 +386,7 @@ private function getOptions($removeContextData = false) { : []; $result = $this->params + $options + $default; - if ($removeContextData) { + if ($removecontextdata) { unset($result['client'], $result['seekable']); } @@ -397,7 +400,7 @@ private function getOptions($removeContextData = false) { * * @return mixed|null */ - private function getOption($name) { + private function getoption($name) { $options = $this->getOptions(); return isset($options[$name]) ? $options[$name] : null; @@ -409,7 +412,7 @@ private function getOption($name) { * @return BlobRestProxy * @throws \RuntimeException if no client has been configured */ - private function getClient() { + private function getclient() { if (!$client = $this->getOption('client')) { throw new \RuntimeException('No client in stream context'); } @@ -424,7 +427,7 @@ private function getClient() { * * @return array Hash of 'Container', 'Key', and custom params from the context */ - private function withPath($path) { + private function withpath($path) { $params = $this->getOptions(true); return $this->getContainerKey($path) + $params; @@ -434,7 +437,7 @@ private function withPath($path) { * openReadStream * @return bool */ - private function openReadStream() { + private function openreadstream() { $client = $this->getClient(); $params = $this->getOptions(true); @@ -447,7 +450,7 @@ private function openReadStream() { $this->body = $response->getBody(); } - // Wrap the body in a caching entity body if seeking is allowed + // Wrap the body in a caching entity body if seeking is allowed. if ($this->getOption('seekable') && !$this->body->isSeekable()) { $this->body = new CachingStream($this->body); } @@ -459,7 +462,7 @@ private function openReadStream() { * openWriteStream * @return bool */ - private function openWriteStream() { + private function openwritestream() { $this->body = new Stream(fopen('php://temp', 'r+')); return true; } @@ -468,16 +471,16 @@ private function openWriteStream() { * openAppendStream * @return mixed */ - private function openAppendStream() { + private function openappendstream() { try { - // Get the body of the object and seek to the end of the stream + // Get the body of the object and seek to the end of the stream. $client = $this->getClient(); $params = $this->getOptions(true); $this->body = $client->getBlob($params['Container'], $params['Key']); $this->body->seek(0, SEEK_END); return true; } catch (ServiceException $e) { - // The object does not exist, so use a simple write stream + // The object does not exist, so use a simple write stream. return $this->openWriteStream(); } } @@ -487,7 +490,7 @@ private function openAppendStream() { * * @return array */ - private function getStatTemplate() { + private function getstattemplate() { return [ 0 => 0, 'dev' => 0, 1 => 0, 'ino' => 0, @@ -514,7 +517,7 @@ private function getStatTemplate() { * * @return bool */ - private function boolCall(callable $fn, $flags = null) { + private function boolcall(callable $fn, $flags = null) { try { return $fn(); } catch (\Exception $e) { @@ -532,16 +535,16 @@ private function boolCall(callable $fn, $flags = null) { * @return bool Returns false * @throws \RuntimeException if throw_errors is true */ - private function triggerError($errors, $flags = null) { - // This is triggered with things like file_exists() + private function triggererror($errors, $flags = null) { + // This is triggered with things like file_exists(). if ($flags & STREAM_URL_STAT_QUIET) { return $flags & STREAM_URL_STAT_LINK - // This is triggered for things like is_link() + // This is triggered for things like is_link(). ? $this->getStatTemplate() : false; } - // This is triggered when doing things like lstat() or stat() + // This is triggered when doing things like lstat() or stat(). trigger_error(implode("\n", (array) $errors), E_USER_WARNING); return false; @@ -552,7 +555,7 @@ private function triggerError($errors, $flags = null) { * * @return int|null */ - private function getSize() { + private function getsize() { $size = $this->body->getSize(); return $size !== null ? $size : $this->size; diff --git a/classes/local/store/digitalocean/client.php b/classes/local/store/digitalocean/client.php index 9ff1ab78..644043fe 100644 --- a/classes/local/store/digitalocean/client.php +++ b/classes/local/store/digitalocean/client.php @@ -68,7 +68,7 @@ protected function is_configured($config) { /** * set_client * @param \stdClass $config - * + * * @return void */ public function set_client($config) { diff --git a/classes/local/store/digitalocean/file_system.php b/classes/local/store/digitalocean/file_system.php index 22b064d6..5b37eaaa 100644 --- a/classes/local/store/digitalocean/file_system.php +++ b/classes/local/store/digitalocean/file_system.php @@ -42,7 +42,7 @@ class file_system extends s3_file_system { /** * initialise_external_client * @param \stdClass $config - * + * * @return client */ protected function initialise_external_client($config) { diff --git a/classes/local/store/object_client.php b/classes/local/store/object_client.php index eab340a2..3c32f1ea 100644 --- a/classes/local/store/object_client.php +++ b/classes/local/store/object_client.php @@ -42,7 +42,7 @@ public function register_stream_wrapper(); /** * get_fullpath_from_hash * @param string $contenthash - * + * * @return string */ public function get_fullpath_from_hash($contenthash); @@ -50,7 +50,7 @@ public function get_fullpath_from_hash($contenthash); /** * delete_file * @param string $fullpath - * + * * @return mixed */ public function delete_file($fullpath); @@ -59,7 +59,7 @@ public function delete_file($fullpath); * rename_file * @param string $currentpath * @param string $destinationpath - * + * * @return mixed */ public function rename_file($currentpath, $destinationpath); @@ -81,12 +81,12 @@ public function get_availability(); * @return mixed */ public function get_maximum_upload_size(); - + /** * verify_object * @param string $contenthash * @param string $localpath - * + * * @return mixed */ public function verify_object($contenthash, $localpath); @@ -95,7 +95,7 @@ public function verify_object($contenthash, $localpath); * generate_presigned_url * @param string $contenthash * @param array $headers - * + * * @return mixed */ public function generate_presigned_url($contenthash, $headers = array()); @@ -115,7 +115,7 @@ public function test_connection(); /** * test_permissions * @param mixed $testdelete - * + * * @return mixed */ public function test_permissions($testdelete); @@ -124,7 +124,7 @@ public function test_permissions($testdelete); * proxy_range_request * @param \stored_file $file * @param mixed $ranges - * + * * @return mixed */ public function proxy_range_request(\stored_file $file, $ranges); @@ -132,7 +132,7 @@ public function proxy_range_request(\stored_file $file, $ranges); /** * test_range_request * @param mixed $filesystem - * + * * @return mixed */ public function test_range_request($filesystem); diff --git a/classes/local/store/object_file_system.php b/classes/local/store/object_file_system.php index 88944b96..f66b4c4a 100644 --- a/classes/local/store/object_file_system.php +++ b/classes/local/store/object_file_system.php @@ -94,7 +94,7 @@ public function __construct() { /** * set_logger * @param \tool_objectfs\log\objectfs_logger $logger - * + * * @return void */ public function set_logger(\tool_objectfs\log\objectfs_logger $logger) { @@ -122,7 +122,7 @@ public function get_external_client() { /** * initialise_external_client * @param mixed $config - * + * * @return mixed */ abstract protected function initialise_external_client($config); @@ -167,7 +167,7 @@ protected function get_local_path_from_hash($contenthash, $fetchifnotfound = fal /** * get_remote_path_from_storedfile * @param \stored_file $file - * + * * @return string */ public function get_remote_path_from_storedfile(\stored_file $file) { @@ -177,7 +177,7 @@ public function get_remote_path_from_storedfile(\stored_file $file) { /** * get_remote_path_from_hash * @param mixed $contenthash - * + * * @return string */ protected function get_remote_path_from_hash($contenthash) { @@ -201,7 +201,7 @@ protected function get_remote_path_from_hash($contenthash) { /** * get_external_path_from_hash * @param mixed $contenthash - * + * * @return string */ protected function get_external_path_from_hash($contenthash) { @@ -211,7 +211,7 @@ protected function get_external_path_from_hash($contenthash) { /** * get_external_path_from_storedfile * @param \stored_file $file - * + * * @return string */ protected function get_external_path_from_storedfile(\stored_file $file) { @@ -221,7 +221,7 @@ protected function get_external_path_from_storedfile(\stored_file $file) { /** * is_file_readable_externally_by_storedfile * @param stored_file $file - * + * * @return bool */ public function is_file_readable_externally_by_storedfile(stored_file $file) { @@ -242,7 +242,7 @@ public function is_file_readable_externally_by_storedfile(stored_file $file) { /** * is_file_readable_externally_by_hash * @param mixed $contenthash - * + * * @return bool */ public function is_file_readable_externally_by_hash($contenthash) { @@ -261,7 +261,7 @@ public function is_file_readable_externally_by_hash($contenthash) { /** * get_object_location_from_hash * @param mixed $contenthash - * + * * @return int */ public function get_object_location_from_hash($contenthash) { @@ -285,7 +285,7 @@ public function get_object_location_from_hash($contenthash) { * Acquire the object lock any time you are moving an object between locations. * @param mixed $contenthash * @param int $timeout - * + * * @return \core\lock\lock|boolean */ public function acquire_object_lock($contenthash, $timeout = 0) { @@ -303,7 +303,7 @@ public function acquire_object_lock($contenthash, $timeout = 0) { * copy_object_from_external_to_local_by_hash * @param mixed $contenthash * @param int $objectsize - * + * * @return int */ public function copy_object_from_external_to_local_by_hash($contenthash, $objectsize = 0) { @@ -343,7 +343,7 @@ public function copy_object_from_external_to_local_by_hash($contenthash, $object * copy_object_from_local_to_external_by_hash * @param mixed $contenthash * @param int $objectsize - * + * * @return int */ public function copy_object_from_local_to_external_by_hash($contenthash, $objectsize = 0) { @@ -371,7 +371,7 @@ public function copy_object_from_local_to_external_by_hash($contenthash, $object /** * verify_external_object_from_hash * @param mixed $contenthash - * + * * @return mixed */ public function verify_external_object_from_hash($contenthash) { @@ -384,7 +384,7 @@ public function verify_external_object_from_hash($contenthash) { * delete_object_from_local_by_hash * @param mixed $contenthash * @param int $objectsize - * + * * @return int */ public function delete_object_from_local_by_hash($contenthash, $objectsize = 0) { @@ -729,7 +729,7 @@ public function copy_file_from_hash_to_path($contenthash, $destinationpath) { * * @param string $contenthash file to be moved * @param bool $force - * + * * @return void */ public function delete_external_file_from_hash($contenthash, $force = false) { diff --git a/classes/local/store/s3/client.php b/classes/local/store/s3/client.php index 87ae669e..20f7e301 100644 --- a/classes/local/store/s3/client.php +++ b/classes/local/store/s3/client.php @@ -186,7 +186,7 @@ public function register_stream_wrapper() { /** * get_md5_from_hash * @param string $contenthash - * + * * @return string|bool */ private function get_md5_from_hash($contenthash) { @@ -212,7 +212,7 @@ private function get_md5_from_hash($contenthash) { * verify_object * @param string $contenthash * @param string $localpath - * + * * @return bool */ public function verify_object($contenthash, $localpath) { @@ -276,7 +276,7 @@ public function get_seekable_stream_context() { /** * get_filepath_from_hash * @param string $contenthash - * + * * @return string */ protected function get_filepath_from_hash($contenthash) { @@ -366,7 +366,10 @@ public function test_permissions($testdelete) { if ($testdelete) { try { - $result = $this->client->deleteObject(array('Bucket' => $this->bucket, 'Key' => $this->bucketkeyprefix . 'permissions_check_file')); + $result = $this->client->deleteObject([ + 'Bucket' => $this->bucket, + 'Key' => $this->bucketkeyprefix . 'permissions_check_file' + ]); $permissions->messages[get_string('settings:deletesuccess', 'tool_objectfs')] = 'warning'; $permissions->success = false; } catch (\Aws\S3\Exception\S3Exception $e) { @@ -390,7 +393,7 @@ public function test_permissions($testdelete) { /** * get_exception_details * @param \Exception $exception - * + * * @return string */ protected function get_exception_details($exception) { @@ -499,7 +502,11 @@ public function upload_to_s3($localpath, $contenthash) { try { $externalpath = $this->get_filepath_from_hash($contenthash); - $uploader = new \Aws\S3\ObjectUploader($this->client, $this->bucket, $this->bucketkeyprefix . $externalpath, $filehandle); + $uploader = new \Aws\S3\ObjectUploader( + $this->client, $this->bucket, + $this->bucketkeyprefix . $externalpath, + $filehandle + ); $uploader->upload(); fclose($filehandle); } catch (\Aws\Exception\MultipartUploadException $e) { diff --git a/classes/local/store/s3/file_system.php b/classes/local/store/s3/file_system.php index 45a46f29..dd911092 100644 --- a/classes/local/store/s3/file_system.php +++ b/classes/local/store/s3/file_system.php @@ -43,7 +43,7 @@ class file_system extends object_file_system { /** * initialise_external_client * @param \stdClass $config - * + * * @return client */ protected function initialise_external_client($config) { @@ -80,7 +80,7 @@ public function readfile(\stored_file $file) { /** * copy_from_local_to_external * @param mixed $contenthash - * + * * @return bool */ public function copy_from_local_to_external($contenthash) { diff --git a/classes/local/store/signed_url.php b/classes/local/store/signed_url.php index b74df4c2..80f41ce8 100644 --- a/classes/local/store/signed_url.php +++ b/classes/local/store/signed_url.php @@ -18,7 +18,7 @@ /** * A signed URL for direct downloads - * + * * A signed URL which can be used by a user to directly download a file from object store, rather * than from the Moodle server. * diff --git a/classes/local/store/swift/client.php b/classes/local/store/swift/client.php index 87c9a294..1d520fba 100644 --- a/classes/local/store/swift/client.php +++ b/classes/local/store/swift/client.php @@ -74,7 +74,12 @@ private function get_endpoint() { ]; if (!isset($this->config->openstack_authtoken['expires_at']) - || (new \DateTimeImmutable($this->config->openstack_authtoken['expires_at'])) < ( (new \DateTimeImmutable('now'))->add(new \DateInterval('PT1H')))) { + || ( + new \DateTimeImmutable($this->config->openstack_authtoken['expires_at'])) + < + ( (new \DateTimeImmutable('now'))->add(new \DateInterval('PT1H')) + ) + ) { $lockfactory = \core\lock\lock_config::get_lock_factory('tool_objectfs_swift'); @@ -93,7 +98,13 @@ private function get_endpoint() { } // Use the token if it's valid, otherwise clients will need to use username/password auth. - if (isset($this->config->openstack_authtoken['expires_at']) && new \DateTimeImmutable($this->config->openstack_authtoken['expires_at']) > new \DateTimeImmutable('now')) { + if ( + isset($this->config->openstack_authtoken['expires_at']) + && + new \DateTimeImmutable($this->config->openstack_authtoken['expires_at']) + > + new \DateTimeImmutable('now') + ) { $endpoint['cachedToken'] = $this->config->openstack_authtoken; } @@ -129,7 +140,7 @@ public function register_stream_wrapper() { return; } - stream_wrapper_register('swift', "tool_objectfs\local\store\swift\stream_wrapper") or die("cant create wrapper"); + stream_wrapper_register('swift', "tool_objectfs\local\store\swift\stream_wrapper") || die("cant create wrapper"); \tool_objectfs\local\store\swift\stream_wrapper::set_default_context($this->get_seekable_stream_context()); $bootstraped = true; @@ -143,7 +154,7 @@ public function register_stream_wrapper() { /** * get_fullpath_from_hash * @param mixed $contenthash - * + * * @return string */ public function get_fullpath_from_hash($contenthash) { @@ -177,7 +188,7 @@ public function get_seekable_stream_context() { /** * get_md5_from_hash * @param mixed $contenthash - * + * * @return mixed */ private function get_md5_from_hash($contenthash) { @@ -200,7 +211,7 @@ private function get_md5_from_hash($contenthash) { * verify_object * @param string $contenthash * @param string $localpath - * + * * @return bool */ public function verify_object($contenthash, $localpath) { @@ -217,7 +228,7 @@ public function verify_object($contenthash, $localpath) { /** * get_filepath_from_hash * @param string $contenthash - * + * * @return string */ protected function get_filepath_from_hash($contenthash) { @@ -271,7 +282,7 @@ public function test_connection() { /** * test_permissions * @param mixed $testdelete - * + * * @return \stdClass */ public function test_permissions($testdelete) { @@ -323,7 +334,7 @@ public function test_permissions($testdelete) { /** * get_exception_details * @param \OpenStack\Common\Error\BadResponseError $e - * + * * @return string */ protected function get_exception_details(\OpenStack\Common\Error\BadResponseError $e) { diff --git a/classes/local/store/swift/file_system.php b/classes/local/store/swift/file_system.php index 4f9a8475..5ac856ca 100644 --- a/classes/local/store/swift/file_system.php +++ b/classes/local/store/swift/file_system.php @@ -39,7 +39,7 @@ class file_system extends object_file_system { /** * initialise_external_client * @param \stdClass $config - * + * * @return client */ protected function initialise_external_client($config) { diff --git a/classes/local/store/swift/stream_wrapper.php b/classes/local/store/swift/stream_wrapper.php index 6f590789..deee7e66 100644 --- a/classes/local/store/swift/stream_wrapper.php +++ b/classes/local/store/swift/stream_wrapper.php @@ -168,9 +168,7 @@ class stream_wrapper { private static $defaultcontext; - // - // Stream API functions - // + // Stream API functions. /** * Close directory @@ -496,10 +494,7 @@ public function url_stat($path, $flags) { return $this->generate_stat($object, $container, $object->contentLength); } - - // - // Non-stream API functions - // + // Non-stream API functions. /** * Set context for functions that don't accept a context. e.g. stat() @@ -641,7 +636,7 @@ private function set_mode($mode) { $this->isbinary = strpos($mode, 'b') !== false; $this->istext = strpos($mode, 't') !== false; - // rewrite mode to remove b or t: + // Rewrite mode to remove b or t:. $mode = preg_replace('/[bt]?/', '', $mode); switch ($mode) { diff --git a/classes/local/table/files_table.php b/classes/local/table/files_table.php index 4579ed56..eeb7ed70 100644 --- a/classes/local/table/files_table.php +++ b/classes/local/table/files_table.php @@ -68,7 +68,7 @@ public function __construct($uniqueid, $objectlocation) { /** * col_id * @param \stdClass $row - * + * * @return int */ public function col_id(\stdClass $row) { @@ -78,7 +78,7 @@ public function col_id(\stdClass $row) { /** * col_contextid * @param \stdClass $row - * + * * @return int */ public function col_contextid(\stdClass $row) { @@ -88,7 +88,7 @@ public function col_contextid(\stdClass $row) { /** * col_contenthash * @param \stdClass $row - * + * * @return string */ public function col_contenthash(\stdClass $row) { @@ -98,7 +98,7 @@ public function col_contenthash(\stdClass $row) { /** * col_localpath * @param \stdClass $row - * + * * @return string */ public function col_localpath(\stdClass $row) { @@ -111,7 +111,7 @@ public function col_localpath(\stdClass $row) { /** * col_component * @param \stdClass $row - * + * * @return mixed */ public function col_component(\stdClass $row) { @@ -121,7 +121,7 @@ public function col_component(\stdClass $row) { /** * col_filearea * @param \stdClass $row - * + * * @return mixed */ public function col_filearea(\stdClass $row) { @@ -131,7 +131,7 @@ public function col_filearea(\stdClass $row) { /** * col_filename * @param \stdClass $row - * + * * @return mixed */ public function col_filename(\stdClass $row) { @@ -141,7 +141,7 @@ public function col_filename(\stdClass $row) { /** * col_filepath * @param \stdClass $row - * + * * @return string */ public function col_filepath(\stdClass $row) { @@ -151,7 +151,7 @@ public function col_filepath(\stdClass $row) { /** * col_mimetype * @param \stdClass $row - * + * * @return string */ public function col_mimetype(\stdClass $row) { @@ -161,7 +161,7 @@ public function col_mimetype(\stdClass $row) { /** * col_filesize * @param \stdClass $row - * + * * @return mixed */ public function col_filesize(\stdClass $row) { @@ -171,7 +171,7 @@ public function col_filesize(\stdClass $row) { /** * col_timecreated * @param \stdClass $row - * + * * @return int */ public function col_timecreated(\stdClass $row) { @@ -181,7 +181,7 @@ public function col_timecreated(\stdClass $row) { /** * col_link * @param \stdClass $row - * + * * @return string */ public function col_link(\stdClass $row) { diff --git a/classes/log/aggregate_logger.php b/classes/log/aggregate_logger.php index 75b23461..c26029a5 100644 --- a/classes/log/aggregate_logger.php +++ b/classes/log/aggregate_logger.php @@ -79,7 +79,7 @@ public function __construct() { * @param string $readname * @param string $objectpath * @param int $objectsize - * + * * @return void */ public function log_object_read($readname, $objectpath, $objectsize = 0) { @@ -100,7 +100,7 @@ public function log_object_read($readname, $objectpath, $objectsize = 0) { * @param mixed $finallocation * @param mixed $objecthash * @param int $objectsize - * + * * @return void */ public function log_object_move($movename, $initallocation, $finallocation, $objecthash, $objectsize = 0) { @@ -137,7 +137,7 @@ public function output_move_statistics() { * @param mixed $movestatistic * @param string $initiallocation * @param string $finallocation - * + * * @return void */ protected function output_move_statistic($movestatistic, $initiallocation, $finallocation) { @@ -153,7 +153,7 @@ protected function output_move_statistic($movestatistic, $initiallocation, $fina /** * location_to_string * @param int $location - * + * * @return string */ public function location_to_string($location) { @@ -178,7 +178,7 @@ public function location_to_string($location) { * @param mixed $queryname * @param int $objectcount * @param int $objectsum - * + * * @return [type] */ public function log_object_query($queryname, $objectcount, $objectsum = 0) { diff --git a/classes/log/null_logger.php b/classes/log/null_logger.php index 3a431fa5..f29dbb47 100644 --- a/classes/log/null_logger.php +++ b/classes/log/null_logger.php @@ -39,7 +39,7 @@ class null_logger extends objectfs_logger { * @param mixed $readname * @param mixed $objectpath * @param int $objectsize - * + * * @return void */ public function log_object_read($readname, $objectpath, $objectsize = 0) { @@ -53,7 +53,7 @@ public function log_object_read($readname, $objectpath, $objectsize = 0) { * @param mixed $finallocation * @param mixed $objecthash * @param int $objectsize - * + * * @return void */ public function log_object_move($movename, $initallocation, $finallocation, $objecthash, $objectsize = 0) { @@ -65,7 +65,7 @@ public function log_object_move($movename, $initallocation, $finallocation, $obj * @param mixed $queryname * @param mixed $objectcount * @param int $objectsum - * + * * @return void */ public function log_object_query($queryname, $objectcount, $objectsum = 0) { diff --git a/classes/log/objectfs_logger.php b/classes/log/objectfs_logger.php index c8d36fb2..6dfe6f38 100644 --- a/classes/log/objectfs_logger.php +++ b/classes/log/objectfs_logger.php @@ -79,7 +79,7 @@ protected function get_timing() { /** * error_log * @param mixed $error - * + * * @return void */ public function error_log($error) { @@ -91,7 +91,7 @@ public function error_log($error) { /** * log_lock_timing * @param mixed $lock - * + * * @return void */ public function log_lock_timing($lock) { @@ -103,11 +103,11 @@ public function log_lock_timing($lock) { * @param string $readname * @param string $objectpath * @param int $objectsize - * + * * @return void */ abstract public function log_object_read($readname, $objectpath, $objectsize = 0); - + /** * log_object_move * @param mixed $movename @@ -115,7 +115,7 @@ abstract public function log_object_read($readname, $objectpath, $objectsize = 0 * @param string $finallocation * @param string $objecthash * @param int $objectsize - * + * * @return void */ abstract public function log_object_move($movename, $initallocation, $finallocation, $objecthash, $objectsize = 0); @@ -125,7 +125,7 @@ abstract public function log_object_move($movename, $initallocation, $finallocat * @param string $queryname * @param int $objectcount * @param int $objectsum - * + * * @return void */ abstract public function log_object_query($queryname, $objectcount, $objectsum = 0); diff --git a/classes/log/objectfs_statistic.php b/classes/log/objectfs_statistic.php index 88ac9728..44c5279a 100644 --- a/classes/log/objectfs_statistic.php +++ b/classes/log/objectfs_statistic.php @@ -86,7 +86,7 @@ public function get_key() { /** * add_statistic * @param objectfs_statistic $statistic - * + * * @return void */ public function add_statistic(objectfs_statistic $statistic) { @@ -98,7 +98,7 @@ public function add_statistic(objectfs_statistic $statistic) { * add_object_data * @param int $objectcount * @param int $objectsum - * + * * @return void */ public function add_object_data($objectcount, $objectsum) { diff --git a/classes/log/real_time_logger.php b/classes/log/real_time_logger.php index 98bd5455..e7eca947 100644 --- a/classes/log/real_time_logger.php +++ b/classes/log/real_time_logger.php @@ -38,7 +38,7 @@ class real_time_logger extends objectfs_logger { * log_object_read_action * @param string $actionname * @param string $objectpath - * + * * @return mixed */ public function log_object_read_action($actionname, $objectpath) { @@ -51,7 +51,7 @@ public function log_object_read_action($actionname, $objectpath) { * @param string $objecthash * @param string $initallocation * @param string $finallocation - * + * * @return mixed */ public function log_object_move_action($actionname, $objecthash, $initallocation, $finallocation) { @@ -61,7 +61,7 @@ public function log_object_move_action($actionname, $objecthash, $initallocation /** * append_timing_string * @param mixed $logstring - * + * * @return void */ protected function append_timing_string(&$logstring) { @@ -76,7 +76,7 @@ protected function append_timing_string(&$logstring) { * append_size_string * @param string $logstring * @param int $objectsize - * + * * @return void */ protected function append_size_string(&$logstring, $objectsize) { @@ -91,7 +91,7 @@ protected function append_size_string(&$logstring, $objectsize) { * @param string $logstring * @param string $initiallocation * @param string $finallocation - * + * * @return void */ protected function append_location_change_string(&$logstring, $initiallocation, $finallocation) { @@ -107,7 +107,7 @@ protected function append_location_change_string(&$logstring, $initiallocation, * @param string $readname * @param string $objectpath * @param int $objectsize - * + * * @return [type] */ public function log_object_read($readname, $objectpath, $objectsize = 0) { @@ -128,7 +128,7 @@ public function log_object_read($readname, $objectpath, $objectsize = 0) { * @param string $finallocation * @param string $objecthash * @param int $objectsize - * + * * @return void */ public function log_object_move($movename, $initallocation, $finallocation, $objecthash, $objectsize = 0) { @@ -146,7 +146,7 @@ public function log_object_move($movename, $initallocation, $finallocation, $obj * @param string $queryname * @param int $objectcount * @param int $objectsum - * + * * @return void */ public function log_object_query($queryname, $objectcount, $objectsum = 0) { @@ -160,7 +160,7 @@ public function log_object_query($queryname, $objectcount, $objectsum = 0) { /** * log_lock_timing * @param mixed $lock - * + * * @return void */ public function log_lock_timing($lock) { diff --git a/classes/privacy/provider.php b/classes/privacy/provider.php index cbbddfd1..842a6ddf 100644 --- a/classes/privacy/provider.php +++ b/classes/privacy/provider.php @@ -36,7 +36,7 @@ class provider implements null_provider { * * @return string */ - public static function _get_reason() { + public static function get_reason() { return 'privacy:metadata'; } } diff --git a/classes/task/delete_local_empty_directories.php b/classes/task/delete_local_empty_directories.php index 7dd2f580..3fd8fd05 100644 --- a/classes/task/delete_local_empty_directories.php +++ b/classes/task/delete_local_empty_directories.php @@ -28,8 +28,6 @@ use coding_exception; use tool_objectfs\local\manager; -defined('MOODLE_INTERNAL') || die(); - /** * [Description delete_local_empty_directories] */ diff --git a/classes/task/delete_orphaned_object_metadata.php b/classes/task/delete_orphaned_object_metadata.php index 8a15ac9f..e265dcfb 100644 --- a/classes/task/delete_orphaned_object_metadata.php +++ b/classes/task/delete_orphaned_object_metadata.php @@ -16,7 +16,7 @@ /** * Task that checks for old orphaned objects - * + * * And removes their metadata (record) * and external file (if delete external enabled) as it is no longer useful/relevant. * diff --git a/classes/tests/test_azure_integration_client.php b/classes/tests/test_azure_integration_client.php index 9880b8fc..cec69065 100644 --- a/classes/tests/test_azure_integration_client.php +++ b/classes/tests/test_azure_integration_client.php @@ -43,7 +43,7 @@ public function __construct($config) { /** * get_filepath_from_hash * @param mixed $contenthash - * + * * @return string */ protected function get_filepath_from_hash($contenthash) { diff --git a/classes/tests/test_client.php b/classes/tests/test_client.php index 5ea4d030..7a380c17 100644 --- a/classes/tests/test_client.php +++ b/classes/tests/test_client.php @@ -25,7 +25,7 @@ class test_client extends object_client_base { /** * Maximum allowed file size that can be uploaded - * @var int + * @var int */ protected $maxupload; @@ -66,7 +66,7 @@ public function get_seekable_stream_context() { /** * get_fullpath_from_hash * @param string $contenthash - * + * * @return string */ public function get_fullpath_from_hash($contenthash) { @@ -77,7 +77,7 @@ public function get_fullpath_from_hash($contenthash) { /** * delete_file * @param string $fullpath - * + * * @return bool */ public function delete_file($fullpath) { @@ -88,7 +88,7 @@ public function delete_file($fullpath) { * rename_file * @param string $currentpath * @param string $destinationpath - * + * * @return bool */ public function rename_file($currentpath, $destinationpath) { @@ -106,7 +106,7 @@ public function register_stream_wrapper() { /** * get_md5_from_hash * @param mixed $contenthash - * + * * @return string */ private function get_md5_from_hash($contenthash) { @@ -118,7 +118,7 @@ private function get_md5_from_hash($contenthash) { * verify_object * @param string $contenthash * @param string $localpath - * + * * @return bool */ public function verify_object($contenthash, $localpath) { @@ -143,7 +143,7 @@ public function test_connection() { /** * test_permissions * @param mixed $testdelete - * + * * @return \stdClass */ public function test_permissions($testdelete) { diff --git a/classes/tests/test_digitalocean_integration_client.php b/classes/tests/test_digitalocean_integration_client.php index a24988e2..2a34c28c 100644 --- a/classes/tests/test_digitalocean_integration_client.php +++ b/classes/tests/test_digitalocean_integration_client.php @@ -43,7 +43,7 @@ public function __construct($config) { /** * get_filepath_from_hash * @param mixed $contenthash - * + * * @return string */ protected function get_filepath_from_hash($contenthash) { diff --git a/classes/tests/test_file_system.php b/classes/tests/test_file_system.php index 319cf48b..7e1ba875 100644 --- a/classes/tests/test_file_system.php +++ b/classes/tests/test_file_system.php @@ -44,7 +44,7 @@ class test_file_system extends object_file_system { /** * initialise_external_client * @param \stdClass $config - * + * * @return mixed */ protected function initialise_external_client($config) { diff --git a/classes/tests/test_s3_integration_client.php b/classes/tests/test_s3_integration_client.php index 31e96bcb..233f0b7e 100644 --- a/classes/tests/test_s3_integration_client.php +++ b/classes/tests/test_s3_integration_client.php @@ -42,7 +42,7 @@ public function __construct($config) { /** * get_filepath_from_hash * @param string $contenthash - * + * * @return string */ protected function get_filepath_from_hash($contenthash) { diff --git a/classes/tests/test_swift_integration_client.php b/classes/tests/test_swift_integration_client.php index b85efbfe..4e1ede63 100644 --- a/classes/tests/test_swift_integration_client.php +++ b/classes/tests/test_swift_integration_client.php @@ -42,7 +42,7 @@ public function __construct($config) { /** * get_filepath_from_hash * @param string $contenthash - * + * * @return string */ protected function get_filepath_from_hash($contenthash) { diff --git a/classes/tests/testcase.php b/classes/tests/testcase.php index 2564c335..c8952cc8 100644 --- a/classes/tests/testcase.php +++ b/classes/tests/testcase.php @@ -55,7 +55,7 @@ protected function reset_file_system() { /** * create_local_file_from_path * @param string $pathname - * + * * @return stored_file */ protected function create_local_file_from_path($pathname) { @@ -85,7 +85,7 @@ protected function create_local_file_from_path($pathname) { /** * create_local_file * @param string $content - * + * * @return stored_file */ protected function create_local_file($content = 'test content') { @@ -115,7 +115,7 @@ protected function create_local_file($content = 'test content') { /** * create_duplicated_file * @param string $content - * + * * @return stored_file */ protected function create_duplicated_file($content = 'test content') { @@ -129,7 +129,7 @@ protected function create_duplicated_file($content = 'test content') { /** * create_remote_file * @param string $content - * + * * @return stored_file */ protected function create_remote_file($content = 'test content') { @@ -155,7 +155,7 @@ protected function create_error_file() { /** * get_external_path_from_hash * @param string $contenthash - * + * * @return mixed */ protected function get_external_path_from_hash($contenthash) { @@ -167,7 +167,7 @@ protected function get_external_path_from_hash($contenthash) { /** * get_external_path_from_storedfile * @param mixed $file - * + * * @return mixed */ protected function get_external_path_from_storedfile($file) { @@ -175,16 +175,15 @@ protected function get_external_path_from_storedfile($file) { return $this->get_external_path_from_hash($contenthash); } - // - /** - * get_local_path_from_hash - * - * We want acces to local path for testing so we use a reflection - * method as opposed to rewriting here. - * @param string $contenthash - * - * @return mixed - */ + /** + * get_local_path_from_hash + * + * We want acces to local path for testing so we use a reflection + * method as opposed to rewriting here. + * @param string $contenthash + * + * @return mixed + */ protected function get_local_path_from_hash($contenthash) { $reflection = new \ReflectionMethod(object_file_system::class, 'get_local_path_from_hash'); $reflection->setAccessible(true); @@ -194,7 +193,7 @@ protected function get_local_path_from_hash($contenthash) { /** * delete_file * @param string $contenthash - * + * * @return mixed */ protected function delete_file($contenthash) { @@ -207,7 +206,7 @@ protected function delete_file($contenthash) { * rename_file * @param mixed $currentpath * @param mixed $destinationpath - * + * * @return mixed */ protected function rename_file($currentpath, $destinationpath) { @@ -219,7 +218,7 @@ protected function rename_file($currentpath, $destinationpath) { /** * get_local_path_from_storedfile * @param mixed $file - * + * * @return mixed */ protected function get_local_path_from_storedfile($file) { @@ -230,7 +229,7 @@ protected function get_local_path_from_storedfile($file) { /** * recover_file * @param mixed $file - * + * * @return mixed */ protected function recover_file($file) { @@ -242,7 +241,7 @@ protected function recover_file($file) { /** * create_local_object * @param mixed $content - * + * * @return mixed */ protected function create_local_object($content = 'local object content') { @@ -253,7 +252,7 @@ protected function create_local_object($content = 'local object content') { /** * create_duplicated_object * @param mixed $content - * + * * @return mixed */ protected function create_duplicated_object($content = 'duplicated object content') { @@ -264,7 +263,7 @@ protected function create_duplicated_object($content = 'duplicated object conten /** * create_remote_object * @param mixed $content - * + * * @return mixed */ protected function create_remote_object($content = 'remote object content') { @@ -275,7 +274,7 @@ protected function create_remote_object($content = 'remote object content') { /** * create_error_object * @param mixed $content - * + * * @return mixed */ protected function create_error_object($content = 'error object content') { @@ -286,7 +285,7 @@ protected function create_error_object($content = 'error object content') { /** * is_locally_readable_by_hash * @param mixed $contenthash - * + * * @return mixed */ protected function is_locally_readable_by_hash($contenthash) { @@ -297,7 +296,7 @@ protected function is_locally_readable_by_hash($contenthash) { /** * is_externally_readable_by_hash * @param mixed $contenthash - * + * * @return mixed */ protected function is_externally_readable_by_hash($contenthash) { @@ -309,7 +308,7 @@ protected function is_externally_readable_by_hash($contenthash) { * acquire_object_lock * @param mixed $filehash * @param int $timeout - * + * * @return mixed */ protected function acquire_object_lock($filehash, $timeout = 0) { @@ -321,7 +320,7 @@ protected function acquire_object_lock($filehash, $timeout = 0) { /** * delete_draft_files * @param mixed $contenthash - * + * * @return mixed */ protected function delete_draft_files($contenthash) { @@ -332,7 +331,7 @@ protected function delete_draft_files($contenthash) { /** * is_externally_readable_by_url * @param signed_url $signedurl - * + * * @return mixed */ protected function is_externally_readable_by_url(signed_url $signedurl) { diff --git a/db/upgrade.php b/db/upgrade.php index 9e33b185..d9f697fe 100644 --- a/db/upgrade.php +++ b/db/upgrade.php @@ -26,7 +26,7 @@ /** * xmldb_tool_objectfs_upgrade * @param int $oldversion - * + * * @return bool */ function xmldb_tool_objectfs_upgrade($oldversion) { diff --git a/presignedurl_tests.php b/presignedurl_tests.php index 1ac1bc66..cc40e3e4 100644 --- a/presignedurl_tests.php +++ b/presignedurl_tests.php @@ -58,7 +58,7 @@ $deletelinktext = get_string('settings:presignedurl:deletefiles', OBJECTFS_PLUGIN_NAME); echo $output->heading(html_writer::link($deleteurl, $deletelinktext) . $deletedsuccess, 6); $client = manager::get_client($config); - if ($client and $client->get_availability()) { + if ($client && $client->get_availability()) { $connection = $client->test_connection(); if ($connection->success) { $testfiles = $output->presignedurl_tests_load_files($fs); diff --git a/renderer.php b/renderer.php index ce825fc5..5fa571fb 100644 --- a/renderer.php +++ b/renderer.php @@ -56,7 +56,7 @@ public function delete_presignedurl_tests_files() { /** * presignedurl_tests_load_files * @param mixed $fs - * + * * @return array */ public function presignedurl_tests_load_files($fs) { @@ -108,7 +108,7 @@ public function presignedurl_tests_load_files($fs) { * presignedurl_tests_content * @param mixed $fs * @param mixed $testfiles - * + * * @return string */ public function presignedurl_tests_content($fs, $testfiles) { diff --git a/tests/local/object_manipulator/deleter_test.php b/tests/local/object_manipulator/deleter_test.php index 707b31a1..724a8cb9 100644 --- a/tests/local/object_manipulator/deleter_test.php +++ b/tests/local/object_manipulator/deleter_test.php @@ -49,7 +49,7 @@ protected function tearDown(): void { * set_deleter_config * @param mixed $key * @param mixed $value - * + * * @return void */ protected function set_deleter_config($key, $value) { diff --git a/tests/local/object_manipulator/orphaner_test.php b/tests/local/object_manipulator/orphaner_test.php index 4dbfb454..83bb661b 100644 --- a/tests/local/object_manipulator/orphaner_test.php +++ b/tests/local/object_manipulator/orphaner_test.php @@ -49,7 +49,7 @@ protected function tearDown(): void { * set_orphaner_config * @param mixed $key * @param mixed $value - * + * * @return void */ protected function set_orphaner_config($key, $value) { diff --git a/tests/local/object_manipulator/puller_test.php b/tests/local/object_manipulator/puller_test.php index a6f23bbc..61fb0759 100644 --- a/tests/local/object_manipulator/puller_test.php +++ b/tests/local/object_manipulator/puller_test.php @@ -47,7 +47,7 @@ protected function tearDown(): void { * set_puller_config * @param mixed $key * @param mixed $value - * + * * @return void */ protected function set_puller_config($key, $value) { diff --git a/tests/local/object_manipulator/pusher_test.php b/tests/local/object_manipulator/pusher_test.php index 1645ee4c..b6a319fb 100644 --- a/tests/local/object_manipulator/pusher_test.php +++ b/tests/local/object_manipulator/pusher_test.php @@ -49,7 +49,7 @@ protected function tearDown(): void { * set_pusher_config * @param mixed $key * @param mixed $value - * + * * @return void */ protected function set_pusher_config($key, $value) { diff --git a/tests/object_file_system_test.php b/tests/object_file_system_test.php index d5f00d16..ce80c664 100644 --- a/tests/object_file_system_test.php +++ b/tests/object_file_system_test.php @@ -32,7 +32,7 @@ class object_file_system_test extends tests\testcase { * set_externalclient_config * @param mixed $key * @param mixed $value - * + * * @return void */ public function set_externalclient_config($key, $value) { @@ -754,7 +754,8 @@ public function get_expiration_time_method_if_supported_provider() { [7200, $now, userdate($now - 100, '%a, %d %b %Y %H:%M:%S'), $now + (2 * MINSECS) - $secondsafternowsub100], [7200, $now, userdate($now + 30, '%a, %d %b %Y %H:%M:%S'), $now + (2 * MINSECS) - $secondsafternowadd30], [7200, $now, userdate($now + 100, '%a, %d %b %Y %H:%M:%S'), $now + (2 * MINSECS) - $secondsafternowadd100], - [7200, $now, userdate($now + WEEKSECS + HOURSECS, '%a, %d %b %Y %H:%M:%S'), $now + WEEKSECS - MINSECS - $secondsafternowaddweek], + [7200, $now, userdate($now + WEEKSECS + HOURSECS, '%a, %d %b %Y %H:%M:%S'), + $now + WEEKSECS - MINSECS - $secondsafternowaddweek], // Custom Pre-Signed URL expiration time and int-like 'Expires' header. [0, $now, 0, $now + (2 * MINSECS) - $secondsafternow], @@ -770,7 +771,8 @@ public function get_expiration_time_method_if_supported_provider() { [600, $now, userdate($now - 100, '%a, %d %b %Y %H:%M:%S'), $now + (2 * MINSECS) - $secondsafternowsub100], [600, $now, userdate($now + 30, '%a, %d %b %Y %H:%M:%S'), $now + (2 * MINSECS) - $secondsafternowadd30], [600, $now, userdate($now + 100, '%a, %d %b %Y %H:%M:%S'), $now + (2 * MINSECS) - $secondsafternowadd100], - [600, $now, userdate($now + WEEKSECS + HOURSECS, '%a, %d %b %Y %H:%M:%S'), $now + WEEKSECS - MINSECS - $secondsafternowaddweek], + [600, $now, userdate($now + WEEKSECS + HOURSECS, '%a, %d %b %Y %H:%M:%S'), + $now + WEEKSECS - MINSECS - $secondsafternowaddweek], ]; }