MDL-58398 core_files: Fix phpdoc and other minor issues

This commit is contained in:
Ankit Agarwal 2017-03-27 14:37:09 +05:30
parent 216ea39be7
commit 92a951c5cd
5 changed files with 22 additions and 19 deletions

View file

@ -61,6 +61,11 @@ class conversion extends \core\persistent {
*/
const TABLE = 'file_conversion';
/**
* Define properties.
*
* @return array
*/
protected static function define_properties() {
return array(
'sourcefileid' => [
@ -209,7 +214,7 @@ class conversion extends \core\persistent {
/**
* Fetch the source file.
*
* @return stored_file|false
* @return stored_file|false The source file
*/
public function get_sourcefile() {
$fs = get_file_storage();
@ -276,7 +281,7 @@ class conversion extends \core\persistent {
/**
* Get the destination file.
*
* @return stored_file|this
* @return stored_file|bool Destination file
*/
public function get_destfile() {
$fs = get_file_storage();
@ -287,7 +292,7 @@ class conversion extends \core\persistent {
/**
* Helper to ensure that the returned status is always an int.
*
* @return int
* @return int status
*/
protected function get_status() {
return (int) $this->raw_get('status');
@ -296,7 +301,7 @@ class conversion extends \core\persistent {
/**
* Get an instance of the current converter.
*
* @return converter_interface|false
* @return converter_interface|false current converter instance
*/
public function get_converter_instance() {
$currentconverter = $this->get('converter');
@ -311,7 +316,7 @@ class conversion extends \core\persistent {
/**
* Transform data into a storable format.
*
* @param stdClass $data The data to be stored
* @param \stdClass $data The data to be stored
* @return $this
*/
protected function set_data($data) {
@ -323,7 +328,7 @@ class conversion extends \core\persistent {
/**
* Transform data into a storable format.
*
* @return stdClass The stored data
* @return \stdClass The stored data
*/
protected function get_data() {
$data = $this->raw_get('data');
@ -338,7 +343,7 @@ class conversion extends \core\persistent {
/**
* Return the file record base for use in the files table.
*
* @return array
* @return array|bool
*/
protected function get_file_record() {
$file = $this->get_sourcefile();

View file

@ -39,7 +39,7 @@ class converter {
/**
* Get a list of enabled plugins and classes.
*
* @return array
* @return array List of enabled plugins
*/
protected function get_enabled_plugins() {
$plugins = \core\plugininfo\fileconverter::get_enabled_plugins();
@ -57,7 +57,7 @@ class converter {
*
* This allows for mocking of the file_storage API.
*
* @return file_storage
* @return \file_storage
*/
protected function get_file_storage() {
return get_file_storage();
@ -69,7 +69,7 @@ class converter {
* @param stored_file $file The file to convert
* @param string $format The desired target file format (file extension)
* @param boolean $forcerefresh If true, the file will be converted every time (not cached).
* @return conversion
* @return conversion conversion object
*/
public function start_conversion(stored_file $file, $format, $forcerefresh = false) {
$conversions = conversion::get_conversions_for_file($file, $format);
@ -160,7 +160,7 @@ class converter {
*
* @param array $converters The list of converters to try
* @param string|null $currentconverter The converter currently in use
* @return string|false
* @return string|false Name of next converter if present
*/
protected function get_next_converter($converters, $currentconverter = null) {
if ($currentconverter) {
@ -226,7 +226,7 @@ class converter {
$from = \core_filetypes::get_file_extension($file->get_mimetype());
if (!$from) {
// No mimetype could be found. Unable to determine converter.
// No mime type could be found. Unable to determine converter.
return false;
}

View file

@ -1,5 +1,4 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify