Commit adaee6a5 authored by Scrutinizer Auto-Fixer's avatar Scrutinizer Auto-Fixer Committed by Scrutinizer
Browse files

Scrutinizer Auto-Fixes

This patch was automatically generated as part of the following inspection:
https://scrutinizer-ci.com/g/owncloud/core/inspections/cdfecc4e-a37e-4233-8025-f0d7252a8720

Enabled analysis tools:
 - PHP Analyzer
 - JSHint
 - PHP Copy/Paste Detector
 - PHP PDepend
parent 1e321406
......@@ -425,7 +425,7 @@ class Helper {
/**
* @brief glob uses different pattern than regular expressions, escape glob pattern only
* @param string $path unescaped path
* @return escaped path
* @return string path
*/
public static function escapeGlobPattern($path) {
return preg_replace('/(\*|\?|\[)/', '[$1]', $path);
......
......@@ -67,7 +67,7 @@ class Google extends \OC\Files\Storage\Common {
/**
* Get the Google_DriveFile object for the specified path
* @param string $path
* @return Google_DriveFile|false
* @return string
*/
private function getDriveFile($path) {
// Remove leading and trailing slashes
......
......@@ -11,6 +11,7 @@ namespace OC\Files\Storage;
abstract class StreamWrapper extends Common {
/**
* @param string $path
* @return string|null
*/
abstract public function constructUrl($path);
......
......@@ -336,6 +336,9 @@ class DAV extends \OC\Files\Storage\Common{
}
}
/**
* @param string $path
*/
public function cleanPath($path) {
$path = \OC\Files\Filesystem::normalizePath($path);
// remove leading slash
......
......@@ -396,7 +396,7 @@ class Shared_Cache extends Cache {
* use the one with the highest id gives the best result with the background scanner, since that is most
* likely the folder where we stopped scanning previously
*
* @return string|bool the path of the folder or false when no folder matched
* @return boolean the path of the folder or false when no folder matched
*/
public function getIncomplete() {
return false;
......
......@@ -41,6 +41,7 @@ class Shared extends \OC\Files\Storage\Common {
/**
* @brief Get the source file path, permissions, and owner for a shared file
* @param string Shared target file path
* @param string $target
* @return Returns array with the keys path, permissions, and owner or false if not found
*/
public function getFile($target) {
......
......@@ -336,7 +336,7 @@ class Storage {
* @brief deletes used space for files versions in db if user was deleted
*
* @param type $uid id of deleted user
* @return result of db delete operation
* @return \OC_DB_StatementWrapper of db delete operation
*/
public static function deleteUser($uid) {
$query = \OC_DB::prepare('DELETE FROM `*PREFIX*files_versions` WHERE `user`=?');
......@@ -420,8 +420,8 @@ class Storage {
/**
* @brief get list of files we want to expire
* @param integer $currentTime timestamp of current time
* @param array $versions list of versions
* @param integer $time
* @return array containing the list of to deleted versions and the size of them
*/
protected static function getExpireList($time, $versions) {
......
......@@ -164,6 +164,7 @@ class Access extends LDAPUtility {
/**
* gives back the database table for the query
* @param boolean $isUser
*/
private function getMapTable($isUser) {
if($isUser) {
......@@ -644,6 +645,8 @@ class Access extends LDAPUtility {
* @brief executes an LDAP search, optimized for Users
* @param $filter the LDAP filter for the search
* @param $attr optional, when a certain attribute shall be filtered out
* @param integer $limit
* @param integer $offset
* @returns array with the search result
*
* Executes an LDAP search
......@@ -661,8 +664,10 @@ class Access extends LDAPUtility {
/**
* @brief executes an LDAP search, optimized for Groups
* @param $filter the LDAP filter for the search
* @param string $filter the LDAP filter for the search
* @param $attr optional, when a certain attribute shall be filtered out
* @param integer $limit
* @param integer $offset
* @returns array with the search result
*
* Executes an LDAP search
......@@ -757,7 +762,7 @@ class Access extends LDAPUtility {
/**
* @brief executes an LDAP search, but counts the results only
* @param $filter the LDAP filter for the search
* @param string $filter the LDAP filter for the search
* @param $base an array containing the LDAP subtree(s) that shall be searched
* @param $attr optional, array, one or more attributes that shall be
* retrieved. Results will according to the order in the array.
......@@ -1006,6 +1011,9 @@ class Access extends LDAPUtility {
return $this->combineFilterWithOr($filter);
}
/**
* @param string $password
*/
public function areCredentialsValid($name, $password) {
$name = $this->DNasBaseParameter($name);
$testConnection = clone $this->connection;
......
......@@ -159,6 +159,9 @@ class Connection extends LDAPUtility {
return unserialize(base64_decode($this->cache->get($key)));
}
/**
* @param string $key
*/
public function isCached($key) {
if(!$this->configured) {
$this->readConfiguration();
......
......@@ -56,8 +56,13 @@ abstract class Proxy {
/**
* @param boolean $passOnWhen
* @param string $method
*/
abstract protected function callOnLastSeenOn($id, $method, $parameters, $passOnWhen);
/**
* @param string $method
*/
abstract protected function walkBackends($id, $method, $parameters);
/**
......@@ -95,6 +100,9 @@ abstract class Proxy {
return unserialize(base64_decode($this->cache->get($key)));
}
/**
* @param string $key
*/
public function isCached($key) {
$key = $this->getCacheKey($key);
return $this->cache->hasKey($key);
......
......@@ -865,8 +865,8 @@ class Wizard extends LDAPUtility {
/**
* @brief does a cumulativeSearch on LDAP to get different values of a
* specified attribute
* @param $filters array, the filters that shall be used in the search
* @param $attr the attribute of which a list of values shall be returned
* @param string[] $filters array, the filters that shall be used in the search
* @param string $attr the attribute of which a list of values shall be returned
* @param $lfw bool, whether the last filter is a wildcard which shall not
* be processed if there were already findings, defaults to true
* @param string $maxF string. if not null, this variable will have the filter that
......@@ -933,8 +933,8 @@ class Wizard extends LDAPUtility {
* @brief determines if and which $attr are available on the LDAP server
* @param string[] $objectclasses the objectclasses to use as search filter
* @param string $attr the attribute to look for
* @param $dbkey the dbkey of the setting the feature is connected to
* @param $confkey the confkey counterpart for the $dbkey as used in the
* @param string $dbkey the dbkey of the setting the feature is connected to
* @param string $confkey the confkey counterpart for the $dbkey as used in the
* Configuration class
* @param $po boolean, whether the objectClass with most result entries
* shall be pre-selected via the result
......
......@@ -25,7 +25,6 @@
namespace OCA\user_ldap;
use OCA\user_ldap\lib\ILDAPWrapper;
use OCA\user_ldap\lib\BackendUtility;
class USER_LDAP extends BackendUtility implements \OCP\UserInterface {
......@@ -139,7 +138,7 @@ class USER_LDAP extends BackendUtility implements \OCP\UserInterface {
* @brief reads the image from LDAP that shall be used as Avatar
* @param $uid string, the ownCloud user name
* @param $dn string, the user DN
* @return image data (provided by LDAP) | false
* @return string data (provided by LDAP) | false
*/
private function getAvatarImage($uid, $dn) {
$attributes = array('jpegPhoto', 'thumbnailPhoto');
......
......@@ -11,7 +11,6 @@ namespace OC\Core\Command\Db;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
class GenerateChangeScript extends Command {
......
......@@ -9,9 +9,7 @@
namespace OC\Core\Command;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
class Status extends Command {
......
......@@ -10,9 +10,7 @@ namespace OC\Core\Command;
use OC\Updater;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
class Upgrade extends Command {
......
......@@ -9,10 +9,8 @@
namespace OC\Core\Command\User;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Helper\TableHelper;
class Report extends Command {
protected function configure() {
......
......@@ -640,6 +640,8 @@ class OC_App{
/**
* register an admin form to be shown
* @param string $app
* @param string $page
*/
public static function registerAdmin($app, $page) {
self::$adminForms[]= $app.'/'.$page.'.php';
......
......@@ -69,6 +69,9 @@ class AppConfig implements \OCP\IAppConfig {
return $this->cache[$app];
}
/**
* @param string $app
*/
private function getAppValues($app) {
$appCache = $this->getAppCache($app);
if (array_search($app, $this->appsLoaded) === false) {
......@@ -184,7 +187,7 @@ class AppConfig implements \OCP\IAppConfig {
* @brief Deletes a key
* @param string $app app
* @param string $key key
* @return bool
* @return boolean|null
*/
public function deleteKey($app, $key) {
$where = array(
......@@ -200,7 +203,7 @@ class AppConfig implements \OCP\IAppConfig {
/**
* @brief Remove app from appconfig
* @param string $app app
* @return bool
* @return boolean|null
*
* Removes all keys in appconfig belonging to the app.
*/
......
......@@ -25,7 +25,6 @@
namespace OC\AppFramework;
use OC\AppFramework\DependencyInjection\DIContainer;
use OCP\AppFramework\IAppContainer;
/**
......
......@@ -34,7 +34,6 @@ use OC\AppFramework\Utility\SimpleContainer;
use OC\AppFramework\Utility\TimeFactory;
use OCP\AppFramework\IApi;
use OCP\AppFramework\IAppContainer;
use OCP\AppFramework\IMiddleWare;
use OCP\AppFramework\Middleware;
use OCP\IServerContainer;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment