@@ -5,6 +5,10 @@ |
||
| 5 | 5 | |
| 6 | 6 | public $useFieldContext = true; |
| 7 | 7 | |
| 8 | + /** |
|
| 9 | + * @param string $name |
|
| 10 | + * @param string $title |
|
| 11 | + */ |
|
| 8 | 12 | public function __construct($name, $title = null) |
| 9 | 13 | { |
| 10 | 14 | $this->name = $name; |
@@ -20,6 +20,10 @@ discard block |
||
| 20 | 20 | |
| 21 | 21 | protected $folderName = 'DMSTemporaryUploads'; |
| 22 | 22 | |
| 23 | + /** |
|
| 24 | + * @param string $name |
|
| 25 | + * @param string $title |
|
| 26 | + */ |
|
| 23 | 27 | public function __construct($name, $title = null, SS_List $items = null) |
| 24 | 28 | { |
| 25 | 29 | parent::__construct($name, $title, $items); |
@@ -33,6 +37,7 @@ discard block |
||
| 33 | 37 | * Override the default behaviour of the UploadField and take the uploaded file (uploaded to assets) and |
| 34 | 38 | * add it into the DMS storage, deleting the old/uploaded file. |
| 35 | 39 | * @param File |
| 40 | + * @param File $file |
|
| 36 | 41 | */ |
| 37 | 42 | protected function attachFile($file) |
| 38 | 43 | { |
@@ -76,7 +81,7 @@ discard block |
||
| 76 | 81 | * Action to handle upload of a single file |
| 77 | 82 | * |
| 78 | 83 | * @param SS_HTTPRequest $request |
| 79 | - * @return string json |
|
| 84 | + * @return SS_HTTPResponse json |
|
| 80 | 85 | */ |
| 81 | 86 | public function upload(SS_HTTPRequest $request) |
| 82 | 87 | { |
@@ -36,6 +36,9 @@ discard block |
||
| 36 | 36 | return BASE_PATH . DIRECTORY_SEPARATOR . self::$dmsFolder; |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | + /** |
|
| 40 | + * @return string |
|
| 41 | + */ |
|
| 39 | 42 | public static function transform_file_to_file_path($file) |
| 40 | 43 | { |
| 41 | 44 | //confirm we have a file |
@@ -110,7 +113,7 @@ discard block |
||
| 110 | 113 | |
| 111 | 114 | /** |
| 112 | 115 | * Creates a storage folder for the given path |
| 113 | - * @param $path Path to create a folder for |
|
| 116 | + * @param string $path Path to create a folder for |
|
| 114 | 117 | */ |
| 115 | 118 | public static function create_storage_folder($path) |
| 116 | 119 | { |
@@ -121,6 +124,7 @@ discard block |
||
| 121 | 124 | |
| 122 | 125 | /** |
| 123 | 126 | * Calculates the storage path from a database DMSDocument ID |
| 127 | + * @param integer $id |
|
| 124 | 128 | */ |
| 125 | 129 | public static function get_storage_folder($id) |
| 126 | 130 | { |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | * Removes the association between this DMSDocument and a Page. This method does nothing if the association does not exist. |
| 40 | 40 | * @abstract |
| 41 | 41 | * @param $pageObject Page object to remove the association to |
| 42 | - * @return mixed |
|
| 42 | + * @return DMSDocument |
|
| 43 | 43 | */ |
| 44 | 44 | public function removePage($pageObject); |
| 45 | 45 | |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | * same category can occur multiple times) |
| 67 | 67 | * @abstract |
| 68 | 68 | * @param $category String of a metadata category to add (required) |
| 69 | - * @param $value String of a metadata value to add (required) |
|
| 69 | + * @param string $value String of a metadata value to add (required) |
|
| 70 | 70 | * @param bool $multiValue Boolean that determines if the category is multi-value or single-value (optional) |
| 71 | 71 | * @return null |
| 72 | 72 | */ |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | * tries to fetch that specific tag. |
| 78 | 78 | * @abstract |
| 79 | 79 | * @param $category String of the metadata category to get |
| 80 | - * @param null $value String of the value of the tag to get |
|
| 80 | + * @param string|null $value String of the value of the tag to get |
|
| 81 | 81 | * @return array of Strings of all the tags or null if there is no match found |
| 82 | 82 | */ |
| 83 | 83 | public function getTagsList($category, $value = null); |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | * Nothing happens if the category or the value do not exist. |
| 89 | 89 | * @abstract |
| 90 | 90 | * @param $category Category to remove (required) |
| 91 | - * @param null $value Value to remove (optional) |
|
| 91 | + * @param string|null $value Value to remove (optional) |
|
| 92 | 92 | * @return null |
| 93 | 93 | */ |
| 94 | 94 | public function removeTag($category, $value = null); |
@@ -109,6 +109,7 @@ discard block |
||
| 109 | 109 | |
| 110 | 110 | /** |
| 111 | 111 | * Return the extension of the file associated with the document |
| 112 | + * @return string |
|
| 112 | 113 | */ |
| 113 | 114 | public function getExtension(); |
| 114 | 115 | |
@@ -131,7 +132,7 @@ discard block |
||
| 131 | 132 | * Takes a File object or a String (path to a file) and copies it into the DMS, replacing the original document file |
| 132 | 133 | * but keeping the rest of the document unchanged. |
| 133 | 134 | * @param $file File object, or String that is path to a file to store |
| 134 | - * @return DMSDocumentInstance Document object that we replaced the file in |
|
| 135 | + * @return DMSDocument Document object that we replaced the file in |
|
| 135 | 136 | */ |
| 136 | 137 | public function replaceDocument($file); |
| 137 | 138 | |
@@ -834,7 +834,7 @@ discard block |
||
| 834 | 834 | * DMS, replacing the original document file but keeping the rest of the |
| 835 | 835 | * document unchanged. |
| 836 | 836 | * |
| 837 | - * @param File|string $file path to a file to store |
|
| 837 | + * @param File $file path to a file to store |
|
| 838 | 838 | * |
| 839 | 839 | * @return DMSDocument object that we replaced the file in |
| 840 | 840 | */ |
@@ -1168,7 +1168,7 @@ discard block |
||
| 1168 | 1168 | /** |
| 1169 | 1169 | * Return the size of the file associated with the document. |
| 1170 | 1170 | * |
| 1171 | - * @return string |
|
| 1171 | + * @return integer|null |
|
| 1172 | 1172 | */ |
| 1173 | 1173 | public function getAbsoluteSize() |
| 1174 | 1174 | { |
@@ -1187,7 +1187,8 @@ discard block |
||
| 1187 | 1187 | |
| 1188 | 1188 | |
| 1189 | 1189 | /** |
| 1190 | - * @return FieldList |
|
| 1190 | + * @param integer $relationListCount |
|
| 1191 | + * @return FieldGroup |
|
| 1191 | 1192 | */ |
| 1192 | 1193 | protected function getFieldsForFile($relationListCount) |
| 1193 | 1194 | { |
@@ -1278,6 +1279,7 @@ discard block |
||
| 1278 | 1279 | /** |
| 1279 | 1280 | * Returns the document object from the request object's ID parameter. |
| 1280 | 1281 | * Returns null, if no document found |
| 1282 | + * @param SS_HTTPRequest $request |
|
| 1281 | 1283 | * @return DMSDocument|null |
| 1282 | 1284 | */ |
| 1283 | 1285 | protected function getDocumentFromID($request) |
@@ -197,8 +197,8 @@ discard block |
||
| 197 | 197 | * Creates a new filename for the current Document's file when replacing the |
| 198 | 198 | * current file with a new file. |
| 199 | 199 | * |
| 200 | - * @param DMSDocument $filename The original filename |
|
| 201 | 200 | * |
| 201 | + * @param integer $versionCounter |
|
| 202 | 202 | * @return string The new filename |
| 203 | 203 | */ |
| 204 | 204 | protected function generateVersionedFilename(DMSDocument $doc, $versionCounter) |
@@ -242,7 +242,7 @@ discard block |
||
| 242 | 242 | /** |
| 243 | 243 | * Return the size of the file associated with the document. |
| 244 | 244 | * |
| 245 | - * @return string |
|
| 245 | + * @return integer |
|
| 246 | 246 | */ |
| 247 | 247 | public function getAbsoluteSize() |
| 248 | 248 | { |
@@ -32,6 +32,9 @@ discard block |
||
| 32 | 32 | return $found; |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | + /** |
|
| 36 | + * @param integer $number |
|
| 37 | + */ |
|
| 35 | 38 | public function findPageCount($number) |
| 36 | 39 | { |
| 37 | 40 | $list = $this->getList($number); |
@@ -63,6 +66,7 @@ discard block |
||
| 63 | 66 | * Returns a filtered list of fields which could contain shortcodes. |
| 64 | 67 | * |
| 65 | 68 | * @param String |
| 69 | + * @param string $class |
|
| 66 | 70 | * @return Array Map of class names to an array of field names on these classes. |
| 67 | 71 | */ |
| 68 | 72 | public function getShortcodeFields($class) |
@@ -20,6 +20,9 @@ |
||
| 20 | 20 | self::$is_running_test = $this->originalIsRunningTest; |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | + /** |
|
| 24 | + * @param integer $id |
|
| 25 | + */ |
|
| 23 | 26 | public function createFakeHTTPRequest($id) |
| 24 | 27 | { |
| 25 | 28 | $r = new SS_HTTPRequest('GET', 'index/'.$id); |
@@ -48,6 +48,9 @@ |
||
| 48 | 48 | self::$is_running_test = $this->originalIsRunningTest; |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | + /** |
|
| 52 | + * @param string $path |
|
| 53 | + */ |
|
| 51 | 54 | public function delete($path) |
| 52 | 55 | { |
| 53 | 56 | if (file_exists($path) || is_dir($path)) { |