@@ -359,6 +359,10 @@ discard block |
||
| 359 | 359 | } |
| 360 | 360 | } |
| 361 | 361 | |
| 362 | + /** |
|
| 363 | + * @param string|boolean $user |
|
| 364 | + * @param string $root |
|
| 365 | + */ |
|
| 362 | 366 | public static function init($user, $root) { |
| 363 | 367 | if (self::$defaultInstance) { |
| 364 | 368 | return false; |
@@ -517,7 +521,7 @@ discard block |
||
| 517 | 521 | /** |
| 518 | 522 | * mount an \OC\Files\Storage\Storage in our virtual filesystem |
| 519 | 523 | * |
| 520 | - * @param \OC\Files\Storage\Storage|string $class |
|
| 524 | + * @param string $class |
|
| 521 | 525 | * @param array $arguments |
| 522 | 526 | * @param string $mountpoint |
| 523 | 527 | */ |
@@ -690,6 +694,9 @@ discard block |
||
| 690 | 694 | return self::$defaultInstance->is_dir($path); |
| 691 | 695 | } |
| 692 | 696 | |
| 697 | + /** |
|
| 698 | + * @param string $path |
|
| 699 | + */ |
|
| 693 | 700 | public static function is_file($path) { |
| 694 | 701 | return self::$defaultInstance->is_file($path); |
| 695 | 702 | } |
@@ -702,6 +709,9 @@ discard block |
||
| 702 | 709 | return self::$defaultInstance->filetype($path); |
| 703 | 710 | } |
| 704 | 711 | |
| 712 | + /** |
|
| 713 | + * @param string $path |
|
| 714 | + */ |
|
| 705 | 715 | public static function filesize($path) { |
| 706 | 716 | return self::$defaultInstance->filesize($path); |
| 707 | 717 | } |
@@ -714,6 +724,9 @@ discard block |
||
| 714 | 724 | return self::$defaultInstance->isCreatable($path); |
| 715 | 725 | } |
| 716 | 726 | |
| 727 | + /** |
|
| 728 | + * @param string $path |
|
| 729 | + */ |
|
| 717 | 730 | public static function isReadable($path) { |
| 718 | 731 | return self::$defaultInstance->isReadable($path); |
| 719 | 732 | } |
@@ -726,6 +739,9 @@ discard block |
||
| 726 | 739 | return self::$defaultInstance->isDeletable($path); |
| 727 | 740 | } |
| 728 | 741 | |
| 742 | + /** |
|
| 743 | + * @param string $path |
|
| 744 | + */ |
|
| 729 | 745 | public static function isSharable($path) { |
| 730 | 746 | return self::$defaultInstance->isSharable($path); |
| 731 | 747 | } |
@@ -743,6 +759,7 @@ discard block |
||
| 743 | 759 | } |
| 744 | 760 | |
| 745 | 761 | /** |
| 762 | + * @param string $path |
|
| 746 | 763 | * @return string |
| 747 | 764 | */ |
| 748 | 765 | public static function file_get_contents($path) { |
@@ -765,6 +782,10 @@ discard block |
||
| 765 | 782 | return self::$defaultInstance->copy($path1, $path2); |
| 766 | 783 | } |
| 767 | 784 | |
| 785 | + /** |
|
| 786 | + * @param string $path |
|
| 787 | + * @param string $mode |
|
| 788 | + */ |
|
| 768 | 789 | public static function fopen($path, $mode) { |
| 769 | 790 | return self::$defaultInstance->fopen($path, $mode); |
| 770 | 791 | } |
@@ -780,6 +801,9 @@ discard block |
||
| 780 | 801 | return self::$defaultInstance->fromTmpFile($tmpFile, $path); |
| 781 | 802 | } |
| 782 | 803 | |
| 804 | + /** |
|
| 805 | + * @param string $path |
|
| 806 | + */ |
|
| 783 | 807 | public static function getMimeType($path) { |
| 784 | 808 | return self::$defaultInstance->getMimeType($path); |
| 785 | 809 | } |
@@ -792,6 +816,9 @@ discard block |
||
| 792 | 816 | return self::$defaultInstance->free_space($path); |
| 793 | 817 | } |
| 794 | 818 | |
| 819 | + /** |
|
| 820 | + * @param string $query |
|
| 821 | + */ |
|
| 795 | 822 | public static function search($query) { |
| 796 | 823 | return self::$defaultInstance->search($query); |
| 797 | 824 | } |
@@ -900,7 +927,7 @@ discard block |
||
| 900 | 927 | * @param string $path |
| 901 | 928 | * @param boolean $includeMountPoints whether to add mountpoint sizes, |
| 902 | 929 | * defaults to true |
| 903 | - * @return \OC\Files\FileInfo|bool False if file does not exist |
|
| 930 | + * @return \OCP\Files\FileInfo|null False if file does not exist |
|
| 904 | 931 | */ |
| 905 | 932 | public static function getFileInfo($path, $includeMountPoints = true) { |
| 906 | 933 | return self::$defaultInstance->getFileInfo($path, $includeMountPoints); |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | * @param string $path |
| 176 | 176 | * @throws \OCP\Files\NotFoundException |
| 177 | 177 | * @throws \OCP\Files\NotPermittedException |
| 178 | - * @return File|Folder |
|
| 178 | + * @return string |
|
| 179 | 179 | */ |
| 180 | 180 | public function get($path) { |
| 181 | 181 | $path = $this->normalizePath($path); |
@@ -373,6 +373,9 @@ discard block |
||
| 373 | 373 | return $folder; |
| 374 | 374 | } |
| 375 | 375 | |
| 376 | + /** |
|
| 377 | + * @param string $fullPath |
|
| 378 | + */ |
|
| 376 | 379 | private function resolveVirtualNode($fullPath) { |
| 377 | 380 | $pieces = \explode('/', $fullPath); |
| 378 | 381 | if ($pieces[1] !== 'meta') { |
@@ -269,7 +269,7 @@ discard block |
||
| 269 | 269 | /** |
| 270 | 270 | * authenticate the api call |
| 271 | 271 | * @param array $action the action details as supplied to OC_API::register() |
| 272 | - * @return bool |
|
| 272 | + * @return boolean|string |
|
| 273 | 273 | */ |
| 274 | 274 | private static function isAuthorised($action) { |
| 275 | 275 | $level = $action['authlevel']; |
@@ -318,7 +318,7 @@ discard block |
||
| 318 | 318 | |
| 319 | 319 | /** |
| 320 | 320 | * http basic auth |
| 321 | - * @return string|false (username, or false on failure) |
|
| 321 | + * @return string|boolean (username, or false on failure) |
|
| 322 | 322 | */ |
| 323 | 323 | private static function loginUser() { |
| 324 | 324 | if (self::$isLoggedIn === true) { |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | * @param string $wrongPath wrong path of the entry to fix |
| 103 | 103 | * @param int $correctStorageNumericId numeric idea of the correct storage |
| 104 | 104 | * @param string $correctPath value to which to set the path of the entry |
| 105 | - * @return bool true for success |
|
| 105 | + * @return boolean|null true for success |
|
| 106 | 106 | */ |
| 107 | 107 | private function fixEntryPath(IOutput $out, $fileId, $wrongPath, $correctStorageNumericId, $correctPath) { |
| 108 | 108 | // delete target if exists |
@@ -132,6 +132,9 @@ discard block |
||
| 132 | 132 | $out->advance(1, $text); |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | + /** |
|
| 136 | + * @param \OCP\DB\QueryBuilder\IQueryBuilder $qb |
|
| 137 | + */ |
|
| 135 | 138 | private function addQueryConditionsParentIdWrongPath($qb) { |
| 136 | 139 | // thanks, VicDeo! |
| 137 | 140 | if ($this->connection->getDatabasePlatform() instanceof MySqlPlatform) { |
@@ -171,6 +174,9 @@ discard block |
||
| 171 | 174 | } |
| 172 | 175 | } |
| 173 | 176 | |
| 177 | + /** |
|
| 178 | + * @param \OCP\DB\QueryBuilder\IQueryBuilder $qb |
|
| 179 | + */ |
|
| 174 | 180 | private function addQueryConditionsNonExistingParentIdEntry($qb, $storageNumericId = null) { |
| 175 | 181 | // Subquery for parent existence |
| 176 | 182 | $qbe = $this->connection->getQueryBuilder(); |
@@ -200,6 +206,9 @@ discard block |
||
| 200 | 206 | } |
| 201 | 207 | } |
| 202 | 208 | |
| 209 | + /** |
|
| 210 | + * @param integer $storageNumericId |
|
| 211 | + */ |
|
| 203 | 212 | private function countResultsToProcessParentIdWrongPath($storageNumericId = null) { |
| 204 | 213 | $qb = $this->connection->getQueryBuilder(); |
| 205 | 214 | $qb->select($qb->createFunction('COUNT(*)')); |
@@ -210,6 +219,9 @@ discard block |
||
| 210 | 219 | return $count; |
| 211 | 220 | } |
| 212 | 221 | |
| 222 | + /** |
|
| 223 | + * @param integer $storageNumericId |
|
| 224 | + */ |
|
| 213 | 225 | private function countResultsToProcessNonExistingParentIdEntry($storageNumericId = null) { |
| 214 | 226 | $qb = $this->connection->getQueryBuilder(); |
| 215 | 227 | $qb->select($qb->createFunction('COUNT(*)')); |
@@ -359,6 +371,7 @@ discard block |
||
| 359 | 371 | * |
| 360 | 372 | * @param int $storageId storage id |
| 361 | 373 | * @param string $path path for which to create the parent entry |
| 374 | + * @param integer $reuseFileId |
|
| 362 | 375 | * @return int file id of the newly created parent |
| 363 | 376 | */ |
| 364 | 377 | private function getOrCreateEntry($storageId, $path, $reuseFileId = null) { |
@@ -741,11 +741,19 @@ discard block |
||
| 741 | 741 | } |
| 742 | 742 | |
| 743 | 743 | // case-insensitive array_search |
| 744 | + |
|
| 745 | + /** |
|
| 746 | + * @param string $needle |
|
| 747 | + */ |
|
| 744 | 748 | protected function array_searchi($needle, $haystack, $mem='getName') { |
| 745 | 749 | if (!\is_array($haystack)) { |
| 746 | 750 | return false; |
| 747 | 751 | } |
| 748 | 752 | return \array_search(\strtolower($needle), \array_map( |
| 753 | + |
|
| 754 | + /** |
|
| 755 | + * @param string $tag |
|
| 756 | + */ |
|
| 749 | 757 | function ($tag) use ($mem) { |
| 750 | 758 | return \strtolower(\call_user_func([$tag, $mem])); |
| 751 | 759 | }, $haystack) |
@@ -770,7 +778,7 @@ discard block |
||
| 770 | 778 | * Get a tag by its name. |
| 771 | 779 | * |
| 772 | 780 | * @param string $name The tag name. |
| 773 | - * @return integer|bool The tag object's offset within the $this->tags |
|
| 781 | + * @return \OCP\AppFramework\Db\Entity The tag object's offset within the $this->tags |
|
| 774 | 782 | * array or false if it doesn't exist. |
| 775 | 783 | */ |
| 776 | 784 | private function getTagByName($name) { |
@@ -781,7 +789,7 @@ discard block |
||
| 781 | 789 | * Get a tag by its ID. |
| 782 | 790 | * |
| 783 | 791 | * @param string $id The tag ID to look for. |
| 784 | - * @return integer|bool The tag object's offset within the $this->tags |
|
| 792 | + * @return \OCP\AppFramework\Db\Entity The tag object's offset within the $this->tags |
|
| 785 | 793 | * array or false if it doesn't exist. |
| 786 | 794 | */ |
| 787 | 795 | private function getTagById($id) { |
@@ -67,7 +67,7 @@ |
||
| 67 | 67 | /** |
| 68 | 68 | * Search for files by mimetype |
| 69 | 69 | * @param string $mimetype |
| 70 | - * @return array |
|
| 70 | + * @return \OC\Files\FileInfo[] |
|
| 71 | 71 | * @since 6.0.0 |
| 72 | 72 | */ |
| 73 | 73 | public static function searchByMime($mimetype) { |
@@ -32,18 +32,21 @@ discard block |
||
| 32 | 32 | /** |
| 33 | 33 | * @param string $message |
| 34 | 34 | * @since 9.1.0 |
| 35 | + * @return void |
|
| 35 | 36 | */ |
| 36 | 37 | public function info($message); |
| 37 | 38 | |
| 38 | 39 | /** |
| 39 | 40 | * @param string $message |
| 40 | 41 | * @since 9.1.0 |
| 42 | + * @return void |
|
| 41 | 43 | */ |
| 42 | 44 | public function warning($message); |
| 43 | 45 | |
| 44 | 46 | /** |
| 45 | 47 | * @param int $max |
| 46 | 48 | * @since 9.1.0 |
| 49 | + * @return void |
|
| 47 | 50 | */ |
| 48 | 51 | public function startProgress($max = 0); |
| 49 | 52 | |
@@ -51,12 +54,13 @@ discard block |
||
| 51 | 54 | * @param int $step |
| 52 | 55 | * @param string $description |
| 53 | 56 | * @since 9.1.0 |
| 57 | + * @return void |
|
| 54 | 58 | */ |
| 55 | 59 | public function advance($step = 1, $description = ''); |
| 56 | 60 | |
| 57 | 61 | /** |
| 58 | - * @param int $max |
|
| 59 | 62 | * @since 9.1.0 |
| 63 | + * @return void |
|
| 60 | 64 | */ |
| 61 | 65 | public function finishProgress(); |
| 62 | 66 | } |
@@ -67,6 +67,9 @@ |
||
| 67 | 67 | } |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | + /** |
|
| 71 | + * @param string|boolean $username |
|
| 72 | + */ |
|
| 70 | 73 | private static function sendNotificationMail($username) { |
| 71 | 74 | $userObject = \OC::$server->getUserManager()->get($username); |
| 72 | 75 | $email = $userObject->getEMailAddress(); |
@@ -245,7 +245,7 @@ |
||
| 245 | 245 | } |
| 246 | 246 | |
| 247 | 247 | /** |
| 248 | - * @return array|null |
|
| 248 | + * @return string |
|
| 249 | 249 | */ |
| 250 | 250 | public function getLocalSystemAddressBook() { |
| 251 | 251 | if ($this->localSystemAddressBook === null) { |