Merge pull request #15741 from mxss/fix/phpdoc-fixes

misc phpdoc fixes
This commit is contained in:
Morris Jobke 2019-07-02 22:25:41 +02:00 committed by GitHub
commit 0d0850746e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 40 additions and 2 deletions

View File

@ -48,6 +48,7 @@ class CleanupFileLocks extends TimedJob {
* Makes the background job do its work * Makes the background job do its work
* *
* @param array $argument unused argument * @param array $argument unused argument
* @throws \Exception
*/ */
public function run($argument) { public function run($argument) {
$lockingProvider = \OC::$server->getLockingProvider(); $lockingProvider = \OC::$server->getLockingProvider();

View File

@ -242,6 +242,7 @@ class ApiController extends Controller {
* @param string $mode * @param string $mode
* @param string $direction * @param string $direction
* @return Response * @return Response
* @throws \OCP\PreConditionNotMetException
*/ */
public function updateFileSorting($mode, $direction) { public function updateFileSorting($mode, $direction) {
$allowedMode = ['name', 'size', 'mtime']; $allowedMode = ['name', 'size', 'mtime'];
@ -262,6 +263,8 @@ class ApiController extends Controller {
* @NoAdminRequired * @NoAdminRequired
* *
* @param bool $show * @param bool $show
* @return Response
* @throws \OCP\PreConditionNotMetException
*/ */
public function showHiddenFiles($show) { public function showHiddenFiles($show) {
$this->config->setUserValue($this->userSession->getUser()->getUID(), 'files', 'show_hidden', (int)$show); $this->config->setUserValue($this->userSession->getUser()->getUID(), 'files', 'show_hidden', (int)$show);
@ -274,6 +277,8 @@ class ApiController extends Controller {
* @NoAdminRequired * @NoAdminRequired
* *
* @param bool $show * @param bool $show
* @return Response
* @throws \OCP\PreConditionNotMetException
*/ */
public function showGridView($show) { public function showGridView($show) {
$this->config->setUserValue($this->userSession->getUser()->getUID(), 'files', 'show_grid', (int)$show); $this->config->setUserValue($this->userSession->getUser()->getUID(), 'files', 'show_grid', (int)$show);
@ -295,10 +300,11 @@ class ApiController extends Controller {
* *
* @NoAdminRequired * @NoAdminRequired
* *
* @param bool $show * @param int $show
* @param bool $key the key of the folder * @param string $key the key of the folder
* *
* @return Response * @return Response
* @throws \OCP\PreConditionNotMetException
*/ */
public function toggleShowFolder(int $show, string $key) { public function toggleShowFolder(int $show, string $key) {
// ensure the edited key exists // ensure the edited key exists

View File

@ -136,6 +136,7 @@ class ViewController extends Controller {
* *
* @param string $fileid * @param string $fileid
* @return TemplateResponse|RedirectResponse * @return TemplateResponse|RedirectResponse
* @throws NotFoundException
*/ */
public function showFile(string $fileid = null): Response { public function showFile(string $fileid = null): Response {
// This is the entry point from the `/f/{fileid}` URL which is hardcoded in the server. // This is the entry point from the `/f/{fileid}` URL which is hardcoded in the server.
@ -153,7 +154,9 @@ class ViewController extends Controller {
* @param string $dir * @param string $dir
* @param string $view * @param string $view
* @param string $fileid * @param string $fileid
* @param bool $fileNotFound
* @return TemplateResponse|RedirectResponse * @return TemplateResponse|RedirectResponse
* @throws NotFoundException
*/ */
public function index($dir = '', $view = '', $fileid = null, $fileNotFound = false) { public function index($dir = '', $view = '', $fileid = null, $fileNotFound = false) {
if ($fileid !== null) { if ($fileid !== null) {

View File

@ -454,9 +454,11 @@ class Access extends LDAPUtility {
/** /**
* returns the internal Nextcloud name for the given LDAP DN of the group, false on DN outside of search DN or failure * returns the internal Nextcloud name for the given LDAP DN of the group, false on DN outside of search DN or failure
*
* @param string $fdn the dn of the group object * @param string $fdn the dn of the group object
* @param string $ldapName optional, the display name of the object * @param string $ldapName optional, the display name of the object
* @return string|false with the name to use in Nextcloud, false on DN outside of search DN * @return string|false with the name to use in Nextcloud, false on DN outside of search DN
* @throws \Exception
*/ */
public function dn2groupname($fdn, $ldapName = null) { public function dn2groupname($fdn, $ldapName = null) {
//To avoid bypassing the base DN settings under certain circumstances //To avoid bypassing the base DN settings under certain circumstances
@ -511,9 +513,11 @@ class Access extends LDAPUtility {
/** /**
* returns the internal Nextcloud name for the given LDAP DN of the user, false on DN outside of search DN or failure * returns the internal Nextcloud name for the given LDAP DN of the user, false on DN outside of search DN or failure
*
* @param string $dn the dn of the user object * @param string $dn the dn of the user object
* @param string $ldapName optional, the display name of the object * @param string $ldapName optional, the display name of the object
* @return string|false with with the name to use in Nextcloud * @return string|false with with the name to use in Nextcloud
* @throws \Exception
*/ */
public function dn2username($fdn, $ldapName = null) { public function dn2username($fdn, $ldapName = null) {
//To avoid bypassing the base DN settings under certain circumstances //To avoid bypassing the base DN settings under certain circumstances
@ -654,10 +658,12 @@ class Access extends LDAPUtility {
/** /**
* gives back the user names as they are used ownClod internally * gives back the user names as they are used ownClod internally
*
* @param array $ldapUsers as returned by fetchList() * @param array $ldapUsers as returned by fetchList()
* @return array an array with the user names to use in Nextcloud * @return array an array with the user names to use in Nextcloud
* *
* gives back the user names as they are used ownClod internally * gives back the user names as they are used ownClod internally
* @throws \Exception
*/ */
public function nextcloudUserNames($ldapUsers) { public function nextcloudUserNames($ldapUsers) {
return $this->ldap2NextcloudNames($ldapUsers, true); return $this->ldap2NextcloudNames($ldapUsers, true);
@ -665,10 +671,12 @@ class Access extends LDAPUtility {
/** /**
* gives back the group names as they are used ownClod internally * gives back the group names as they are used ownClod internally
*
* @param array $ldapGroups as returned by fetchList() * @param array $ldapGroups as returned by fetchList()
* @return array an array with the group names to use in Nextcloud * @return array an array with the group names to use in Nextcloud
* *
* gives back the group names as they are used ownClod internally * gives back the group names as they are used ownClod internally
* @throws \Exception
*/ */
public function nextcloudGroupNames($ldapGroups) { public function nextcloudGroupNames($ldapGroups) {
return $this->ldap2NextcloudNames($ldapGroups, false); return $this->ldap2NextcloudNames($ldapGroups, false);
@ -753,9 +761,11 @@ class Access extends LDAPUtility {
/** /**
* caches the user display name * caches the user display name
*
* @param string $ocName the internal Nextcloud username * @param string $ocName the internal Nextcloud username
* @param string $displayName the display name * @param string $displayName the display name
* @param string $displayName2 the second display name * @param string $displayName2 the second display name
* @throws \Exception
*/ */
public function cacheUserDisplayName($ocName, $displayName, $displayName2 = '') { public function cacheUserDisplayName($ocName, $displayName, $displayName2 = '') {
$user = $this->userManager->get($ocName); $user = $this->userManager->get($ocName);
@ -885,6 +895,7 @@ class Access extends LDAPUtility {
* @param int $offset * @param int $offset
* @param bool $forceApplyAttributes * @param bool $forceApplyAttributes
* @return array * @return array
* @throws \Exception
*/ */
public function fetchListOfUsers($filter, $attr, $limit = null, $offset = null, $forceApplyAttributes = false) { public function fetchListOfUsers($filter, $attr, $limit = null, $offset = null, $forceApplyAttributes = false) {
$ldapRecords = $this->searchUsers($filter, $attr, $limit, $offset); $ldapRecords = $this->searchUsers($filter, $attr, $limit, $offset);
@ -973,6 +984,7 @@ class Access extends LDAPUtility {
/** /**
* executes an LDAP search, optimized for Users * executes an LDAP search, optimized for Users
*
* @param string $filter the LDAP filter for the search * @param string $filter the LDAP filter for the search
* @param string|string[] $attr optional, when a certain attribute shall be filtered out * @param string|string[] $attr optional, when a certain attribute shall be filtered out
* @param integer $limit * @param integer $limit
@ -980,6 +992,7 @@ class Access extends LDAPUtility {
* @return array with the search result * @return array with the search result
* *
* Executes an LDAP search * Executes an LDAP search
* @throws ServerNotAvailableException
*/ */
public function searchUsers($filter, $attr = null, $limit = null, $offset = null) { public function searchUsers($filter, $attr = null, $limit = null, $offset = null) {
$result = []; $result = [];
@ -995,6 +1008,7 @@ class Access extends LDAPUtility {
* @param int $limit * @param int $limit
* @param int $offset * @param int $offset
* @return false|int * @return false|int
* @throws ServerNotAvailableException
*/ */
public function countUsers($filter, $attr = array('dn'), $limit = null, $offset = null) { public function countUsers($filter, $attr = array('dn'), $limit = null, $offset = null) {
$result = false; $result = false;
@ -1007,6 +1021,7 @@ class Access extends LDAPUtility {
/** /**
* executes an LDAP search, optimized for Groups * executes an LDAP search, optimized for Groups
*
* @param string $filter the LDAP filter for the search * @param string $filter the LDAP filter for the search
* @param string|string[] $attr optional, when a certain attribute shall be filtered out * @param string|string[] $attr optional, when a certain attribute shall be filtered out
* @param integer $limit * @param integer $limit
@ -1014,6 +1029,7 @@ class Access extends LDAPUtility {
* @return array with the search result * @return array with the search result
* *
* Executes an LDAP search * Executes an LDAP search
* @throws ServerNotAvailableException
*/ */
public function searchGroups($filter, $attr = null, $limit = null, $offset = null) { public function searchGroups($filter, $attr = null, $limit = null, $offset = null) {
$result = []; $result = [];
@ -1025,11 +1041,13 @@ class Access extends LDAPUtility {
/** /**
* returns the number of available groups * returns the number of available groups
*
* @param string $filter the LDAP search filter * @param string $filter the LDAP search filter
* @param string[] $attr optional * @param string[] $attr optional
* @param int|null $limit * @param int|null $limit
* @param int|null $offset * @param int|null $offset
* @return int|bool * @return int|bool
* @throws ServerNotAvailableException
*/ */
public function countGroups($filter, $attr = array('dn'), $limit = null, $offset = null) { public function countGroups($filter, $attr = array('dn'), $limit = null, $offset = null) {
$result = false; $result = false;
@ -1046,6 +1064,7 @@ class Access extends LDAPUtility {
* @param int|null $limit * @param int|null $limit
* @param int|null $offset * @param int|null $offset
* @return int|bool * @return int|bool
* @throws ServerNotAvailableException
*/ */
public function countObjects($limit = null, $offset = null) { public function countObjects($limit = null, $offset = null) {
$result = false; $result = false;
@ -1149,6 +1168,7 @@ class Access extends LDAPUtility {
/** /**
* processes an LDAP paged search operation * processes an LDAP paged search operation
*
* @param array $sr the array containing the LDAP search resources * @param array $sr the array containing the LDAP search resources
* @param string $filter the LDAP filter for the search * @param string $filter the LDAP filter for the search
* @param array $base an array containing the LDAP subtree(s) that shall be searched * @param array $base an array containing the LDAP subtree(s) that shall be searched
@ -1159,6 +1179,7 @@ class Access extends LDAPUtility {
* @param bool $skipHandling required for paged search when cookies to * @param bool $skipHandling required for paged search when cookies to
* prior results need to be gained * prior results need to be gained
* @return bool cookie validity, true if we have more pages, false otherwise. * @return bool cookie validity, true if we have more pages, false otherwise.
* @throws ServerNotAvailableException
*/ */
private function processPagedSearchStatus($sr, $filter, $base, $iFoundItems, $limit, $offset, $pagedSearchOK, $skipHandling) { private function processPagedSearchStatus($sr, $filter, $base, $iFoundItems, $limit, $offset, $pagedSearchOK, $skipHandling) {
$cookie = null; $cookie = null;
@ -1251,6 +1272,7 @@ class Access extends LDAPUtility {
/** /**
* @param array $searchResults * @param array $searchResults
* @return int * @return int
* @throws ServerNotAvailableException
*/ */
private function countEntriesInSearchResults($searchResults) { private function countEntriesInSearchResults($searchResults) {
$counter = 0; $counter = 0;
@ -1656,6 +1678,7 @@ class Access extends LDAPUtility {
* @param bool $force the detection should be run, even if it is not set to auto * @param bool $force the detection should be run, even if it is not set to auto
* @param array|null $ldapRecord * @param array|null $ldapRecord
* @return bool true on success, false otherwise * @return bool true on success, false otherwise
* @throws ServerNotAvailableException
*/ */
private function detectUuidAttribute($dn, $isUser = true, $force = false, array $ldapRecord = null) { private function detectUuidAttribute($dn, $isUser = true, $force = false, array $ldapRecord = null) {
if($isUser) { if($isUser) {
@ -1711,6 +1734,7 @@ class Access extends LDAPUtility {
* @param bool $isUser * @param bool $isUser
* @param null $ldapRecord * @param null $ldapRecord
* @return bool|string * @return bool|string
* @throws ServerNotAvailableException
*/ */
public function getUUID($dn, $isUser = true, $ldapRecord = null) { public function getUUID($dn, $isUser = true, $ldapRecord = null) {
if($isUser) { if($isUser) {
@ -1816,8 +1840,10 @@ class Access extends LDAPUtility {
/** /**
* gets a SID of the domain of the given dn * gets a SID of the domain of the given dn
*
* @param string $dn * @param string $dn
* @return string|bool * @return string|bool
* @throws ServerNotAvailableException
*/ */
public function getSID($dn) { public function getSID($dn) {
$domainDN = $this->getDomainDNFromDN($dn); $domainDN = $this->getDomainDNFromDN($dn);
@ -1986,12 +2012,14 @@ class Access extends LDAPUtility {
/** /**
* Prepares a paged search, if possible * Prepares a paged search, if possible
*
* @param string $filter the LDAP filter for the search * @param string $filter the LDAP filter for the search
* @param string[] $bases an array containing the LDAP subtree(s) that shall be searched * @param string[] $bases an array containing the LDAP subtree(s) that shall be searched
* @param string[] $attr optional, when a certain attribute shall be filtered outside * @param string[] $attr optional, when a certain attribute shall be filtered outside
* @param int $limit * @param int $limit
* @param int $offset * @param int $offset
* @return bool|true * @return bool|true
* @throws ServerNotAvailableException
*/ */
private function initPagedSearch($filter, $bases, $attr, $limit, $offset) { private function initPagedSearch($filter, $bases, $attr, $limit, $offset) {
$pagedSearchOK = false; $pagedSearchOK = false;