diff options
author | Christoph Wurst <ChristophWurst@users.noreply.github.com> | 2020-04-09 16:53:09 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-09 16:53:09 +0300 |
commit | c56a273b39186c509c57ef6bec221d3c4e3d81d3 (patch) | |
tree | b2e4095e763874699646c2c90e41785c99b6f247 /lib | |
parent | f0dd71ccd266ede38114d25be035abb3f2661fc8 (diff) | |
parent | afbd9c4e6ed834e713039f2cff88ba3eec03dadb (diff) |
Merge pull request #20383 from nextcloud/techdebt/function-spacing
Unify function spacing to PSR2 recommendation
Diffstat (limited to 'lib')
82 files changed, 220 insertions, 220 deletions
diff --git a/lib/private/Accounts/Account.php b/lib/private/Accounts/Account.php index 3702458ec6b..446bb01d860 100644 --- a/lib/private/Accounts/Account.php +++ b/lib/private/Accounts/Account.php @@ -60,7 +60,7 @@ class Account implements IAccount { } public function getFilteredProperties(string $scope = null, string $verified = null): array { - return \array_filter($this->properties, function(IAccountProperty $obj) use ($scope, $verified){ + return \array_filter($this->properties, function (IAccountProperty $obj) use ($scope, $verified) { if ($scope !== null && $scope !== $obj->getScope()) { return false; } diff --git a/lib/private/App/CodeChecker/CodeChecker.php b/lib/private/App/CodeChecker/CodeChecker.php index 53fee7482ef..60276d5bfcc 100644 --- a/lib/private/App/CodeChecker/CodeChecker.php +++ b/lib/private/App/CodeChecker/CodeChecker.php @@ -89,12 +89,12 @@ class CodeChecker extends BasicEmitter { $excludedDirectories[] = 'lists'; } - $excludes = array_map(function($item) use ($folder) { + $excludes = array_map(function ($item) use ($folder) { return $folder . '/' . $item; }, $excludedDirectories); $iterator = new RecursiveDirectoryIterator($folder, RecursiveDirectoryIterator::SKIP_DOTS); - $iterator = new RecursiveCallbackFilterIterator($iterator, function($item) use ($excludes){ + $iterator = new RecursiveCallbackFilterIterator($iterator, function ($item) use ($excludes) { /** @var SplFileInfo $item */ foreach($excludes as $exclude) { if (substr($item->getPath(), 0, strlen($exclude)) === $exclude) { diff --git a/lib/private/AppConfig.php b/lib/private/AppConfig.php index e562870aa7f..f922033bdd1 100644 --- a/lib/private/AppConfig.php +++ b/lib/private/AppConfig.php @@ -284,7 +284,7 @@ class AppConfig implements IAppConfig { return $this->getAppValues($app); } else { $appIds = $this->getApps(); - $values = array_map(function($appId) use ($key) { + $values = array_map(function ($appId) use ($key) { return isset($this->cache[$appId][$key]) ? $this->cache[$appId][$key] : null; }, $appIds); $result = array_combine($appIds, $values); diff --git a/lib/private/AppFramework/App.php b/lib/private/AppFramework/App.php index 2cbe623bb27..f7defda487e 100644 --- a/lib/private/AppFramework/App.php +++ b/lib/private/AppFramework/App.php @@ -199,7 +199,7 @@ class App { * @param DIContainer $container an instance of a pimple container. */ public static function part(string $controllerName, string $methodName, array $urlParams, - DIContainer $container){ + DIContainer $container) { $container['urlParams'] = $urlParams; $controller = $container[$controllerName]; diff --git a/lib/private/AppFramework/DependencyInjection/DIContainer.php b/lib/private/AppFramework/DependencyInjection/DIContainer.php index 6f4a48d8907..14898fadf95 100644 --- a/lib/private/AppFramework/DependencyInjection/DIContainer.php +++ b/lib/private/AppFramework/DependencyInjection/DIContainer.php @@ -83,7 +83,7 @@ class DIContainer extends SimpleContainer implements IAppContainer { * @param array $urlParams * @param ServerContainer|null $server */ - public function __construct($appName, $urlParams = [], ServerContainer $server = null){ + public function __construct($appName, $urlParams = [], ServerContainer $server = null) { parent::__construct(); $this['AppName'] = $appName; $this['urlParams'] = $urlParams; @@ -105,11 +105,11 @@ class DIContainer extends SimpleContainer implements IAppContainer { /** * Core services */ - $this->registerService(IOutput::class, function(){ + $this->registerService(IOutput::class, function () { return new Output($this->getServer()->getWebRoot()); }); - $this->registerService(Folder::class, function() { + $this->registerService(Folder::class, function () { return $this->getServer()->getUserFolder(); }); @@ -117,7 +117,7 @@ class DIContainer extends SimpleContainer implements IAppContainer { return $this->getServer()->getAppDataDir($c->query('AppName')); }); - $this->registerService(IL10N::class, function($c) { + $this->registerService(IL10N::class, function ($c) { return $this->getServer()->getL10N($c->query('AppName')); }); @@ -156,14 +156,14 @@ class DIContainer extends SimpleContainer implements IAppContainer { return $c->query(OC\GlobalScale\Config::class); }); - $this->registerService('Protocol', function($c){ + $this->registerService('Protocol', function ($c) { /** @var \OC\Server $server */ $server = $c->query('ServerContainer'); $protocol = $server->getRequest()->getHttpProtocol(); return new Http($_SERVER, $protocol); }); - $this->registerService('Dispatcher', function($c) { + $this->registerService('Dispatcher', function ($c) { return new Dispatcher( $c['Protocol'], $c['MiddlewareDispatcher'], @@ -182,7 +182,7 @@ class DIContainer extends SimpleContainer implements IAppContainer { /** * Middleware */ - $this->registerService('MiddlewareDispatcher', function(SimpleContainer $c) { + $this->registerService('MiddlewareDispatcher', function (SimpleContainer $c) { $server = $this->getServer(); $dispatcher = new MiddlewareDispatcher(); @@ -376,7 +376,7 @@ class DIContainer extends SimpleContainer implements IAppContainer { * @param string $serviceName e.g. 'OCA\Files\Capabilities' */ public function registerCapability($serviceName) { - $this->query('OC\CapabilitiesManager')->registerCapability(function() use ($serviceName) { + $this->query('OC\CapabilitiesManager')->registerCapability(function () use ($serviceName) { return $this->query($serviceName); }); } diff --git a/lib/private/AppFramework/Middleware/MiddlewareDispatcher.php b/lib/private/AppFramework/Middleware/MiddlewareDispatcher.php index 10cb9249a51..47b9a62af81 100644 --- a/lib/private/AppFramework/Middleware/MiddlewareDispatcher.php +++ b/lib/private/AppFramework/Middleware/MiddlewareDispatcher.php @@ -55,7 +55,7 @@ class MiddlewareDispatcher { /** * Constructor */ - public function __construct(){ + public function __construct() { $this->middlewares = []; $this->middlewareCounter = 0; } @@ -65,7 +65,7 @@ class MiddlewareDispatcher { * Adds a new middleware * @param Middleware $middleWare the middleware which will be added */ - public function registerMiddleware(Middleware $middleWare){ + public function registerMiddleware(Middleware $middleWare) { $this->middlewares[] = $middleWare; } @@ -87,7 +87,7 @@ class MiddlewareDispatcher { * @param string $methodName the name of the method that will be called on * the controller */ - public function beforeController(Controller $controller, string $methodName){ + public function beforeController(Controller $controller, string $methodName) { // we need to count so that we know which middlewares we have to ask in // case there is an exception $middlewareCount = \count($this->middlewares); diff --git a/lib/private/AppFramework/Middleware/Security/CORSMiddleware.php b/lib/private/AppFramework/Middleware/Security/CORSMiddleware.php index 1883756954b..acfbab25ed4 100644 --- a/lib/private/AppFramework/Middleware/Security/CORSMiddleware.php +++ b/lib/private/AppFramework/Middleware/Security/CORSMiddleware.php @@ -80,7 +80,7 @@ class CORSMiddleware extends Middleware { * @throws SecurityException * @since 6.0.0 */ - public function beforeController($controller, $methodName){ + public function beforeController($controller, $methodName) { // ensure that @CORS annotated API routes are not used in conjunction // with session authentication since this enables CSRF attack vectors if ($this->reflector->hasAnnotation('CORS') && @@ -110,7 +110,7 @@ class CORSMiddleware extends Middleware { * @return Response a Response object * @throws SecurityException */ - public function afterController($controller, $methodName, Response $response){ + public function afterController($controller, $methodName, Response $response) { // only react if its a CORS request and if the request sends origin and if(isset($this->request->server['HTTP_ORIGIN']) && @@ -143,7 +143,7 @@ class CORSMiddleware extends Middleware { * @throws \Exception the passed in exception if it can't handle it * @return Response a Response object or null in case that the exception could not be handled */ - public function afterException($controller, $methodName, \Exception $exception){ + public function afterException($controller, $methodName, \Exception $exception) { if($exception instanceof SecurityException){ $response = new JSONResponse(['message' => $exception->getMessage()]); if($exception->getCode() !== 0) { diff --git a/lib/private/AppFramework/Middleware/SessionMiddleware.php b/lib/private/AppFramework/Middleware/SessionMiddleware.php index 1f4ba123104..d2787dde745 100644 --- a/lib/private/AppFramework/Middleware/SessionMiddleware.php +++ b/lib/private/AppFramework/Middleware/SessionMiddleware.php @@ -62,7 +62,7 @@ class SessionMiddleware extends Middleware { * @param Response $response * @return Response */ - public function afterController($controller, $methodName, Response $response){ + public function afterController($controller, $methodName, Response $response) { $useSession = $this->reflector->hasAnnotation('UseSession'); if ($useSession) { $this->session->close(); diff --git a/lib/private/AppFramework/Utility/ControllerMethodReflector.php b/lib/private/AppFramework/Utility/ControllerMethodReflector.php index ac7953e0457..31f1892772f 100644 --- a/lib/private/AppFramework/Utility/ControllerMethodReflector.php +++ b/lib/private/AppFramework/Utility/ControllerMethodReflector.php @@ -46,7 +46,7 @@ class ControllerMethodReflector implements IControllerMethodReflector { * @param object $object an object or classname * @param string $method the method which we want to inspect */ - public function reflect($object, string $method){ + public function reflect($object, string $method) { $reflection = new \ReflectionMethod($object, $method); $docs = $reflection->getDocComment(); diff --git a/lib/private/Authentication/TwoFactorAuth/Manager.php b/lib/private/Authentication/TwoFactorAuth/Manager.php index 1cde13ef27e..40e6e4082e1 100644 --- a/lib/private/Authentication/TwoFactorAuth/Manager.php +++ b/lib/private/Authentication/TwoFactorAuth/Manager.php @@ -140,7 +140,7 @@ class Manager { */ public function getLoginSetupProviders(IUser $user): array { $providers = $this->providerLoader->getProviders($user); - return array_filter($providers, function(IProvider $provider) { + return array_filter($providers, function (IProvider $provider) { return ($provider instanceof IActivatableAtLogin); }); } diff --git a/lib/private/Authentication/TwoFactorAuth/ProviderSet.php b/lib/private/Authentication/TwoFactorAuth/ProviderSet.php index a1577de7440..5b5ac60fd82 100644 --- a/lib/private/Authentication/TwoFactorAuth/ProviderSet.php +++ b/lib/private/Authentication/TwoFactorAuth/ProviderSet.php @@ -72,7 +72,7 @@ class ProviderSet { * @return IProvider[] */ public function getPrimaryProviders(): array { - return array_filter($this->providers, function(IProvider $provider) { + return array_filter($this->providers, function (IProvider $provider) { return !($provider instanceof BackupCodesProvider); }); } diff --git a/lib/private/Collaboration/Collaborators/UserPlugin.php b/lib/private/Collaboration/Collaborators/UserPlugin.php index bed3da8521d..53dd0c66c7f 100644 --- a/lib/private/Collaboration/Collaborators/UserPlugin.php +++ b/lib/private/Collaboration/Collaborators/UserPlugin.php @@ -162,7 +162,7 @@ class UserPlugin implements ISearchPlugin { if ($this->shareWithGroupOnly) { // Only add, if we have a common group - $userGroupIds = array_map(function(IGroup $group) { + $userGroupIds = array_map(function (IGroup $group) { return $group->getGID(); }, $userGroups); $commonGroups = array_intersect($userGroupIds, $this->groupManager->getUserGroupIds($user)); diff --git a/lib/private/Collaboration/Resources/Collection.php b/lib/private/Collaboration/Resources/Collection.php index 4fb0e49f16e..827f4e6dd1f 100644 --- a/lib/private/Collaboration/Resources/Collection.php +++ b/lib/private/Collaboration/Resources/Collection.php @@ -126,7 +126,7 @@ class Collection implements ICollection { * @since 16.0.0 */ public function addResource(IResource $resource): void { - array_map(function(IResource $r) use ($resource) { + array_map(function (IResource $r) use ($resource) { if ($this->isSameResource($r, $resource)) { throw new ResourceException('Already part of the collection'); } @@ -158,7 +158,7 @@ class Collection implements ICollection { * @since 16.0.0 */ public function removeResource(IResource $resource): void { - $this->resources = array_filter($this->getResources(), function(IResource $r) use ($resource) { + $this->resources = array_filter($this->getResources(), function (IResource $r) use ($resource) { return !$this->isSameResource($r, $resource); }); diff --git a/lib/private/Collaboration/Resources/Listener.php b/lib/private/Collaboration/Resources/Listener.php index a465db1fed9..608f72ebd5d 100644 --- a/lib/private/Collaboration/Resources/Listener.php +++ b/lib/private/Collaboration/Resources/Listener.php @@ -36,7 +36,7 @@ use Symfony\Component\EventDispatcher\GenericEvent; class Listener { public static function register(EventDispatcherInterface $dispatcher): void { - $listener = function(GenericEvent $event) { + $listener = function (GenericEvent $event) { /** @var IUser $user */ $user = $event->getArgument('user'); /** @var IManager $resourceManager */ @@ -47,7 +47,7 @@ class Listener { $dispatcher->addListener(IGroup::class . '::postAddUser', $listener); $dispatcher->addListener(IGroup::class . '::postRemoveUser', $listener); - $dispatcher->addListener(IUser::class . '::postDelete', function(GenericEvent $event) { + $dispatcher->addListener(IUser::class . '::postDelete', function (GenericEvent $event) { /** @var IUser $user */ $user = $event->getSubject(); /** @var IManager $resourceManager */ @@ -56,7 +56,7 @@ class Listener { $resourceManager->invalidateAccessCacheForUser($user); }); - $dispatcher->addListener(IGroup::class . '::preDelete', function(GenericEvent $event) { + $dispatcher->addListener(IGroup::class . '::preDelete', function (GenericEvent $event) { /** @var IGroup $group */ $group = $event->getSubject(); /** @var IManager $resourceManager */ diff --git a/lib/private/Command/FileAccess.php b/lib/private/Command/FileAccess.php index 1a2e52c457b..edad7882ef9 100644 --- a/lib/private/Command/FileAccess.php +++ b/lib/private/Command/FileAccess.php @@ -25,7 +25,7 @@ namespace OC\Command; use OCP\IUser; trait FileAccess { - protected function setupFS(IUser $user){ + protected function setupFS(IUser $user) { \OC_Util::setupFS($user->getUID()); } diff --git a/lib/private/Contacts/ContactsMenu/ActionProviderStore.php b/lib/private/Contacts/ContactsMenu/ActionProviderStore.php index c737e1ef289..b8ddf9258fa 100644 --- a/lib/private/Contacts/ContactsMenu/ActionProviderStore.php +++ b/lib/private/Contacts/ContactsMenu/ActionProviderStore.php @@ -94,7 +94,7 @@ class ActionProviderStore { * @return string[] */ private function getAppProviderClasses(IUser $user) { - return array_reduce($this->appManager->getEnabledAppsForUser($user), function($all, $appId) { + return array_reduce($this->appManager->getEnabledAppsForUser($user), function ($all, $appId) { $info = $this->appManager->getAppInfo($appId); if (!isset($info['contactsmenu']) || !isset($info['contactsmenu'])) { @@ -102,7 +102,7 @@ class ActionProviderStore { return $all; } - $providers = array_reduce($info['contactsmenu'], function($all, $provider) { + $providers = array_reduce($info['contactsmenu'], function ($all, $provider) { return array_merge($all, [$provider]); }, []); diff --git a/lib/private/Contacts/ContactsMenu/ContactsStore.php b/lib/private/Contacts/ContactsMenu/ContactsStore.php index 8199db952af..dfa6db61607 100644 --- a/lib/private/Contacts/ContactsMenu/ContactsStore.php +++ b/lib/private/Contacts/ContactsMenu/ContactsStore.php @@ -78,7 +78,7 @@ class ContactsStore implements IContactsStore { 'EMAIL' ]); - $entries = array_map(function(array $contact) { + $entries = array_map(function (array $contact) { return $this->contactArrayToEntry($contact); }, $allContacts); return $this->filterContacts( @@ -131,7 +131,7 @@ class ContactsStore implements IContactsStore { $selfUID = $self->getUID(); - return array_values(array_filter($entries, function(IEntry $entry) use ($self, $skipLocal, $ownGroupsOnly, $selfGroups, $selfUID, $disallowEnumeration, $filter) { + return array_values(array_filter($entries, function (IEntry $entry) use ($self, $skipLocal, $ownGroupsOnly, $selfGroups, $selfUID, $disallowEnumeration, $filter) { if ($skipLocal && $entry->getProperty('isLocalSystemBook') === true) { return false; } @@ -196,7 +196,7 @@ class ContactsStore implements IContactsStore { $userId = $user->getUID(); $allContacts = $this->contactsManager->search($shareWith, $filter); - $contacts = array_filter($allContacts, function($contact) use ($userId) { + $contacts = array_filter($allContacts, function ($contact) use ($userId) { return $contact['UID'] !== $userId; }); $match = null; diff --git a/lib/private/Contacts/ContactsMenu/Entry.php b/lib/private/Contacts/ContactsMenu/Entry.php index 73ac22ad69c..c4b590e9397 100644 --- a/lib/private/Contacts/ContactsMenu/Entry.php +++ b/lib/private/Contacts/ContactsMenu/Entry.php @@ -114,7 +114,7 @@ class Entry implements IEntry { * sort the actions by priority and name */ private function sortActions() { - usort($this->actions, function(IAction $action1, IAction $action2) { + usort($this->actions, function (IAction $action1, IAction $action2) { $prio1 = $action1->getPriority(); $prio2 = $action2->getPriority(); @@ -151,7 +151,7 @@ class Entry implements IEntry { */ public function jsonSerialize() { $topAction = !empty($this->actions) ? $this->actions[0]->jsonSerialize() : null; - $otherActions = array_map(function(IAction $action) { + $otherActions = array_map(function (IAction $action) { return $action->jsonSerialize(); }, array_slice($this->actions, 1)); diff --git a/lib/private/Contacts/ContactsMenu/Manager.php b/lib/private/Contacts/ContactsMenu/Manager.php index 0ebc9648285..ba761c5ece8 100644 --- a/lib/private/Contacts/ContactsMenu/Manager.php +++ b/lib/private/Contacts/ContactsMenu/Manager.php @@ -100,7 +100,7 @@ class Manager { * @return IEntry[] */ private function sortEntries(array $entries) { - usort($entries, function(IEntry $entryA, IEntry $entryB) { + usort($entries, function (IEntry $entryA, IEntry $entryB) { return strcasecmp($entryA->getFullName(), $entryB->getFullName()); }); return $entries; diff --git a/lib/private/DB/Connection.php b/lib/private/DB/Connection.php index ed00bcd0e04..bfca8d4ec7b 100644 --- a/lib/private/DB/Connection.php +++ b/lib/private/DB/Connection.php @@ -160,7 +160,7 @@ class Connection extends ReconnectWrapper implements IDBConnection { * @param int $offset * @return \Doctrine\DBAL\Driver\Statement The prepared statement. */ - public function prepare( $statement, $limit=null, $offset=null ) { + public function prepare($statement, $limit=null, $offset=null) { if ($limit === -1) { $limit = null; } @@ -289,7 +289,7 @@ class Connection extends ReconnectWrapper implements IDBConnection { $insertQb = $this->getQueryBuilder(); $insertQb->insert($table) ->values( - array_map(function($value) use ($insertQb) { + array_map(function ($value) use ($insertQb) { return $insertQb->createNamedParameter($value, $this->getType($value)); }, array_merge($keys, $values)) ); @@ -383,7 +383,7 @@ class Connection extends ReconnectWrapper implements IDBConnection { * @param string $table table name without the prefix * @return bool */ - public function tableExists($table){ + public function tableExists($table) { $table = $this->tablePrefix . trim($table); $schema = $this->getSchemaManager(); return $schema->tablesExist([$table]); diff --git a/lib/private/DB/MigrationService.php b/lib/private/DB/MigrationService.php index 9f5b5bfe72b..dd719ef0a5b 100644 --- a/lib/private/DB/MigrationService.php +++ b/lib/private/DB/MigrationService.php @@ -468,12 +468,12 @@ class MigrationService { $instance = $this->createInstance($version); if (!$schemaOnly) { - $instance->preSchemaChange($this->output, function() { + $instance->preSchemaChange($this->output, function () { return new SchemaWrapper($this->connection); }, ['tablePrefix' => $this->connection->getPrefix()]); } - $toSchema = $instance->changeSchema($this->output, function() { + $toSchema = $instance->changeSchema($this->output, function () { return new SchemaWrapper($this->connection); }, ['tablePrefix' => $this->connection->getPrefix()]); @@ -488,7 +488,7 @@ class MigrationService { } if (!$schemaOnly) { - $instance->postSchemaChange($this->output, function() { + $instance->postSchemaChange($this->output, function () { return new SchemaWrapper($this->connection); }, ['tablePrefix' => $this->connection->getPrefix()]); } @@ -538,7 +538,7 @@ class MigrationService { if ($isUsingDefaultName) { $sequenceName = $table->getName() . '_' . implode('_', $primaryKey->getColumns()) . '_seq'; - $sequences = array_filter($sequences, function(Sequence $sequence) use ($sequenceName) { + $sequences = array_filter($sequences, function (Sequence $sequence) use ($sequenceName) { return $sequence->getName() !== $sequenceName; }); } diff --git a/lib/private/DB/OracleConnection.php b/lib/private/DB/OracleConnection.php index cc1bf66d874..93a52d1772d 100644 --- a/lib/private/DB/OracleConnection.php +++ b/lib/private/DB/OracleConnection.php @@ -98,7 +98,7 @@ class OracleConnection extends Connection { * @param string $table table name without the prefix * @return bool */ - public function tableExists($table){ + public function tableExists($table) { $table = $this->tablePrefix . trim($table); $table = $this->quoteIdentifier($table); $schema = $this->getSchemaManager(); diff --git a/lib/private/DB/OracleMigrator.php b/lib/private/DB/OracleMigrator.php index 7695532a4b7..86d1f71c2b7 100644 --- a/lib/private/DB/OracleMigrator.php +++ b/lib/private/DB/OracleMigrator.php @@ -77,7 +77,7 @@ class OracleMigrator extends Migrator { return new Index( //TODO migrate existing uppercase indexes, then $this->connection->quoteIdentifier($index->getName()), $index->getName(), - array_map(function($columnName) { + array_map(function ($columnName) { return $this->connection->quoteIdentifier($columnName); }, $index->getColumns()), $index->isUnique(), @@ -96,11 +96,11 @@ class OracleMigrator extends Migrator { */ protected function quoteForeignKeyConstraint($fkc) { return new ForeignKeyConstraint( - array_map(function($columnName) { + array_map(function ($columnName) { return $this->connection->quoteIdentifier($columnName); }, $fkc->getLocalColumns()), $this->connection->quoteIdentifier($fkc->getForeignTableName()), - array_map(function($columnName) { + array_map(function ($columnName) { return $this->connection->quoteIdentifier($columnName); }, $fkc->getForeignColumns()), $fkc->getName(), @@ -118,16 +118,16 @@ class OracleMigrator extends Migrator { $schemaDiff = parent::getDiff($targetSchema, $connection); // oracle forces us to quote the identifiers - $schemaDiff->newTables = array_map(function(Table $table) { + $schemaDiff->newTables = array_map(function (Table $table) { return new Table( $this->connection->quoteIdentifier($table->getName()), - array_map(function(Column $column) { + array_map(function (Column $column) { return $this->quoteColumn($column); }, $table->getColumns()), - array_map(function(Index $index) { + array_map(function (Index $index) { return $this->quoteIndex($index); }, $table->getIndexes()), - array_map(function(ForeignKeyConstraint $fck) { + array_map(function (ForeignKeyConstraint $fck) { return $this->quoteForeignKeyConstraint($fck); }, $table->getForeignKeys()), 0, @@ -135,7 +135,7 @@ class OracleMigrator extends Migrator { ); }, $schemaDiff->newTables); - $schemaDiff->removedTables = array_map(function(Table $table) { + $schemaDiff->removedTables = array_map(function (Table $table) { return new Table( $this->connection->quoteIdentifier($table->getName()), $table->getColumns(), @@ -149,7 +149,7 @@ class OracleMigrator extends Migrator { foreach ($schemaDiff->changedTables as $tableDiff) { $tableDiff->name = $this->connection->quoteIdentifier($tableDiff->name); - $tableDiff->addedColumns = array_map(function(Column $column) { + $tableDiff->addedColumns = array_map(function (Column $column) { return $this->quoteColumn($column); }, $tableDiff->addedColumns); @@ -163,39 +163,39 @@ class OracleMigrator extends Migrator { return count($column->changedProperties) > 0; }); - $tableDiff->removedColumns = array_map(function(Column $column) { + $tableDiff->removedColumns = array_map(function (Column $column) { return $this->quoteColumn($column); }, $tableDiff->removedColumns); - $tableDiff->renamedColumns = array_map(function(Column $column) { + $tableDiff->renamedColumns = array_map(function (Column $column) { return $this->quoteColumn($column); }, $tableDiff->renamedColumns); - $tableDiff->addedIndexes = array_map(function(Index $index) { + $tableDiff->addedIndexes = array_map(function (Index $index) { return $this->quoteIndex($index); }, $tableDiff->addedIndexes); - $tableDiff->changedIndexes = array_map(function(Index $index) { + $tableDiff->changedIndexes = array_map(function (Index $index) { return $this->quoteIndex($index); }, $tableDiff->changedIndexes); - $tableDiff->removedIndexes = array_map(function(Index $index) { + $tableDiff->removedIndexes = array_map(function (Index $index) { return $this->quoteIndex($index); }, $tableDiff->removedIndexes); - $tableDiff->renamedIndexes = array_map(function(Index $index) { + $tableDiff->renamedIndexes = array_map(function (Index $index) { return $this->quoteIndex($index); }, $tableDiff->renamedIndexes); - $tableDiff->addedForeignKeys = array_map(function(ForeignKeyConstraint $fkc) { + $tableDiff->addedForeignKeys = array_map(function (ForeignKeyConstraint $fkc) { return $this->quoteForeignKeyConstraint($fkc); }, $tableDiff->addedForeignKeys); - $tableDiff->changedForeignKeys = array_map(function(ForeignKeyConstraint $fkc) { + $tableDiff->changedForeignKeys = array_map(function (ForeignKeyConstraint $fkc) { return $this->quoteForeignKeyConstraint($fkc); }, $tableDiff->changedForeignKeys); - $tableDiff->removedForeignKeys = array_map(function(ForeignKeyConstraint $fkc) { + $tableDiff->removedForeignKeys = array_map(function (ForeignKeyConstraint $fkc) { return $this->quoteForeignKeyConstraint($fkc); }, $tableDiff->removedForeignKeys); } diff --git a/lib/private/DB/SchemaWrapper.php b/lib/private/DB/SchemaWrapper.php index f7f204a564c..eb24cc6f7aa 100644 --- a/lib/private/DB/SchemaWrapper.php +++ b/lib/private/DB/SchemaWrapper.php @@ -64,7 +64,7 @@ class SchemaWrapper implements ISchemaWrapper { */ public function getTableNamesWithoutPrefix() { $tableNames = $this->schema->getTableNames(); - return array_map(function($tableName) { + return array_map(function ($tableName) { if (strpos($tableName, $this->connection->getPrefix()) === 0) { return substr($tableName, strlen($this->connection->getPrefix())); } diff --git a/lib/private/Encryption/Util.php b/lib/private/Encryption/Util.php index 9cc78e7ba77..9010f81dc40 100644 --- a/lib/private/Encryption/Util.php +++ b/lib/private/Encryption/Util.php @@ -275,7 +275,7 @@ class Util { $result = []; if (in_array('all', $users)) { $users = $this->userManager->search('', null, null); - $result = array_map(function(IUser $user) { + $result = array_map(function (IUser $user) { return $user->getUID(); }, $users); } else { diff --git a/lib/private/Files/Cache/Cache.php b/lib/private/Files/Cache/Cache.php index 11f7eedea26..a6daec2a8f3 100644 --- a/lib/private/Files/Cache/Cache.php +++ b/lib/private/Files/Cache/Cache.php @@ -554,7 +554,7 @@ class Cache implements ICache { */ private function removeChildren(ICacheEntry $entry) { $children = $this->getFolderContentsById($entry->getId()); - $childIds = array_map(function(ICacheEntry $cacheEntry) { + $childIds = array_map(function (ICacheEntry $cacheEntry) { return $cacheEntry->getId(); }, $children); $childFolders = array_filter($children, function ($child) { diff --git a/lib/private/Files/ObjectStore/HomeObjectStoreStorage.php b/lib/private/Files/ObjectStore/HomeObjectStoreStorage.php index f7d565d5cd1..0632caedc6e 100644 --- a/lib/private/Files/ObjectStore/HomeObjectStoreStorage.php +++ b/lib/private/Files/ObjectStore/HomeObjectStoreStorage.php @@ -41,7 +41,7 @@ class HomeObjectStoreStorage extends ObjectStoreStorage implements \OCP\Files\IH parent::__construct($params); } - public function getId () { + public function getId() { return 'object::user:' . $this->user->getUID(); } diff --git a/lib/private/Files/SimpleFS/SimpleFolder.php b/lib/private/Files/SimpleFS/SimpleFolder.php index 169a8d96fd3..7196b55ea12 100644 --- a/lib/private/Files/SimpleFS/SimpleFolder.php +++ b/lib/private/Files/SimpleFS/SimpleFolder.php @@ -51,7 +51,7 @@ class SimpleFolder implements ISimpleFolder { public function getDirectoryListing() { $listing = $this->folder->getDirectoryListing(); - $fileListing = array_map(function(Node $file) { + $fileListing = array_map(function (Node $file) { if ($file instanceof File) { return new SimpleFile($file); } diff --git a/lib/private/Files/Storage/CommonTest.php b/lib/private/Files/Storage/CommonTest.php index 4ed9364a4b3..164738d9478 100644 --- a/lib/private/Files/Storage/CommonTest.php +++ b/lib/private/Files/Storage/CommonTest.php @@ -43,7 +43,7 @@ class CommonTest extends \OC\Files\Storage\Common{ $this->storage=new \OC\Files\Storage\Local($params); } - public function getId(){ + public function getId() { return 'test::'.$this->storage->getId(); } public function mkdir($path) { diff --git a/lib/private/Files/View.php b/lib/private/Files/View.php index e3f704a7cbc..567af4d23ab 100644 --- a/lib/private/Files/View.php +++ b/lib/private/Files/View.php @@ -1454,7 +1454,7 @@ class View { $sharingDisabled = \OCP\Util::isSharingDisabledForUser(); - $fileNames = array_map(function(ICacheEntry $content) { + $fileNames = array_map(function (ICacheEntry $content) { return $content->getName(); }, $contents); /** @@ -1735,7 +1735,7 @@ class View { // put non shared mounts in front of the shared mount // this prevent unneeded recursion into shares - usort($mounts, function(IMountPoint $a, IMountPoint $b) { + usort($mounts, function (IMountPoint $a, IMountPoint $b) { return $a instanceof SharedMount && (!$b instanceof SharedMount) ? 1 : -1; }); diff --git a/lib/private/Group/Database.php b/lib/private/Group/Database.php index 48b01461531..ba023d64acb 100644 --- a/lib/private/Group/Database.php +++ b/lib/private/Group/Database.php @@ -165,7 +165,7 @@ class Database extends ABackend * * Checks whether the user is member of a group or not. */ - public function inGroup( $uid, $gid ) { + public function inGroup($uid, $gid) { $this->fixDI(); // check @@ -234,7 +234,7 @@ class Database extends ABackend * This function fetches all groups a user belongs to. It does not check * if the user exists at all. */ - public function getUserGroups( $uid ) { + public function getUserGroups($uid) { //guests has empty or null $uid if ($uid === null || $uid === '') { return []; diff --git a/lib/private/Group/Group.php b/lib/private/Group/Group.php index 90b4221b414..38f360b6ce5 100644 --- a/lib/private/Group/Group.php +++ b/lib/private/Group/Group.php @@ -398,7 +398,7 @@ class Group implements IGroup { * @since 16.0.0 */ public function hideFromCollaboration(): bool { - return array_reduce($this->backends, function(bool $hide, GroupInterface $backend) { + return array_reduce($this->backends, function (bool $hide, GroupInterface $backend) { return $hide | ($backend instanceof IHideFromCollaborationBackend && $backend->hideGroup($this->gid)); }, false); } diff --git a/lib/private/L10N/Factory.php b/lib/private/L10N/Factory.php index 91420b8d766..2902136e62e 100644 --- a/lib/private/L10N/Factory.php +++ b/lib/private/L10N/Factory.php @@ -114,7 +114,7 @@ class Factory implements IFactory { * @return \OCP\IL10N */ public function get($app, $lang = null, $locale = null) { - return new LazyL10N(function() use ($app, $lang, $locale) { + return new LazyL10N(function () use ($app, $lang, $locale) { $app = \OC_App::cleanAppId($app); if ($lang !== null) { @@ -369,7 +369,7 @@ class Factory implements IFactory { } $locales = $this->findAvailableLocales(); - $userLocale = array_filter($locales, function($value) use ($locale) { + $userLocale = array_filter($locales, function ($value) use ($locale) { return $locale === $value['code']; }); diff --git a/lib/private/L10N/L10N.php b/lib/private/L10N/L10N.php index 519ff45292b..ee339ba8840 100644 --- a/lib/private/L10N/L10N.php +++ b/lib/private/L10N/L10N.php @@ -221,7 +221,7 @@ class L10N implements IL10N { public function getPluralFormFunction(): \Closure { if (\is_null($this->pluralFormFunction)) { $lang = $this->getLanguageCode(); - $this->pluralFormFunction = function($n) use ($lang) { + $this->pluralFormFunction = function ($n) use ($lang) { return PluralizationRules::get($n, $lang); }; } diff --git a/lib/private/NavigationManager.php b/lib/private/NavigationManager.php index 310201e812d..8d72040af9a 100644 --- a/lib/private/NavigationManager.php +++ b/lib/private/NavigationManager.php @@ -120,7 +120,7 @@ class NavigationManager implements INavigationManager { $result = $this->entries; if ($type !== 'all') { - $result = array_filter($this->entries, function($entry) use ($type) { + $result = array_filter($this->entries, function ($entry) use ($type) { return $entry['type'] === $type; }); } @@ -135,7 +135,7 @@ class NavigationManager implements INavigationManager { * @return array */ private function proceedNavigation(array $list): array { - uasort($list, function($a, $b) { + uasort($list, function ($a, $b) { if (isset($a['order']) && isset($b['order'])) { return ($a['order'] < $b['order']) ? -1 : 1; } else if (isset($a['order']) || isset($b['order'])) { diff --git a/lib/private/Route/Route.php b/lib/private/Route/Route.php index 60b14efc7d6..705183d24ae 100644 --- a/lib/private/Route/Route.php +++ b/lib/private/Route/Route.php @@ -149,7 +149,7 @@ class Route extends SymfonyRoute implements IRoute { * @return void */ public function actionInclude($file) { - $function = function($param) use ($file) { + $function = function ($param) use ($file) { unset($param["_route"]); $_GET=array_merge($_GET, $param); unset($param); diff --git a/lib/private/Search/Result/File.php b/lib/private/Search/Result/File.php index 1321c1cfc59..0b7e11f2fcb 100644 --- a/lib/private/Search/Result/File.php +++ b/lib/private/Search/Result/File.php @@ -106,7 +106,7 @@ class File extends \OCP\Search\Result { * @param string $path * @return string relative path */ - protected function getRelativePath ($path) { + protected function getRelativePath($path) { if (!isset(self::$userFolderCache)) { $user = \OC::$server->getUserSession()->getUser()->getUID(); self::$userFolderCache = \OC::$server->getUserFolder($user); diff --git a/lib/private/Security/Bruteforce/Throttler.php b/lib/private/Security/Bruteforce/Throttler.php index b5a4dfbfaff..8e58e9bde9a 100644 --- a/lib/private/Security/Bruteforce/Throttler.php +++ b/lib/private/Security/Bruteforce/Throttler.php @@ -144,7 +144,7 @@ class Throttler { } $keys = $this->config->getAppKeys('bruteForce'); - $keys = array_filter($keys, function($key) { + $keys = array_filter($keys, function ($key) { $regex = '/^whitelist_/S'; return preg_match($regex, $key) === 1; }); diff --git a/lib/private/Security/TrustedDomainHelper.php b/lib/private/Security/TrustedDomainHelper.php index a558f24111b..c1789da6ad7 100644 --- a/lib/private/Security/TrustedDomainHelper.php +++ b/lib/private/Security/TrustedDomainHelper.php @@ -98,7 +98,7 @@ class TrustedDomainHelper { if (gettype($trusted) !== 'string') { break; } - $regex = '/^' . implode('[-\.a-zA-Z0-9]*', array_map(function($v) { return preg_quote($v, '/'); }, explode('*', $trusted))) . '$/i'; + $regex = '/^' . implode('[-\.a-zA-Z0-9]*', array_map(function ($v) { return preg_quote($v, '/'); }, explode('*', $trusted))) . '$/i'; if (preg_match($regex, $domain) || preg_match($regex, $domainWithPort)) { return true; } diff --git a/lib/private/Server.php b/lib/private/Server.php index 4e62e2d2916..026dcdf9a85 100644 --- a/lib/private/Server.php +++ b/lib/private/Server.php @@ -700,7 +700,7 @@ class Server extends ServerContainer implements IServerContainer { }); $this->registerAlias(IValidator::class, Validator::class); - $this->registerService(AvatarManager::class, function(Server $c) { + $this->registerService(AvatarManager::class, function (Server $c) { return new AvatarManager( $c->query(\OC\User\Manager::class), $c->getAppDataDir('avatar'), @@ -1085,7 +1085,7 @@ class Server extends ServerContainer implements IServerContainer { $factory = new $factoryClass($this); $manager = $factory->getManager(); - $manager->registerDisplayNameResolver('user', function($id) use ($c) { + $manager->registerDisplayNameResolver('user', function ($id) use ($c) { $manager = $c->getUserManager(); $user = $manager->get($id); if(is_null($user)) { @@ -1231,7 +1231,7 @@ class Server extends ServerContainer implements IServerContainer { }); $this->registerDeprecatedAlias('ShareManager', \OCP\Share\IManager::class); - $this->registerService(\OCP\Collaboration\Collaborators\ISearch::class, function(Server $c) { + $this->registerService(\OCP\Collaboration\Collaborators\ISearch::class, function (Server $c) { $instance = new Collaboration\Collaborators\Search($c); // register default plugins @@ -1316,7 +1316,7 @@ class Server extends ServerContainer implements IServerContainer { ); }); - $this->registerService(Installer::class, function(Server $c) { + $this->registerService(Installer::class, function (Server $c) { return new Installer( $c->getAppFetcher(), $c->getHTTPClientService(), @@ -1327,16 +1327,16 @@ class Server extends ServerContainer implements IServerContainer { ); }); - $this->registerService(IApiFactory::class, function(Server $c) { + $this->registerService(IApiFactory::class, function (Server $c) { return new ApiFactory($c->getHTTPClientService()); }); - $this->registerService(IInstanceFactory::class, function(Server $c) { + $this->registerService(IInstanceFactory::class, function (Server $c) { $memcacheFactory = $c->getMemCacheFactory(); return new InstanceFactory($memcacheFactory->createLocal('remoteinstance.'), $c->getHTTPClientService()); }); - $this->registerService(IContactsStore::class, function(Server $c) { + $this->registerService(IContactsStore::class, function (Server $c) { return new ContactsStore( $c->getContactsManager(), $c->getConfig(), @@ -1347,7 +1347,7 @@ class Server extends ServerContainer implements IServerContainer { $this->registerAlias(IContactsStore::class, ContactsStore::class); $this->registerAlias(IAccountManager::class, AccountManager::class); - $this->registerService(IStorageFactory::class, function() { + $this->registerService(IStorageFactory::class, function () { return new StorageFactory(); }); @@ -1386,7 +1386,7 @@ class Server extends ServerContainer implements IServerContainer { $dispatcher = $this->getEventDispatcher(); // Delete avatar on user deletion - $dispatcher->addListener('OCP\IUser::preDelete', function(GenericEvent $e) { + $dispatcher->addListener('OCP\IUser::preDelete', function (GenericEvent $e) { $logger = $this->getLogger(); $manager = $this->getAvatarManager(); /** @var IUser $user */ @@ -2141,7 +2141,7 @@ class Server extends ServerContainer implements IServerContainer { /** * @return \OCP\Collaboration\AutoComplete\IManager */ - public function getAutoCompleteManager(){ + public function getAutoCompleteManager() { return $this->query(IManager::class); } diff --git a/lib/private/Settings/Manager.php b/lib/private/Settings/Manager.php index 81b29020287..ac4f8f9342c 100644 --- a/lib/private/Settings/Manager.php +++ b/lib/private/Settings/Manager.php @@ -230,7 +230,7 @@ class Manager implements IManager { */ public function getAdminSettings($section, bool $subAdminOnly = false): array { if ($subAdminOnly) { - $subAdminSettingsFilter = function(ISettings $settings) { + $subAdminSettingsFilter = function (ISettings $settings) { return $settings instanceof ISubAdminSettings; }; $appSettings = $this->getSettings('admin', $section, $subAdminSettingsFilter); diff --git a/lib/private/Share/Share.php b/lib/private/Share/Share.php index bd53c0307a6..5fcb38de008 100644 --- a/lib/private/Share/Share.php +++ b/lib/private/Share/Share.php @@ -975,7 +975,7 @@ class Share extends Constants { // filter out invalid items, these can appear when subshare entries exist // for a group in which the requested user isn't a member any more - $items = array_filter($items, function($item) { + $items = array_filter($items, function ($item) { return $item['share_type'] !== self::$shareTypeGroupUserUnique; }); diff --git a/lib/private/Share20/DefaultShareProvider.php b/lib/private/Share20/DefaultShareProvider.php index 2eda7295c1e..1c0ec194528 100644 --- a/lib/private/Share20/DefaultShareProvider.php +++ b/lib/private/Share20/DefaultShareProvider.php @@ -933,8 +933,8 @@ class DefaultShareProvider implements IShareProvider { } - $groups = array_filter($groups, function($group) { return $group instanceof IGroup; }); - $groups = array_map(function(IGroup $group) { return $group->getGID(); }, $groups); + $groups = array_filter($groups, function ($group) { return $group instanceof IGroup; }); + $groups = array_map(function (IGroup $group) { return $group->getGID(); }, $groups); $qb->andWhere($qb->expr()->eq('share_type', $qb->createNamedParameter(\OCP\Share::SHARE_TYPE_GROUP))) ->andWhere($qb->expr()->in('share_with', $qb->createNamedParameter( diff --git a/lib/private/Share20/LegacyHooks.php b/lib/private/Share20/LegacyHooks.php index 5cfc1cc27e3..f292499584e 100644 --- a/lib/private/Share20/LegacyHooks.php +++ b/lib/private/Share20/LegacyHooks.php @@ -75,7 +75,7 @@ class LegacyHooks { /** @var IShare[] $deletedShares */ $deletedShares = $e->getArgument('deletedShares'); - $formattedDeletedShares = array_map(function($share) { + $formattedDeletedShares = array_map(function ($share) { return $this->formatHookParams($share); }, $deletedShares); diff --git a/lib/private/Share20/Manager.php b/lib/private/Share20/Manager.php index 2a25ed92d12..c56db22c883 100644 --- a/lib/private/Share20/Manager.php +++ b/lib/private/Share20/Manager.php @@ -1200,7 +1200,7 @@ class Manager implements IManager { public function getSharesInFolder($userId, Folder $node, $reshares = false) { $providers = $this->factory->getAllProviders(); - return array_reduce($providers, function($shares, IShareProvider $provider) use ($userId, $node, $reshares) { + return array_reduce($providers, function ($shares, IShareProvider $provider) use ($userId, $node, $reshares) { $newShares = $provider->getSharesInFolder($userId, $node, $reshares); foreach ($newShares as $fid => $data) { if (!isset($shares[$fid])) { @@ -1318,7 +1318,7 @@ class Manager implements IManager { $shares = $this->getSharedWith($userId, $shareType, $node, $limit, $offset); // Only get deleted shares - $shares = array_filter($shares, function(IShare $share) { + $shares = array_filter($shares, function (IShare $share) { return $share->getPermissions() === 0; }); diff --git a/lib/private/Streamer.php b/lib/private/Streamer.php index 939bb4ea5d8..47348447e6d 100644 --- a/lib/private/Streamer.php +++ b/lib/private/Streamer.php @@ -52,7 +52,7 @@ class Streamer { * @param int $numberOfFiles The number of files (and directories) that will * be included in the streamed file */ - public function __construct(IRequest $request, int $size, int $numberOfFiles){ + public function __construct(IRequest $request, int $size, int $numberOfFiles) { /** * zip32 constraints for a basic (without compression, volumes nor @@ -89,7 +89,7 @@ class Streamer { * Send HTTP headers * @param string $name */ - public function sendHeaders($name){ + public function sendHeaders($name) { $extension = $this->streamerInstance instanceof ZipStreamer ? '.zip' : '.tar'; $fullName = $name . $extension; $this->streamerInstance->sendHeaders($fullName); @@ -169,7 +169,7 @@ class Streamer { * @param string $dirName Directory Path and name to be added to the archive. * @return bool $success */ - public function addEmptyDir($dirName){ + public function addEmptyDir($dirName) { return $this->streamerInstance->addEmptyDir($dirName); } @@ -179,7 +179,7 @@ class Streamer { * closing, the file is completely written to the output stream. * @return bool $success */ - public function finalize(){ + public function finalize() { return $this->streamerInstance->finalize(); } } diff --git a/lib/private/SubAdmin.php b/lib/private/SubAdmin.php index 05d23bee587..8a8cbdb9813 100644 --- a/lib/private/SubAdmin.php +++ b/lib/private/SubAdmin.php @@ -60,10 +60,10 @@ class SubAdmin extends PublicEmitter implements ISubAdmin { $this->groupManager = $groupManager; $this->dbConn = $dbConn; - $this->userManager->listen('\OC\User', 'postDelete', function($user) { + $this->userManager->listen('\OC\User', 'postDelete', function ($user) { $this->post_deleteUser($user); }); - $this->groupManager->listen('\OC\Group', 'postDelete', function($group) { + $this->groupManager->listen('\OC\Group', 'postDelete', function ($group) { $this->post_deleteGroup($group); }); } @@ -135,7 +135,7 @@ class SubAdmin extends PublicEmitter implements ISubAdmin { * @return array ['displayName' => displayname] */ public function getSubAdminsGroupsName(IUser $user): array { - return array_map(function($group) { + return array_map(function ($group) { return ['displayName' => $group->getDisplayName()]; }, $this->getSubAdminsGroups($user)); } diff --git a/lib/private/SystemTag/SystemTagObjectMapper.php b/lib/private/SystemTag/SystemTagObjectMapper.php index 97138d267d2..179e16f8e17 100644 --- a/lib/private/SystemTag/SystemTagObjectMapper.php +++ b/lib/private/SystemTag/SystemTagObjectMapper.php @@ -259,7 +259,7 @@ class SystemTagObjectMapper implements ISystemTagObjectMapper { if (\count($tags) !== \count($tagIds)) { // at least one tag missing, bail out $foundTagIds = array_map( - function(ISystemTag $tag) { + function (ISystemTag $tag) { return $tag->getId(); }, $tags diff --git a/lib/private/Tagging/Tag.php b/lib/private/Tagging/Tag.php index e82860c1d3d..f818a115b25 100644 --- a/lib/private/Tagging/Tag.php +++ b/lib/private/Tagging/Tag.php @@ -63,7 +63,7 @@ class Tag extends Entity { * @todo migrate existing database columns to the correct names * to be able to drop this direct mapping */ - public function columnToProperty($columnName){ + public function columnToProperty($columnName) { if ($columnName === 'category') { return 'name'; } elseif ($columnName === 'uid') { @@ -79,7 +79,7 @@ class Tag extends Entity { * @param string $property the name of the property * @return string the column name */ - public function propertyToColumn($property){ + public function propertyToColumn($property) { if ($property === 'name') { return 'category'; } elseif ($property === 'owner') { diff --git a/lib/private/Tags.php b/lib/private/Tags.php index 15b225b2ff8..20a80672a52 100644 --- a/lib/private/Tags.php +++ b/lib/private/Tags.php @@ -181,7 +181,7 @@ class Tags implements ITags { return []; } - usort($this->tags, function($a, $b) { + usort($this->tags, function ($a, $b) { return strnatcasecmp($a->getName(), $b->getName()); }); $tagMap = []; @@ -204,7 +204,7 @@ class Tags implements ITags { */ public function getTagsForUser($user) { return array_filter($this->tags, - function($tag) use($user) { + function ($tag) use ($user) { return $tag->getOwner() === $user; } ); @@ -802,7 +802,7 @@ class Tags implements ITags { return false; } return array_search(strtolower($needle), array_map( - function($tag) use($mem) { + function ($tag) use ($mem) { return strtolower(call_user_func([$tag, $mem])); }, $haystack) ); diff --git a/lib/private/Template/Base.php b/lib/private/Template/Base.php index 9ac74ffc60c..ddbe58b6d9d 100644 --- a/lib/private/Template/Base.php +++ b/lib/private/Template/Base.php @@ -48,7 +48,7 @@ class Base { * @param \OCP\IL10N $l10n * @param Defaults $theme */ - public function __construct($template, $requestToken, $l10n, $theme ) { + public function __construct($template, $requestToken, $l10n, $theme) { $this->vars = []; $this->vars['requesttoken'] = $requestToken; $this->l10n = $l10n; @@ -100,7 +100,7 @@ class Base { * * If the key existed before, it will be overwritten */ - public function assign( $key, $value) { + public function assign($key, $value) { $this->vars[$key] = $value; return true; } @@ -114,7 +114,7 @@ class Base { * exists, the value will be appended. It can be accessed via * $_[$key][$position] in the template. */ - public function append( $key, $value ) { + public function append($key, $value) { if( array_key_exists( $key, $this->vars )) { $this->vars[$key][] = $value; } diff --git a/lib/private/Template/TemplateFileLocator.php b/lib/private/Template/TemplateFileLocator.php index f1f5fefc6f5..afeddd6b544 100644 --- a/lib/private/Template/TemplateFileLocator.php +++ b/lib/private/Template/TemplateFileLocator.php @@ -32,7 +32,7 @@ class TemplateFileLocator { /** * @param string[] $dirs */ - public function __construct( $dirs ) { + public function __construct($dirs) { $this->dirs = $dirs; } @@ -41,7 +41,7 @@ class TemplateFileLocator { * @return string * @throws \Exception */ - public function find( $template ) { + public function find($template) { if ($template === '') { throw new \InvalidArgumentException('Empty template name'); } diff --git a/lib/private/TemplateLayout.php b/lib/private/TemplateLayout.php index 7c4d72e30ab..3ed0b86a269 100644 --- a/lib/private/TemplateLayout.php +++ b/lib/private/TemplateLayout.php @@ -64,7 +64,7 @@ class TemplateLayout extends \OC_Template { * @param string $renderAs * @param string $appId application id */ - public function __construct( $renderAs, $appId = '' ) { + public function __construct($renderAs, $appId = '') { // yes - should be injected .... $this->config = \OC::$server->getConfig(); diff --git a/lib/private/Updater.php b/lib/private/Updater.php index 91a0943e048..e94f36554d7 100644 --- a/lib/private/Updater.php +++ b/lib/private/Updater.php @@ -495,20 +495,20 @@ class Updater extends BasicEmitter { $log = $this->log; $dispatcher = \OC::$server->getEventDispatcher(); - $dispatcher->addListener('\OC\DB\Migrator::executeSql', function($event) use ($log) { + $dispatcher->addListener('\OC\DB\Migrator::executeSql', function ($event) use ($log) { if (!$event instanceof GenericEvent) { return; } $log->info('\OC\DB\Migrator::executeSql: ' . $event->getSubject() . ' (' . $event->getArgument(0) . ' of ' . $event->getArgument(1) . ')', ['app' => 'updater']); }); - $dispatcher->addListener('\OC\DB\Migrator::checkTable', function($event) use ($log) { + $dispatcher->addListener('\OC\DB\Migrator::checkTable', function ($event) use ($log) { if (!$event instanceof GenericEvent) { return; } $log->info('\OC\DB\Migrator::checkTable: ' . $event->getSubject() . ' (' . $event->getArgument(0) . ' of ' . $event->getArgument(1) . ')', ['app' => 'updater']); }); - $repairListener = function($event) use ($log) { + $repairListener = function ($event) use ($log) { if (!$event instanceof GenericEvent) { return; } @@ -551,44 +551,44 @@ class Updater extends BasicEmitter { $dispatcher->addListener('\OC\Repair::error', $repairListener); - $this->listen('\OC\Updater', 'maintenanceEnabled', function () use($log) { + $this->listen('\OC\Updater', 'maintenanceEnabled', function () use ($log) { $log->info('\OC\Updater::maintenanceEnabled: Turned on maintenance mode', ['app' => 'updater']); }); - $this->listen('\OC\Updater', 'maintenanceDisabled', function () use($log) { + $this->listen('\OC\Updater', 'maintenanceDisabled', function () use ($log) { $log->info('\OC\Updater::maintenanceDisabled: Turned off maintenance mode', ['app' => 'updater']); }); - $this->listen('\OC\Updater', 'maintenanceActive', function () use($log) { + $this->listen('\OC\Updater', 'maintenanceActive', function () use ($log) { $log->info('\OC\Updater::maintenanceActive: Maintenance mode is kept active', ['app' => 'updater']); }); - $this->listen('\OC\Updater', 'updateEnd', function ($success) use($log) { + $this->listen('\OC\Updater', 'updateEnd', function ($success) use ($log) { if ($success) { $log->info('\OC\Updater::updateEnd: Update successful', ['app' => 'updater']); } else { $log->error('\OC\Updater::updateEnd: Update failed', ['app' => 'updater']); } }); - $this->listen('\OC\Updater', 'dbUpgradeBefore', function () use($log) { + $this->listen('\OC\Updater', 'dbUpgradeBefore', function () use ($log) { $log->info('\OC\Updater::dbUpgradeBefore: Updating database schema', ['app' => 'updater']); }); - $this->listen('\OC\Updater', 'dbUpgrade', function () use($log) { + $this->listen('\OC\Updater', 'dbUpgrade', function () use ($log) { $log->info('\OC\Updater::dbUpgrade: Updated database', ['app' => 'updater']); }); - $this->listen('\OC\Updater', 'dbSimulateUpgradeBefore', function () use($log) { + $this->listen('\OC\Updater', 'dbSimulateUpgradeBefore', function () use ($log) { $log->info('\OC\Updater::dbSimulateUpgradeBefore: Checking whether the database schema can be updated (this can take a long time depending on the database size)', ['app' => 'updater']); }); - $this->listen('\OC\Updater', 'dbSimulateUpgrade', function () use($log) { + $this->listen('\OC\Updater', 'dbSimulateUpgrade', function () use ($log) { $log->info('\OC\Updater::dbSimulateUpgrade: Checked database schema update', ['app' => 'updater']); }); - $this->listen('\OC\Updater', 'incompatibleAppDisabled', function ($app) use($log) { + $this->listen('\OC\Updater', 'incompatibleAppDisabled', function ($app) use ($log) { $log->info('\OC\Updater::incompatibleAppDisabled: Disabled incompatible app: ' . $app, ['app' => 'updater']); }); - $this->listen('\OC\Updater', 'checkAppStoreAppBefore', function ($app) use($log) { + $this->listen('\OC\Updater', 'checkAppStoreAppBefore', function ($app) use ($log) { $log->info('\OC\Updater::checkAppStoreAppBefore: Checking for update of app "' . $app . '" in appstore', ['app' => 'updater']); }); - $this->listen('\OC\Updater', 'upgradeAppStoreApp', function ($app) use($log) { + $this->listen('\OC\Updater', 'upgradeAppStoreApp', function ($app) use ($log) { $log->info('\OC\Updater::upgradeAppStoreApp: Update app "' . $app . '" from appstore', ['app' => 'updater']); }); - $this->listen('\OC\Updater', 'checkAppStoreApp', function ($app) use($log) { + $this->listen('\OC\Updater', 'checkAppStoreApp', function ($app) use ($log) { $log->info('\OC\Updater::checkAppStoreApp: Checked for update of app "' . $app . '" in appstore', ['app' => 'updater']); }); $this->listen('\OC\Updater', 'appUpgradeCheckBefore', function () use ($log) { @@ -606,19 +606,19 @@ class Updater extends BasicEmitter { $this->listen('\OC\Updater', 'appUpgrade', function ($app, $version) use ($log) { $log->info('\OC\Updater::appUpgrade: Updated <' . $app . '> to ' . $version, ['app' => 'updater']); }); - $this->listen('\OC\Updater', 'failure', function ($message) use($log) { + $this->listen('\OC\Updater', 'failure', function ($message) use ($log) { $log->error('\OC\Updater::failure: ' . $message, ['app' => 'updater']); }); - $this->listen('\OC\Updater', 'setDebugLogLevel', function () use($log) { + $this->listen('\OC\Updater', 'setDebugLogLevel', function () use ($log) { $log->info('\OC\Updater::setDebugLogLevel: Set log level to debug', ['app' => 'updater']); }); - $this->listen('\OC\Updater', 'resetLogLevel', function ($logLevel, $logLevelName) use($log) { + $this->listen('\OC\Updater', 'resetLogLevel', function ($logLevel, $logLevelName) use ($log) { $log->info('\OC\Updater::resetLogLevel: Reset log level to ' . $logLevelName . '(' . $logLevel . ')', ['app' => 'updater']); }); - $this->listen('\OC\Updater', 'startCheckCodeIntegrity', function () use($log) { + $this->listen('\OC\Updater', 'startCheckCodeIntegrity', function () use ($log) { $log->info('\OC\Updater::startCheckCodeIntegrity: Starting code integrity check...', ['app' => 'updater']); }); - $this->listen('\OC\Updater', 'finishedCheckCodeIntegrity', function () use($log) { + $this->listen('\OC\Updater', 'finishedCheckCodeIntegrity', function () use ($log) { $log->info('\OC\Updater::finishedCheckCodeIntegrity: Finished code integrity check', ['app' => 'updater']); }); diff --git a/lib/private/User/Backend.php b/lib/private/User/Backend.php index 7d705811eaf..24f7c5161b8 100644 --- a/lib/private/User/Backend.php +++ b/lib/private/User/Backend.php @@ -96,7 +96,7 @@ abstract class Backend implements UserInterface { * * Deletes a user */ - public function deleteUser( $uid ) { + public function deleteUser($uid) { return false; } diff --git a/lib/private/User/Manager.php b/lib/private/User/Manager.php index 2dd12cf916d..1ab335eeea6 100644 --- a/lib/private/User/Manager.php +++ b/lib/private/User/Manager.php @@ -422,7 +422,7 @@ class Manager extends PublicEmitter implements IUserManager { public function countUsersOfGroups(array $groups) { $users = []; foreach($groups as $group) { - $usersIds = array_map(function($user) { + $usersIds = array_map(function ($user) { return $user->getUID(); }, $group->getUsers()); $users = array_merge($users, $usersIds); @@ -618,11 +618,11 @@ class Manager extends PublicEmitter implements IUserManager { public function getByEmail($email) { $userIds = $this->config->getUsersForUserValueCaseInsensitive('settings', 'email', $email); - $users = array_map(function($uid) { + $users = array_map(function ($uid) { return $this->get($uid); }, $userIds); - return array_values(array_filter($users, function($u) { + return array_values(array_filter($users, function ($u) { return ($u instanceof IUser); })); } diff --git a/lib/private/legacy/OC_DB.php b/lib/private/legacy/OC_DB.php index 34cc39f26aa..edcac8f9071 100644 --- a/lib/private/legacy/OC_DB.php +++ b/lib/private/legacy/OC_DB.php @@ -58,7 +58,7 @@ class OC_DB { * * SQL query via Doctrine prepare(), needs to be execute()'d! */ - static public function prepare( $query , $limit = null, $offset = null, $isManipulation = null) { + static public function prepare($query , $limit = null, $offset = null, $isManipulation = null) { $connection = \OC::$server->getDatabaseConnection(); if ($isManipulation === null) { @@ -84,7 +84,7 @@ class OC_DB { * @param string $sql * @return bool */ - static public function isManipulation( $sql ) { + static public function isManipulation($sql) { $selectOccurrence = stripos($sql, 'SELECT'); if ($selectOccurrence !== false && $selectOccurrence < 10) { return false; @@ -113,7 +113,7 @@ class OC_DB { * @return OC_DB_StatementWrapper * @throws \OC\DatabaseException */ - static public function executeAudited( $stmt, array $parameters = []) { + static public function executeAudited($stmt, array $parameters = []) { if (is_string($stmt)) { // convert to an array with 'sql' if (stripos($stmt, 'LIMIT') !== false) { //OFFSET requires LIMIT, so we only need to check for LIMIT @@ -172,7 +172,7 @@ class OC_DB { * * TODO: write more documentation */ - public static function createDbFromStructure( $file ) { + public static function createDbFromStructure($file) { $schemaManager = self::getMDB2SchemaManager(); return $schemaManager->createDbFromStructure($file); } diff --git a/lib/private/legacy/OC_DB_StatementWrapper.php b/lib/private/legacy/OC_DB_StatementWrapper.php index 872e8f64e79..d4072caf28e 100644 --- a/lib/private/legacy/OC_DB_StatementWrapper.php +++ b/lib/private/legacy/OC_DB_StatementWrapper.php @@ -114,7 +114,7 @@ class OC_DB_StatementWrapper { * @param integer|null $length max length when using an OUT bind * @return boolean */ - public function bindParam($column, &$variable, $type = null, $length = null){ + public function bindParam($column, &$variable, $type = null, $length = null) { return $this->statement->bindParam($column, $variable, $type, $length); } } diff --git a/lib/private/legacy/OC_Files.php b/lib/private/legacy/OC_Files.php index 72983f50d9c..710e0882010 100644 --- a/lib/private/legacy/OC_Files.php +++ b/lib/private/legacy/OC_Files.php @@ -399,7 +399,7 @@ class OC_Files { $view->lockFile($file, ILockingProvider::LOCK_SHARED); if ($view->is_dir($file)) { $contents = $view->getDirectoryContent($file); - $contents = array_map(function($fileInfo) use ($file) { + $contents = array_map(function ($fileInfo) use ($file) { /** @var \OCP\Files\FileInfo $fileInfo */ return $file . '/' . $fileInfo->getName(); }, $contents); diff --git a/lib/private/legacy/OC_Hook.php b/lib/private/legacy/OC_Hook.php index 3cc29a58c77..d7b1e414a00 100644 --- a/lib/private/legacy/OC_Hook.php +++ b/lib/private/legacy/OC_Hook.php @@ -51,7 +51,7 @@ class OC_Hook { * * TODO: write example */ - static public function connect($signalClass, $signalName, $slotClass, $slotName ) { + static public function connect($signalClass, $signalName, $slotClass, $slotName) { // If we're trying to connect to an emitting class that isn't // yet registered, register it if( !array_key_exists($signalClass, self::$registered )) { diff --git a/lib/private/legacy/OC_Response.php b/lib/private/legacy/OC_Response.php index 4eb454d3181..d30f56ca1ba 100644 --- a/lib/private/legacy/OC_Response.php +++ b/lib/private/legacy/OC_Response.php @@ -33,7 +33,7 @@ class OC_Response { * @param string $filename file name * @param string $type disposition type, either 'attachment' or 'inline' */ - static public function setContentDispositionHeader( $filename, $type = 'attachment' ) { + static public function setContentDispositionHeader($filename, $type = 'attachment') { if (\OC::$server->getRequest()->isUserAgent( [ \OC\AppFramework\Http\Request::USER_AGENT_IE, diff --git a/lib/private/legacy/OC_Template.php b/lib/private/legacy/OC_Template.php index 279ceb8de0f..99ad53fa08a 100644 --- a/lib/private/legacy/OC_Template.php +++ b/lib/private/legacy/OC_Template.php @@ -72,7 +72,7 @@ class OC_Template extends \OC\Template\Base { * "admin". * @param bool $registerCall = true */ - public function __construct( $app, $name, $renderAs = "", $registerCall = true ) { + public function __construct($app, $name, $renderAs = "", $registerCall = true) { // Read the selected theme from the config file self::initTemplateEngine($renderAs); @@ -227,7 +227,7 @@ class OC_Template extends \OC\Template\Base { * Includes another template. use <?php echo $this->inc('template'); ?> to * do this. */ - public function inc( $file, $additionalParams = null ) { + public function inc($file, $additionalParams = null) { return $this->load($this->path.$file.'.php', $additionalParams); } @@ -238,7 +238,7 @@ class OC_Template extends \OC\Template\Base { * @param array $parameters Parameters for the template * @return boolean|null */ - public static function printUserPage( $application, $name, $parameters = [] ) { + public static function printUserPage($application, $name, $parameters = []) { $content = new OC_Template( $application, $name, "user" ); foreach( $parameters as $key => $value ) { $content->assign( $key, $value ); @@ -253,7 +253,7 @@ class OC_Template extends \OC\Template\Base { * @param array $parameters Parameters for the template * @return bool */ - public static function printAdminPage( $application, $name, $parameters = [] ) { + public static function printAdminPage($application, $name, $parameters = []) { $content = new OC_Template( $application, $name, "admin" ); foreach( $parameters as $key => $value ) { $content->assign( $key, $value ); @@ -268,7 +268,7 @@ class OC_Template extends \OC\Template\Base { * @param array|string $parameters Parameters for the template * @return bool */ - public static function printGuestPage( $application, $name, $parameters = [] ) { + public static function printGuestPage($application, $name, $parameters = []) { $content = new OC_Template($application, $name, $name === 'error' ? $name : 'guest'); foreach( $parameters as $key => $value ) { $content->assign( $key, $value ); @@ -283,7 +283,7 @@ class OC_Template extends \OC\Template\Base { * @param int $statusCode * @suppress PhanAccessMethodInternal */ - public static function printErrorPage( $error_msg, $hint = '', $statusCode = 500) { + public static function printErrorPage($error_msg, $hint = '', $statusCode = 500) { if (\OC::$server->getAppManager()->isEnabledForUser('theming') && !\OC_App::isAppLoaded('theming')) { \OC_App::loadApp('theming'); } diff --git a/lib/private/legacy/OC_Util.php b/lib/private/legacy/OC_Util.php index f14095675dc..5d2f8b8370e 100644 --- a/lib/private/legacy/OC_Util.php +++ b/lib/private/legacy/OC_Util.php @@ -1163,7 +1163,7 @@ class OC_Util { */ public static function sanitizeHTML($value) { if (is_array($value)) { - $value = array_map(function($value) { + $value = array_map(function ($value) { return self::sanitizeHTML($value); }, $value); } else { diff --git a/lib/private/legacy/template/functions.php b/lib/private/legacy/template/functions.php index 44fa9e52dd2..f427642b619 100644 --- a/lib/private/legacy/template/functions.php +++ b/lib/private/legacy/template/functions.php @@ -214,7 +214,7 @@ function component($app, $file) { * * For further information have a look at \OCP\IURLGenerator::linkTo */ -function link_to( $app, $file, $args = [] ) { +function link_to($app, $file, $args = []) { return \OC::$server->getURLGenerator()->linkTo($app, $file, $args); } @@ -234,7 +234,7 @@ function link_to_docs($key) { * * For further information have a look at \OCP\IURLGenerator::imagePath */ -function image_path( $app, $image ) { +function image_path($app, $image) { return \OC::$server->getURLGenerator()->imagePath( $app, $image ); } @@ -243,7 +243,7 @@ function image_path( $app, $image ) { * @param string $mimetype mimetype * @return string link to the image */ -function mimetype_icon( $mimetype ) { +function mimetype_icon($mimetype) { return \OC::$server->getMimeTypeDetector()->mimeTypeIcon( $mimetype ); } @@ -253,7 +253,7 @@ function mimetype_icon( $mimetype ) { * @param string $path path of file * @return string link to the preview */ -function preview_icon( $path ) { +function preview_icon($path) { return \OC::$server->getURLGenerator()->linkToRoute('core.Preview.getPreview', ['x' => 32, 'y' => 32, 'file' => $path]); } @@ -262,7 +262,7 @@ function preview_icon( $path ) { * @param string $token * @return string */ -function publicPreview_icon ( $path, $token ) { +function publicPreview_icon($path, $token) { return \OC::$server->getURLGenerator()->linkToRoute('files_sharing.PublicPreview.getPreview', ['x' => 32, 'y' => 32, 'file' => $path, 'token' => $token]); } @@ -273,7 +273,7 @@ function publicPreview_icon ( $path, $token ) { * * For further information have a look at OC_Helper::humanFileSize */ -function human_file_size( $bytes ) { +function human_file_size($bytes) { return OC_Helper::humanFileSize( $bytes ); } @@ -282,7 +282,7 @@ function human_file_size( $bytes ) { * @param int $timestamp UNIX timestamp to strip * @return int timestamp without time value */ -function strip_time($timestamp){ +function strip_time($timestamp) { $date = new \DateTime("@{$timestamp}"); $date->setTime(0, 0, 0); return (int)$date->format('U'); diff --git a/lib/public/Accounts/PropertyDoesNotExistException.php b/lib/public/Accounts/PropertyDoesNotExistException.php index 0aa5b4c394c..e9e57dd8779 100644 --- a/lib/public/Accounts/PropertyDoesNotExistException.php +++ b/lib/public/Accounts/PropertyDoesNotExistException.php @@ -37,7 +37,7 @@ class PropertyDoesNotExistException extends \Exception { * @param string $msg the error message * @since 15.0.0 */ - public function __construct($property){ + public function __construct($property) { parent::__construct('Property ' . $property . ' does not exist.'); } diff --git a/lib/public/App.php b/lib/public/App.php index cdf66522d41..7d55729c473 100644 --- a/lib/public/App.php +++ b/lib/public/App.php @@ -56,7 +56,7 @@ class App { * @since 4.0.0 * @deprecated 14.0.0 Use settings section in appinfo.xml to register personal admin sections */ - public static function registerPersonal( $app, $page ) { + public static function registerPersonal($app, $page) { \OC_App::registerPersonal( $app, $page ); } @@ -68,7 +68,7 @@ class App { * @since 4.0.0 * @deprecated 14.0.0 Use settings section in appinfo.xml to register admin sections */ - public static function registerAdmin( $app, $page ) { + public static function registerAdmin($app, $page) { \OC_App::registerAdmin( $app, $page ); } @@ -80,7 +80,7 @@ class App { * @deprecated 14.0.0 ise \OC::$server->getAppManager()->getAppInfo($appId) * @since 4.0.0 */ - public static function getAppInfo( $app, $path=false ) { + public static function getAppInfo($app, $path=false) { return \OC_App::getAppInfo( $app, $path); } @@ -93,7 +93,7 @@ class App { * @since 4.0.0 * @deprecated 13.0.0 use \OC::$server->getAppManager()->isEnabledForUser($appId) */ - public static function isEnabled( $app ) { + public static function isEnabled($app) { return \OC::$server->getAppManager()->isEnabledForUser( $app ); } @@ -104,7 +104,7 @@ class App { * @since 4.0.0 * @deprecated 14.0.0 use \OC::$server->getAppManager()->getAppVersion($appId) */ - public static function getAppVersion( $app ) { + public static function getAppVersion($app) { return \OC::$server->getAppManager()->getAppVersion($app); } } diff --git a/lib/public/AppFramework/ApiController.php b/lib/public/AppFramework/ApiController.php index e8ecf61c921..feae56fc2c0 100644 --- a/lib/public/AppFramework/ApiController.php +++ b/lib/public/AppFramework/ApiController.php @@ -61,7 +61,7 @@ abstract class ApiController extends Controller { IRequest $request, $corsMethods='PUT, POST, GET, DELETE, PATCH', $corsAllowedHeaders='Authorization, Content-Type, Accept', - $corsMaxAge=1728000){ + $corsMaxAge=1728000) { parent::__construct($appName, $request); $this->corsMethods = $corsMethods; $this->corsAllowedHeaders = $corsAllowedHeaders; diff --git a/lib/public/AppFramework/Db/DoesNotExistException.php b/lib/public/AppFramework/Db/DoesNotExistException.php index d401bcb5f8b..36cab24db76 100644 --- a/lib/public/AppFramework/Db/DoesNotExistException.php +++ b/lib/public/AppFramework/Db/DoesNotExistException.php @@ -39,7 +39,7 @@ class DoesNotExistException extends \Exception implements IMapperException { * @param string $msg the error message * @since 7.0.0 */ - public function __construct($msg){ + public function __construct($msg) { parent::__construct($msg); } diff --git a/lib/public/AppFramework/Db/Entity.php b/lib/public/AppFramework/Db/Entity.php index 3735c83cf81..6221f96b375 100644 --- a/lib/public/AppFramework/Db/Entity.php +++ b/lib/public/AppFramework/Db/Entity.php @@ -65,7 +65,7 @@ abstract class Entity { * @param array $row the row to map onto the entity * @since 7.0.0 */ - public static function fromRow(array $row){ + public static function fromRow(array $row) { $instance = new static(); foreach($row as $key => $value){ @@ -93,7 +93,7 @@ abstract class Entity { * Marks the entity as clean needed for setting the id after the insertion * @since 7.0.0 */ - public function resetUpdatedFields(){ + public function resetUpdatedFields() { $this->_updatedFields = []; } @@ -175,7 +175,7 @@ abstract class Entity { * @param string $attribute the name of the attribute * @since 7.0.0 */ - protected function markFieldUpdated($attribute){ + protected function markFieldUpdated($attribute) { $this->_updatedFields[$attribute] = true; } @@ -186,7 +186,7 @@ abstract class Entity { * @return string the property name * @since 7.0.0 */ - public function columnToProperty($columnName){ + public function columnToProperty($columnName) { $parts = explode('_', $columnName); $property = null; @@ -208,7 +208,7 @@ abstract class Entity { * @return string the column name * @since 7.0.0 */ - public function propertyToColumn($property){ + public function propertyToColumn($property) { $parts = preg_split('/(?=[A-Z])/', $property); $column = null; @@ -228,7 +228,7 @@ abstract class Entity { * @return array array of updated fields for update query * @since 7.0.0 */ - public function getUpdatedFields(){ + public function getUpdatedFields() { return $this->_updatedFields; } @@ -240,7 +240,7 @@ abstract class Entity { * @param string $type the type which will be used to call settype() * @since 7.0.0 */ - protected function addType($fieldName, $type){ + protected function addType($fieldName, $type) { $this->_fieldTypes[$fieldName] = $type; } @@ -252,7 +252,7 @@ abstract class Entity { * @return string slugified value * @since 7.0.0 */ - public function slugify($attributeName){ + public function slugify($attributeName) { // toSlug should only work for existing attributes if(property_exists($this, $attributeName)){ $value = $this->$attributeName; diff --git a/lib/public/AppFramework/Db/Mapper.php b/lib/public/AppFramework/Db/Mapper.php index 7dcc4a4bade..6d35c99d672 100644 --- a/lib/public/AppFramework/Db/Mapper.php +++ b/lib/public/AppFramework/Db/Mapper.php @@ -49,7 +49,7 @@ abstract class Mapper { * @since 7.0.0 * @deprecated 14.0.0 Move over to QBMapper */ - public function __construct(IDBConnection $db, $tableName, $entityClass=null){ + public function __construct(IDBConnection $db, $tableName, $entityClass=null) { $this->db = $db; $this->tableName = '*PREFIX*' . $tableName; @@ -68,7 +68,7 @@ abstract class Mapper { * @since 7.0.0 * @deprecated 14.0.0 Move over to QBMapper */ - public function getTableName(){ + public function getTableName() { return $this->tableName; } @@ -80,7 +80,7 @@ abstract class Mapper { * @since 7.0.0 - return value added in 8.1.0 * @deprecated 14.0.0 Move over to QBMapper */ - public function delete(Entity $entity){ + public function delete(Entity $entity) { $sql = 'DELETE FROM `' . $this->tableName . '` WHERE `id` = ?'; $stmt = $this->execute($sql, [$entity->getId()]); $stmt->closeCursor(); @@ -95,7 +95,7 @@ abstract class Mapper { * @since 7.0.0 * @deprecated 14.0.0 Move over to QBMapper */ - public function insert(Entity $entity){ + public function insert(Entity $entity) { // get updated fields to save, fields have to be set using a setter to // be saved $properties = $entity->getUpdatedFields(); @@ -145,7 +145,7 @@ abstract class Mapper { * @since 7.0.0 - return value was added in 8.0.0 * @deprecated 14.0.0 Move over to QBMapper */ - public function update(Entity $entity){ + public function update(Entity $entity) { // if entity wasn't changed it makes no sense to run a db query $properties = $entity->getUpdatedFields(); if(count($properties) === 0) { @@ -235,7 +235,7 @@ abstract class Mapper { * @since 7.0.0 * @deprecated 14.0.0 Move over to QBMapper */ - protected function execute($sql, array $params=[], $limit=null, $offset=null){ + protected function execute($sql, array $params=[], $limit=null, $offset=null) { $query = $this->db->prepare($sql, $limit, $offset); if ($this->isAssocArray($params)) { @@ -271,7 +271,7 @@ abstract class Mapper { * @since 7.0.0 * @deprecated 14.0.0 Move over to QBMapper */ - protected function findOneQuery($sql, array $params=[], $limit=null, $offset=null){ + protected function findOneQuery($sql, array $params=[], $limit=null, $offset=null) { $stmt = $this->execute($sql, $params, $limit, $offset); $row = $stmt->fetch(); @@ -367,7 +367,7 @@ abstract class Mapper { * @since 7.0.0 * @deprecated 14.0.0 Move over to QBMapper */ - protected function findEntity($sql, array $params=[], $limit=null, $offset=null){ + protected function findEntity($sql, array $params=[], $limit=null, $offset=null) { return $this->mapRowToEntity($this->findOneQuery($sql, $params, $limit, $offset)); } diff --git a/lib/public/AppFramework/Db/MultipleObjectsReturnedException.php b/lib/public/AppFramework/Db/MultipleObjectsReturnedException.php index d5fd63bd405..a3f211194c4 100644 --- a/lib/public/AppFramework/Db/MultipleObjectsReturnedException.php +++ b/lib/public/AppFramework/Db/MultipleObjectsReturnedException.php @@ -39,7 +39,7 @@ class MultipleObjectsReturnedException extends \Exception implements IMapperExce * @param string $msg the error message * @since 7.0.0 */ - public function __construct($msg){ + public function __construct($msg) { parent::__construct($msg); } diff --git a/lib/public/AppFramework/Db/QBMapper.php b/lib/public/AppFramework/Db/QBMapper.php index 487128b7305..d26fb090725 100644 --- a/lib/public/AppFramework/Db/QBMapper.php +++ b/lib/public/AppFramework/Db/QBMapper.php @@ -58,7 +58,7 @@ abstract class QBMapper { * mapped to queries without using sql * @since 14.0.0 */ - public function __construct(IDBConnection $db, string $tableName, string $entityClass=null){ + public function __construct(IDBConnection $db, string $tableName, string $entityClass=null) { $this->db = $db; $this->tableName = $tableName; diff --git a/lib/public/AppFramework/Http/DataDisplayResponse.php b/lib/public/AppFramework/Http/DataDisplayResponse.php index 4b31bc7dc0d..8e14b231522 100644 --- a/lib/public/AppFramework/Http/DataDisplayResponse.php +++ b/lib/public/AppFramework/Http/DataDisplayResponse.php @@ -73,7 +73,7 @@ class DataDisplayResponse extends Response { * @return DataDisplayResponse Reference to this object * @since 8.1.0 */ - public function setData($data){ + public function setData($data) { $this->data = $data; return $this; @@ -85,7 +85,7 @@ class DataDisplayResponse extends Response { * @return string the data * @since 8.1.0 */ - public function getData(){ + public function getData() { return $this->data; } diff --git a/lib/public/AppFramework/Http/DataResponse.php b/lib/public/AppFramework/Http/DataResponse.php index 7efbb58d8c7..a978df49010 100644 --- a/lib/public/AppFramework/Http/DataResponse.php +++ b/lib/public/AppFramework/Http/DataResponse.php @@ -68,7 +68,7 @@ class DataResponse extends Response { * @return DataResponse Reference to this object * @since 8.0.0 */ - public function setData($data){ + public function setData($data) { $this->data = $data; return $this; @@ -80,7 +80,7 @@ class DataResponse extends Response { * @return array the data * @since 8.0.0 */ - public function getData(){ + public function getData() { return $this->data; } diff --git a/lib/public/AppFramework/Http/JSONResponse.php b/lib/public/AppFramework/Http/JSONResponse.php index 9451ef6677e..1d7a626d5cd 100644 --- a/lib/public/AppFramework/Http/JSONResponse.php +++ b/lib/public/AppFramework/Http/JSONResponse.php @@ -86,7 +86,7 @@ class JSONResponse extends Response { * @return JSONResponse Reference to this object * @since 6.0.0 - return value was added in 7.0.0 */ - public function setData($data){ + public function setData($data) { $this->data = $data; return $this; @@ -98,7 +98,7 @@ class JSONResponse extends Response { * @return array the data * @since 6.0.0 */ - public function getData(){ + public function getData() { return $this->data; } diff --git a/lib/public/AppFramework/Http/StreamResponse.php b/lib/public/AppFramework/Http/StreamResponse.php index 80985ae7527..a228ed5566c 100644 --- a/lib/public/AppFramework/Http/StreamResponse.php +++ b/lib/public/AppFramework/Http/StreamResponse.php @@ -42,7 +42,7 @@ class StreamResponse extends Response implements ICallbackResponse { * @param string|resource $filePath the path to the file or a file handle which should be streamed * @since 8.1.0 */ - public function __construct ($filePath) { + public function __construct($filePath) { parent::__construct(); $this->filePath = $filePath; @@ -55,7 +55,7 @@ class StreamResponse extends Response implements ICallbackResponse { * @param IOutput $output a small wrapper that handles output * @since 8.1.0 */ - public function callback (IOutput $output) { + public function callback(IOutput $output) { // handle caching if ($output->getHttpResponseCode() !== Http::STATUS_NOT_MODIFIED) { if (!(is_resource($this->filePath) || file_exists($this->filePath))) { diff --git a/lib/public/AppFramework/Http/Template/PublicTemplateResponse.php b/lib/public/AppFramework/Http/Template/PublicTemplateResponse.php index 9965ca6bd33..67fe6165eef 100644 --- a/lib/public/AppFramework/Http/Template/PublicTemplateResponse.php +++ b/lib/public/AppFramework/Http/Template/PublicTemplateResponse.php @@ -98,7 +98,7 @@ class PublicTemplateResponse extends TemplateResponse { } $this->headerActions[] = $action; } - usort($this->headerActions, function(IMenuAction $a, IMenuAction $b) { + usort($this->headerActions, function (IMenuAction $a, IMenuAction $b) { return $a->getPriority() > $b->getPriority(); }); } diff --git a/lib/public/AppFramework/Http/TemplateResponse.php b/lib/public/AppFramework/Http/TemplateResponse.php index 5ce7c3a7966..504b4af93ff 100644 --- a/lib/public/AppFramework/Http/TemplateResponse.php +++ b/lib/public/AppFramework/Http/TemplateResponse.php @@ -96,7 +96,7 @@ class TemplateResponse extends Response { * @return TemplateResponse Reference to this object * @since 6.0.0 - return value was added in 7.0.0 */ - public function setParams(array $params){ + public function setParams(array $params) { $this->params = $params; return $this; @@ -108,7 +108,7 @@ class TemplateResponse extends Response { * @return array the params * @since 6.0.0 */ - public function getParams(){ + public function getParams() { return $this->params; } @@ -118,7 +118,7 @@ class TemplateResponse extends Response { * @return string the name of the used template * @since 6.0.0 */ - public function getTemplateName(){ + public function getTemplateName() { return $this->templateName; } @@ -132,7 +132,7 @@ class TemplateResponse extends Response { * @return TemplateResponse Reference to this object * @since 6.0.0 - return value was added in 7.0.0 */ - public function renderAs($renderAs){ + public function renderAs($renderAs) { $this->renderAs = $renderAs; return $this; @@ -144,7 +144,7 @@ class TemplateResponse extends Response { * @return string the renderAs value * @since 6.0.0 */ - public function getRenderAs(){ + public function getRenderAs() { return $this->renderAs; } @@ -154,7 +154,7 @@ class TemplateResponse extends Response { * @return string the rendered html * @since 6.0.0 */ - public function render(){ + public function render() { // \OCP\Template needs an empty string instead of 'blank' for an unwrapped response $renderAs = $this->renderAs === 'blank' ? '' : $this->renderAs; diff --git a/lib/public/AppFramework/Middleware.php b/lib/public/AppFramework/Middleware.php index 5df8a919efe..2cf27fc14fd 100644 --- a/lib/public/AppFramework/Middleware.php +++ b/lib/public/AppFramework/Middleware.php @@ -52,7 +52,7 @@ abstract class Middleware { * the controller * @since 6.0.0 */ - public function beforeController($controller, $methodName){ + public function beforeController($controller, $methodName) { } @@ -72,7 +72,7 @@ abstract class Middleware { * @return Response a Response object in case that the exception was handled * @since 6.0.0 */ - public function afterException($controller, $methodName, \Exception $exception){ + public function afterException($controller, $methodName, \Exception $exception) { throw $exception; } @@ -88,7 +88,7 @@ abstract class Middleware { * @return Response a Response object * @since 6.0.0 */ - public function afterController($controller, $methodName, Response $response){ + public function afterController($controller, $methodName, Response $response) { return $response; } @@ -104,7 +104,7 @@ abstract class Middleware { * @return string the output that should be printed * @since 6.0.0 */ - public function beforeOutput($controller, $methodName, $output){ + public function beforeOutput($controller, $methodName, $output) { return $output; } diff --git a/lib/public/AppFramework/OCSController.php b/lib/public/AppFramework/OCSController.php index 4a3fa882577..d7243bb4d68 100644 --- a/lib/public/AppFramework/OCSController.php +++ b/lib/public/AppFramework/OCSController.php @@ -63,7 +63,7 @@ abstract class OCSController extends ApiController { IRequest $request, $corsMethods='PUT, POST, GET, DELETE, PATCH', $corsAllowedHeaders='Authorization, Content-Type, Accept', - $corsMaxAge=1728000){ + $corsMaxAge=1728000) { parent::__construct($appName, $request, $corsMethods, $corsAllowedHeaders, $corsMaxAge); $this->registerResponder('json', function ($data) { diff --git a/lib/public/Files.php b/lib/public/Files.php index 1e6e9d48e03..adadbcd7aba 100644 --- a/lib/public/Files.php +++ b/lib/public/Files.php @@ -54,7 +54,7 @@ class Files { * @since 5.0.0 * @deprecated 14.0.0 */ - static public function rmdirr( $dir ) { + static public function rmdirr($dir) { return \OC_Helper::rmdirr( $dir ); } @@ -66,7 +66,7 @@ class Files { * @since 5.0.0 * @deprecated 14.0.0 */ - static public function getMimeType( $path ) { + static public function getMimeType($path) { return \OC::$server->getMimeTypeDetector()->detect($path); } @@ -89,7 +89,7 @@ class Files { * @since 5.0.0 * @deprecated 14.0.0 */ - public static function streamCopy( $source, $target ) { + public static function streamCopy($source, $target) { list($count, ) = \OC_Helper::streamCopy( $source, $target ); return $count; } diff --git a/lib/public/Util.php b/lib/public/Util.php index f1008ad77c9..99161dfd72c 100644 --- a/lib/public/Util.php +++ b/lib/public/Util.php @@ -128,7 +128,7 @@ class Util { * @since 4.0.0 * @deprecated 13.0.0 use log of \OCP\ILogger */ - public static function writeLog( $app, $message, $level ) { + public static function writeLog($app, $message, $level) { $context = ['app' => $app]; \OC::$server->getLogger()->log($level, $message, $context); } @@ -170,7 +170,7 @@ class Util { * @param string $file * @since 4.0.0 */ - public static function addStyle( $application, $file = null ) { + public static function addStyle($application, $file = null) { \OC_Util::addStyle( $application, $file ); } @@ -180,7 +180,7 @@ class Util { * @param string $file * @since 4.0.0 */ - public static function addScript( $application, $file = null ) { + public static function addScript($application, $file = null) { \OC_Util::addScript( $application, $file ); } @@ -216,7 +216,7 @@ class Util { * @return string the url * @since 4.0.0 - parameter $args was added in 4.5.0 */ - public static function linkToAbsolute( $app, $file, $args = [] ) { + public static function linkToAbsolute($app, $file, $args = []) { $urlGenerator = \OC::$server->getURLGenerator(); return $urlGenerator->getAbsoluteURL( $urlGenerator->linkTo($app, $file, $args) @@ -229,7 +229,7 @@ class Util { * @return string the url * @since 4.0.0 */ - public static function linkToRemote( $service ) { + public static function linkToRemote($service) { $urlGenerator = \OC::$server->getURLGenerator(); $remoteBase = $urlGenerator->linkTo('', 'remote.php') . '/' . $service; return $urlGenerator->getAbsoluteURL( |