From 11f29f6d9519e577eb8d089d518f0b0f7cfa2654 Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Sat, 18 Apr 2015 11:46:29 +0200 Subject: [PATCH 1/2] add visibility of methods in server container and interface --- lib/private/server.php | 96 ++++++++++++++++----------------- lib/public/iservercontainer.php | 92 +++++++++++++++---------------- 2 files changed, 94 insertions(+), 94 deletions(-) diff --git a/lib/private/server.php b/lib/private/server.php index ea673ea148..d321ecb68b 100644 --- a/lib/private/server.php +++ b/lib/private/server.php @@ -72,7 +72,7 @@ class Server extends SimpleContainer implements IServerContainer { /** * @param string $webRoot */ - function __construct($webRoot) { + public function __construct($webRoot) { $this->webRoot = $webRoot; $this->registerService('ContactsManager', function ($c) { @@ -417,21 +417,21 @@ class Server extends SimpleContainer implements IServerContainer { /** * @return \OCP\Contacts\IManager */ - function getContactsManager() { + public function getContactsManager() { return $this->query('ContactsManager'); } /** * @return \OC\Encryption\Manager */ - function getEncryptionManager() { + public function getEncryptionManager() { return $this->query('EncryptionManager'); } /** * @return \OC\Encryption\File */ - function getEncryptionFilesHelper() { + public function getEncryptionFilesHelper() { return $this->query('EncryptionFileHelper'); } @@ -440,7 +440,7 @@ class Server extends SimpleContainer implements IServerContainer { * * @return \OCP\Encryption\Keys\IStorage */ - function getEncryptionKeyStorage($encryptionModuleId) { + public function getEncryptionKeyStorage($encryptionModuleId) { $view = new \OC\Files\View(); $util = new \OC\Encryption\Util( $view, @@ -458,7 +458,7 @@ class Server extends SimpleContainer implements IServerContainer { * * @return \OCP\IRequest */ - function getRequest() { + public function getRequest() { return $this->query('Request'); } @@ -467,7 +467,7 @@ class Server extends SimpleContainer implements IServerContainer { * * @return \OCP\IPreview */ - function getPreviewManager() { + public function getPreviewManager() { return $this->query('PreviewManager'); } @@ -477,7 +477,7 @@ class Server extends SimpleContainer implements IServerContainer { * @see \OCP\ITagManager::load() * @return \OCP\ITagManager */ - function getTagManager() { + public function getTagManager() { return $this->query('TagManager'); } @@ -486,7 +486,7 @@ class Server extends SimpleContainer implements IServerContainer { * * @return \OCP\IAvatarManager */ - function getAvatarManager() { + public function getAvatarManager() { return $this->query('AvatarManager'); } @@ -495,7 +495,7 @@ class Server extends SimpleContainer implements IServerContainer { * * @return \OCP\Files\Folder */ - function getRootFolder() { + public function getRootFolder() { return $this->query('RootFolder'); } @@ -505,7 +505,7 @@ class Server extends SimpleContainer implements IServerContainer { * @param string $userId user ID * @return \OCP\Files\Folder */ - function getUserFolder($userId = null) { + public function getUserFolder($userId = null) { if ($userId === null) { $user = $this->getUserSession()->getUser(); if (!$user) { @@ -542,7 +542,7 @@ class Server extends SimpleContainer implements IServerContainer { * * @return \OCP\Files\Folder */ - function getAppFolder() { + public function getAppFolder() { $dir = '/' . \OC_App::getCurrentApp(); $root = $this->getRootFolder(); $folder = null; @@ -557,49 +557,49 @@ class Server extends SimpleContainer implements IServerContainer { /** * @return \OC\User\Manager */ - function getUserManager() { + public function getUserManager() { return $this->query('UserManager'); } /** * @return \OC\Group\Manager */ - function getGroupManager() { + public function getGroupManager() { return $this->query('GroupManager'); } /** * @return \OC\User\Session */ - function getUserSession() { + public function getUserSession() { return $this->query('UserSession'); } /** * @return \OCP\ISession */ - function getSession() { + public function getSession() { return $this->query('UserSession')->getSession(); } /** * @param \OCP\ISession $session */ - function setSession(\OCP\ISession $session) { + public function setSession(\OCP\ISession $session) { return $this->query('UserSession')->setSession($session); } /** * @return \OC\NavigationManager */ - function getNavigationManager() { + public function getNavigationManager() { return $this->query('NavigationManager'); } /** * @return \OCP\IConfig */ - function getConfig() { + public function getConfig() { return $this->query('AllConfig'); } @@ -608,7 +608,7 @@ class Server extends SimpleContainer implements IServerContainer { * * @return \OC\SystemConfig */ - function getSystemConfig() { + public function getSystemConfig() { return $this->query('SystemConfig'); } @@ -617,7 +617,7 @@ class Server extends SimpleContainer implements IServerContainer { * * @return \OCP\IAppConfig */ - function getAppConfig() { + public function getAppConfig() { return $this->query('AppConfig'); } @@ -628,21 +628,21 @@ class Server extends SimpleContainer implements IServerContainer { * @param string $lang * @return \OC_L10N */ - function getL10N($app, $lang = null) { + public function getL10N($app, $lang = null) { return $this->query('L10NFactory')->get($app, $lang); } /** * @return \OCP\IURLGenerator */ - function getURLGenerator() { + public function getURLGenerator() { return $this->query('URLGenerator'); } /** * @return \OCP\IHelper */ - function getHelper() { + public function getHelper() { return $this->query('AppHelper'); } @@ -651,7 +651,7 @@ class Server extends SimpleContainer implements IServerContainer { * * @return \OCP\ICache */ - function getCache() { + public function getCache() { return $this->query('UserCache'); } @@ -660,7 +660,7 @@ class Server extends SimpleContainer implements IServerContainer { * * @return \OCP\ICacheFactory */ - function getMemCacheFactory() { + public function getMemCacheFactory() { return $this->query('MemCacheFactory'); } @@ -669,7 +669,7 @@ class Server extends SimpleContainer implements IServerContainer { * * @return \OCP\IDBConnection */ - function getDatabaseConnection() { + public function getDatabaseConnection() { return $this->query('DatabaseConnection'); } @@ -678,7 +678,7 @@ class Server extends SimpleContainer implements IServerContainer { * * @return \OCP\Activity\IManager */ - function getActivityManager() { + public function getActivityManager() { return $this->query('ActivityManager'); } @@ -687,7 +687,7 @@ class Server extends SimpleContainer implements IServerContainer { * * @return \OCP\BackgroundJob\IJobList */ - function getJobList() { + public function getJobList() { return $this->query('JobList'); } @@ -696,7 +696,7 @@ class Server extends SimpleContainer implements IServerContainer { * * @return \OCP\ILogger */ - function getLogger() { + public function getLogger() { return $this->query('Logger'); } @@ -705,7 +705,7 @@ class Server extends SimpleContainer implements IServerContainer { * * @return \OCP\Route\IRouter */ - function getRouter() { + public function getRouter() { return $this->query('Router'); } @@ -714,7 +714,7 @@ class Server extends SimpleContainer implements IServerContainer { * * @return \OCP\ISearch */ - function getSearch() { + public function getSearch() { return $this->query('Search'); } @@ -723,7 +723,7 @@ class Server extends SimpleContainer implements IServerContainer { * * @return \OCP\Security\ISecureRandom */ - function getSecureRandom() { + public function getSecureRandom() { return $this->query('SecureRandom'); } @@ -732,7 +732,7 @@ class Server extends SimpleContainer implements IServerContainer { * * @return \OCP\Security\ICrypto */ - function getCrypto() { + public function getCrypto() { return $this->query('Crypto'); } @@ -741,7 +741,7 @@ class Server extends SimpleContainer implements IServerContainer { * * @return \OCP\Security\IHasher */ - function getHasher() { + public function getHasher() { return $this->query('Hasher'); } @@ -750,7 +750,7 @@ class Server extends SimpleContainer implements IServerContainer { * @deprecated use getDatabaseConnection, will be removed in ownCloud 10 * @return \OCP\IDb */ - function getDb() { + public function getDb() { return $this->query('Db'); } @@ -759,7 +759,7 @@ class Server extends SimpleContainer implements IServerContainer { * @deprecated Use getHTTPClientService() * @return \OC\HTTPHelper */ - function getHTTPHelper() { + public function getHTTPHelper() { return $this->query('HTTPHelper'); } @@ -769,7 +769,7 @@ class Server extends SimpleContainer implements IServerContainer { * @param string $uid (optional) if not specified the current loggedin user is used * @return \OCP\ICertificateManager */ - function getCertificateManager($uid = null) { + public function getCertificateManager($uid = null) { if (is_null($uid)) { $userSession = $this->getUserSession(); $user = $userSession->getUser(); @@ -786,7 +786,7 @@ class Server extends SimpleContainer implements IServerContainer { * * @return \OCP\Http\Client\IClientService */ - function getHTTPClientService() { + public function getHTTPClientService() { return $this->query('HttpClientService'); } @@ -795,7 +795,7 @@ class Server extends SimpleContainer implements IServerContainer { * * @return \OCP\IEventSource */ - function createEventSource() { + public function createEventSource() { return new \OC_EventSource(); } @@ -806,7 +806,7 @@ class Server extends SimpleContainer implements IServerContainer { * * @return \OCP\Diagnostics\IEventLogger */ - function getEventLogger() { + public function getEventLogger() { return $this->query('EventLogger'); } @@ -817,7 +817,7 @@ class Server extends SimpleContainer implements IServerContainer { * * @return \OCP\Diagnostics\IQueryLogger */ - function getQueryLogger() { + public function getQueryLogger() { return $this->query('QueryLogger'); } @@ -826,7 +826,7 @@ class Server extends SimpleContainer implements IServerContainer { * * @return \OCP\ITempManager */ - function getTempManager() { + public function getTempManager() { return $this->query('TempManager'); } @@ -835,7 +835,7 @@ class Server extends SimpleContainer implements IServerContainer { * * @return \OCP\App\IAppManager */ - function getAppManager() { + public function getAppManager() { return $this->query('AppManager'); } @@ -844,7 +844,7 @@ class Server extends SimpleContainer implements IServerContainer { * * @return \OCP\Mail\IMailer */ - function getMailer() { + public function getMailer() { return $this->query('Mailer'); } @@ -853,7 +853,7 @@ class Server extends SimpleContainer implements IServerContainer { * * @return string */ - function getWebRoot() { + public function getWebRoot() { return $this->webRoot; } @@ -881,7 +881,7 @@ class Server extends SimpleContainer implements IServerContainer { /** * @return \OCP\Files\Config\IMountProviderCollection */ - function getMountProviderCollection(){ + public function getMountProviderCollection(){ return $this->query('MountConfigManager'); } @@ -897,7 +897,7 @@ class Server extends SimpleContainer implements IServerContainer { /** * @return \OCP\Command\IBus */ - function getCommandBus(){ + public function getCommandBus(){ return $this->query('AsyncCommandBus'); } diff --git a/lib/public/iservercontainer.php b/lib/public/iservercontainer.php index 7eb753b3ff..f1eabda033 100644 --- a/lib/public/iservercontainer.php +++ b/lib/public/iservercontainer.php @@ -55,7 +55,7 @@ interface IServerContainer { * @return \OCP\Contacts\IManager * @since 6.0.0 */ - function getContactsManager(); + public function getContactsManager(); /** * The current request object holding all information about the request currently being processed @@ -65,7 +65,7 @@ interface IServerContainer { * @return \OCP\IRequest * @since 6.0.0 */ - function getRequest(); + public function getRequest(); /** * Returns the preview manager which can create preview images for a given file @@ -73,7 +73,7 @@ interface IServerContainer { * @return \OCP\IPreview * @since 6.0.0 */ - function getPreviewManager(); + public function getPreviewManager(); /** * Returns the tag manager which can get and set tags for different object types @@ -82,7 +82,7 @@ interface IServerContainer { * @return \OCP\ITagManager * @since 6.0.0 */ - function getTagManager(); + public function getTagManager(); /** * Returns the root folder of ownCloud's data directory @@ -90,7 +90,7 @@ interface IServerContainer { * @return \OCP\Files\Folder * @since 6.0.0 */ - function getRootFolder(); + public function getRootFolder(); /** * Returns a view to ownCloud's files folder @@ -99,7 +99,7 @@ interface IServerContainer { * @return \OCP\Files\Folder * @since 6.0.0 - parameter $userId was added in 8.0.0 */ - function getUserFolder($userId = null); + public function getUserFolder($userId = null); /** * Returns an app-specific view in ownClouds data directory @@ -107,7 +107,7 @@ interface IServerContainer { * @return \OCP\Files\Folder * @since 6.0.0 */ - function getAppFolder(); + public function getAppFolder(); /** * Returns a user manager @@ -115,7 +115,7 @@ interface IServerContainer { * @return \OCP\IUserManager * @since 8.0.0 */ - function getUserManager(); + public function getUserManager(); /** * Returns a group manager @@ -123,7 +123,7 @@ interface IServerContainer { * @return \OCP\IGroupManager * @since 8.0.0 */ - function getGroupManager(); + public function getGroupManager(); /** * Returns the user session @@ -131,7 +131,7 @@ interface IServerContainer { * @return \OCP\IUserSession * @since 6.0.0 */ - function getUserSession(); + public function getUserSession(); /** * Returns the navigation manager @@ -139,7 +139,7 @@ interface IServerContainer { * @return \OCP\INavigationManager * @since 6.0.0 */ - function getNavigationManager(); + public function getNavigationManager(); /** * Returns the config manager @@ -147,7 +147,7 @@ interface IServerContainer { * @return \OCP\IConfig * @since 6.0.0 */ - function getConfig(); + public function getConfig(); /** * Returns a Crypto instance @@ -155,7 +155,7 @@ interface IServerContainer { * @return \OCP\Security\ICrypto * @since 8.0.0 */ - function getCrypto(); + public function getCrypto(); /** * Returns a Hasher instance @@ -163,7 +163,7 @@ interface IServerContainer { * @return \OCP\Security\IHasher * @since 8.0.0 */ - function getHasher(); + public function getHasher(); /** * Returns a SecureRandom instance @@ -171,7 +171,7 @@ interface IServerContainer { * @return \OCP\Security\ISecureRandom * @since 8.1.0 */ - function getSecureRandom(); + public function getSecureRandom(); /** * Returns an instance of the db facade @@ -179,7 +179,7 @@ interface IServerContainer { * @return \OCP\IDb * @since 7.0.0 */ - function getDb(); + public function getDb(); /** * Returns the app config manager @@ -187,7 +187,7 @@ interface IServerContainer { * @return \OCP\IAppConfig * @since 7.0.0 */ - function getAppConfig(); + public function getAppConfig(); /** * get an L10N instance @@ -196,19 +196,19 @@ interface IServerContainer { * @return \OCP\IL10N * @since 6.0.0 - parameter $lang was added in 8.0.0 */ - function getL10N($app, $lang = null); + public function getL10N($app, $lang = null); /** * @return \OC\Encryption\Manager * @since 8.1.0 */ - function getEncryptionManager(); + public function getEncryptionManager(); /** * @return \OC\Encryption\File * @since 8.1.0 */ - function getEncryptionFilesHelper(); + public function getEncryptionFilesHelper(); /** * @param string $encryptionModuleId encryption module ID @@ -216,7 +216,7 @@ interface IServerContainer { * @return \OCP\Encryption\Keys\IStorage * @since 8.1.0 */ - function getEncryptionKeyStorage($encryptionModuleId); + public function getEncryptionKeyStorage($encryptionModuleId); /** * Returns the URL generator @@ -224,7 +224,7 @@ interface IServerContainer { * @return \OCP\IURLGenerator * @since 6.0.0 */ - function getURLGenerator(); + public function getURLGenerator(); /** * Returns the Helper @@ -232,7 +232,7 @@ interface IServerContainer { * @return \OCP\IHelper * @since 6.0.0 */ - function getHelper(); + public function getHelper(); /** * Returns an ICache instance @@ -240,7 +240,7 @@ interface IServerContainer { * @return \OCP\ICache * @since 6.0.0 */ - function getCache(); + public function getCache(); /** * Returns an \OCP\CacheFactory instance @@ -248,7 +248,7 @@ interface IServerContainer { * @return \OCP\ICacheFactory * @since 7.0.0 */ - function getMemCacheFactory(); + public function getMemCacheFactory(); /** * Returns the current session @@ -256,7 +256,7 @@ interface IServerContainer { * @return \OCP\ISession * @since 6.0.0 */ - function getSession(); + public function getSession(); /** * Returns the activity manager @@ -264,7 +264,7 @@ interface IServerContainer { * @return \OCP\Activity\IManager * @since 6.0.0 */ - function getActivityManager(); + public function getActivityManager(); /** * Returns the current session @@ -272,7 +272,7 @@ interface IServerContainer { * @return \OCP\IDBConnection * @since 6.0.0 */ - function getDatabaseConnection(); + public function getDatabaseConnection(); /** * Returns an avatar manager, used for avatar functionality @@ -280,7 +280,7 @@ interface IServerContainer { * @return \OCP\IAvatarManager * @since 6.0.0 */ - function getAvatarManager(); + public function getAvatarManager(); /** * Returns an job list for controlling background jobs @@ -288,7 +288,7 @@ interface IServerContainer { * @return \OCP\BackgroundJob\IJobList * @since 7.0.0 */ - function getJobList(); + public function getJobList(); /** * Returns a logger instance @@ -296,7 +296,7 @@ interface IServerContainer { * @return \OCP\ILogger * @since 8.0.0 */ - function getLogger(); + public function getLogger(); /** * Returns a router for generating and matching urls @@ -304,7 +304,7 @@ interface IServerContainer { * @return \OCP\Route\IRouter * @since 7.0.0 */ - function getRouter(); + public function getRouter(); /** * Returns a search instance @@ -312,7 +312,7 @@ interface IServerContainer { * @return \OCP\ISearch * @since 7.0.0 */ - function getSearch(); + public function getSearch(); /** * Get the certificate manager for the user @@ -321,7 +321,7 @@ interface IServerContainer { * @return \OCP\ICertificateManager * @since 8.0.0 */ - function getCertificateManager($user = null); + public function getCertificateManager($user = null); /** * Create a new event source @@ -329,7 +329,7 @@ interface IServerContainer { * @return \OCP\IEventSource * @since 8.0.0 */ - function createEventSource(); + public function createEventSource(); /** * Returns an instance of the HTTP helper class @@ -337,7 +337,7 @@ interface IServerContainer { * @deprecated Use \OCP\Http\Client\IClientService * @since 8.0.0 */ - function getHTTPHelper(); + public function getHTTPHelper(); /** * Returns an instance of the HTTP client service @@ -345,7 +345,7 @@ interface IServerContainer { * @return \OCP\Http\Client\IClientService * @since 8.1.0 */ - function getHTTPClientService(); + public function getHTTPClientService(); /** * Get the active event logger @@ -353,7 +353,7 @@ interface IServerContainer { * @return \OCP\Diagnostics\IEventLogger * @since 8.0.0 */ - function getEventLogger(); + public function getEventLogger(); /** * Get the active query logger @@ -363,7 +363,7 @@ interface IServerContainer { * @return \OCP\Diagnostics\IQueryLogger * @since 8.0.0 */ - function getQueryLogger(); + public function getQueryLogger(); /** * Get the manager for temporary files and folders @@ -371,7 +371,7 @@ interface IServerContainer { * @return \OCP\ITempManager * @since 8.0.0 */ - function getTempManager(); + public function getTempManager(); /** * Get the app manager @@ -379,7 +379,7 @@ interface IServerContainer { * @return \OCP\App\IAppManager * @since 8.0.0 */ - function getAppManager(); + public function getAppManager(); /** * Get the webroot @@ -387,13 +387,13 @@ interface IServerContainer { * @return string * @since 8.0.0 */ - function getWebRoot(); + public function getWebRoot(); /** * @return \OCP\Files\Config\IMountProviderCollection * @since 8.0.0 */ - function getMountProviderCollection(); + public function getMountProviderCollection(); /** * Get the IniWrapper @@ -401,12 +401,12 @@ interface IServerContainer { * @return \bantu\IniGetWrapper\IniGetWrapper * @since 8.0.0 */ - function getIniWrapper(); + public function getIniWrapper(); /** * @return \OCP\Command\IBus * @since 8.1.0 */ - function getCommandBus(); + public function getCommandBus(); /** * Creates a new mailer @@ -414,5 +414,5 @@ interface IServerContainer { * @return \OCP\Mail\IMailer * @since 8.1.0 */ - function getMailer(); + public function getMailer(); } From f72dabb4eb682d6ba82b5e946b7dbf5ddcdab291 Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Sat, 18 Apr 2015 14:31:28 +0200 Subject: [PATCH 2/2] fix wrong variable names in PHPDoc --- lib/public/appframework/apicontroller.php | 4 ++-- lib/public/appframework/ocscontroller.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/public/appframework/apicontroller.php b/lib/public/appframework/apicontroller.php index 0af37f3a61..90eea47d73 100644 --- a/lib/public/appframework/apicontroller.php +++ b/lib/public/appframework/apicontroller.php @@ -45,10 +45,10 @@ abstract class ApiController extends Controller { * constructor of the controller * @param string $appName the name of the app * @param IRequest $request an instance of the request - * @param string $corsMethods: comma seperated string of HTTP verbs which + * @param string $corsMethods comma seperated string of HTTP verbs which * should be allowed for websites or webapps when calling your API, defaults to * 'PUT, POST, GET, DELETE, PATCH' - * @param string $corsAllowedHeaders: comma seperated string of HTTP headers + * @param string $corsAllowedHeaders comma seperated string of HTTP headers * which should be allowed for websites or webapps when calling your API, * defaults to 'Authorization, Content-Type, Accept' * @param int $corsMaxAge number in seconds how long a preflighted OPTIONS diff --git a/lib/public/appframework/ocscontroller.php b/lib/public/appframework/ocscontroller.php index 93077586f4..602731fe76 100644 --- a/lib/public/appframework/ocscontroller.php +++ b/lib/public/appframework/ocscontroller.php @@ -42,10 +42,10 @@ abstract class OCSController extends ApiController { * constructor of the controller * @param string $appName the name of the app * @param IRequest $request an instance of the request - * @param string $corsMethods: comma seperated string of HTTP verbs which + * @param string $corsMethods comma seperated string of HTTP verbs which * should be allowed for websites or webapps when calling your API, defaults to * 'PUT, POST, GET, DELETE, PATCH' - * @param string $corsAllowedHeaders: comma seperated string of HTTP headers + * @param string $corsAllowedHeaders comma seperated string of HTTP headers * which should be allowed for websites or webapps when calling your API, * defaults to 'Authorization, Content-Type, Accept' * @param int $corsMaxAge number in seconds how long a preflighted OPTIONS