diff --git a/lib/private/Activity/Manager.php b/lib/private/Activity/Manager.php index bbb6f6941567586171c3b1ed1ddf5cc42073b565..7640a367e74c4a083170ba97a3801f0c86e162f7 100644 --- a/lib/private/Activity/Manager.php +++ b/lib/private/Activity/Manager.php @@ -588,7 +588,7 @@ class Manager implements IManager { $users = $this->config->getUsersForUserValue('activity', 'rsstoken', $token); - if (sizeof($users) !== 1) { + if (count($users) !== 1) { // No unique user found throw new \UnexpectedValueException('The token is invalid'); } diff --git a/lib/private/AllConfig.php b/lib/private/AllConfig.php index 1f59e677a542fe12ac505cd47b6e00e8554fb0e0..52b0679bb20bf8c6031c36eb4f1e3ab88cc77422 100644 --- a/lib/private/AllConfig.php +++ b/lib/private/AllConfig.php @@ -409,7 +409,7 @@ class AllConfig implements \OCP\IConfig { array_unshift($queryParams, $key); array_unshift($queryParams, $appName); - $placeholders = (sizeof($chunk) == 50) ? $placeholders50 : implode(',', array_fill(0, sizeof($chunk), '?')); + $placeholders = (count($chunk) === 50) ? $placeholders50 : implode(',', array_fill(0, count($chunk), '?')); $query = 'SELECT `userid`, `configvalue` ' . 'FROM `*PREFIX*preferences` ' . diff --git a/lib/private/App/DependencyAnalyzer.php b/lib/private/App/DependencyAnalyzer.php index 84d87efa3d32f7584d0a7b9b8474ad9f20f329fc..1ec028b97282a4fd0243bf3eb00f4fb870ba4991 100644 --- a/lib/private/App/DependencyAnalyzer.php +++ b/lib/private/App/DependencyAnalyzer.php @@ -43,7 +43,7 @@ class DependencyAnalyzer { * @param Platform $platform * @param \OCP\IL10N $l */ - function __construct(Platform $platform, IL10N $l) { + public function __construct(Platform $platform, IL10N $l) { $this->platform = $platform; $this->l = $l; } @@ -179,7 +179,7 @@ class DependencyAnalyzer { }, $supportedDatabases); $currentDatabase = $this->platform->getDatabase(); if (!in_array($currentDatabase, $supportedDatabases)) { - $missing[] = (string)$this->l->t('Following databases are supported: %s', join(', ', $supportedDatabases)); + $missing[] = (string)$this->l->t('Following databases are supported: %s', implode(', ', $supportedDatabases)); } return $missing; } @@ -282,7 +282,7 @@ class DependencyAnalyzer { } $currentOS = $this->platform->getOS(); if (!in_array($currentOS, $oss)) { - $missing[] = (string)$this->l->t('Following platforms are supported: %s', join(', ', $oss)); + $missing[] = (string)$this->l->t('Following platforms are supported: %s', implode(', ', $oss)); } return $missing; } @@ -349,8 +349,9 @@ class DependencyAnalyzer { * @return mixed */ private function getValue($element) { - if (isset($element['@value'])) + if (isset($element['@value'])) { return $element['@value']; + } return (string)$element; } } diff --git a/lib/private/App/InfoParser.php b/lib/private/App/InfoParser.php index 47ce28e6e987dc3c345f76b73cf51dc05e108d57..fef8ab7a1e8dbf945602df8351b72320ffcaa50c 100644 --- a/lib/private/App/InfoParser.php +++ b/lib/private/App/InfoParser.php @@ -176,7 +176,7 @@ class InfoParser { * @param \SimpleXMLElement $xml * @return array */ - function xmlToArray($xml) { + public function xmlToArray($xml) { if (!$xml->children()) { return (string)$xml; } diff --git a/lib/private/AppFramework/DependencyInjection/DIContainer.php b/lib/private/AppFramework/DependencyInjection/DIContainer.php index 86d14a2f330fe82511c527d506c622f0bb988259..b233f3ca9b6f824096a3cf2ee53df5804d650161 100644 --- a/lib/private/AppFramework/DependencyInjection/DIContainer.php +++ b/lib/private/AppFramework/DependencyInjection/DIContainer.php @@ -315,7 +315,7 @@ class DIContainer extends SimpleContainer implements IAppContainer { * @deprecated implements only deprecated methods * @return IApi */ - function getCoreApi() + public function getCoreApi() { return $this->query('API'); } @@ -323,7 +323,7 @@ class DIContainer extends SimpleContainer implements IAppContainer { /** * @return \OCP\IServerContainer */ - function getServer() + public function getServer() { return $this->server; } @@ -332,7 +332,7 @@ class DIContainer extends SimpleContainer implements IAppContainer { * @param string $middleWare * @return boolean|null */ - function registerMiddleWare($middleWare) { + public function registerMiddleWare($middleWare) { array_push($this->middleWares, $middleWare); } @@ -340,7 +340,7 @@ class DIContainer extends SimpleContainer implements IAppContainer { * used to return the appname of the set application * @return string the name of your application */ - function getAppName() { + public function getAppName() { return $this->query('AppName'); } @@ -348,7 +348,7 @@ class DIContainer extends SimpleContainer implements IAppContainer { * @deprecated use IUserSession->isLoggedIn() * @return boolean */ - function isLoggedIn() { + public function isLoggedIn() { return \OC::$server->getUserSession()->isLoggedIn(); } @@ -356,7 +356,7 @@ class DIContainer extends SimpleContainer implements IAppContainer { * @deprecated use IGroupManager->isAdmin($userId) * @return boolean */ - function isAdminUser() { + public function isAdminUser() { $uid = $this->getUserId(); return \OC_User::isAdminUser($uid); } @@ -371,7 +371,7 @@ class DIContainer extends SimpleContainer implements IAppContainer { * @param string $level * @return mixed */ - function log($message, $level) { + public function log($message, $level) { switch($level){ case 'debug': $level = \OCP\Util::DEBUG; diff --git a/lib/private/Archive/Archive.php b/lib/private/Archive/Archive.php index fadc12d2a24bcab1022a99dddc907f76a4795943..15ec3e1fe5624e572d3b3b475c037459980e6b3c 100644 --- a/lib/private/Archive/Archive.php +++ b/lib/private/Archive/Archive.php @@ -36,100 +36,100 @@ abstract class Archive { /** * @param $source */ - abstract function __construct($source); + public abstract function __construct($source); /** * add an empty folder to the archive * @param string $path * @return bool */ - abstract function addFolder($path); + public abstract function addFolder($path); /** * add a file to the archive * @param string $path * @param string $source either a local file or string data * @return bool */ - abstract function addFile($path, $source=''); + public abstract function addFile($path, $source=''); /** * rename a file or folder in the archive * @param string $source * @param string $dest * @return bool */ - abstract function rename($source, $dest); + public abstract function rename($source, $dest); /** * get the uncompressed size of a file in the archive * @param string $path * @return int */ - abstract function filesize($path); + public abstract function filesize($path); /** * get the last modified time of a file in the archive * @param string $path * @return int */ - abstract function mtime($path); + public abstract function mtime($path); /** * get the files in a folder * @param string $path * @return array */ - abstract function getFolder($path); + public abstract function getFolder($path); /** * get all files in the archive * @return array */ - abstract function getFiles(); + public abstract function getFiles(); /** * get the content of a file * @param string $path * @return string */ - abstract function getFile($path); + public abstract function getFile($path); /** * extract a single file from the archive * @param string $path * @param string $dest * @return bool */ - abstract function extractFile($path, $dest); + public abstract function extractFile($path, $dest); /** * extract the archive * @param string $dest * @return bool */ - abstract function extract($dest); + public abstract function extract($dest); /** * check if a file or folder exists in the archive * @param string $path * @return bool */ - abstract function fileExists($path); + public abstract function fileExists($path); /** * remove a file or folder from the archive * @param string $path * @return bool */ - abstract function remove($path); + public abstract function remove($path); /** * get a file handler * @param string $path * @param string $mode * @return resource */ - abstract function getStream($path, $mode); + public abstract function getStream($path, $mode); /** * add a folder and all its content * @param string $path * @param string $source * @return boolean|null */ - function addRecursive($path, $source) { + public function addRecursive($path, $source) { $dh = opendir($source); if(is_resource($dh)) { $this->addFolder($path); while (($file = readdir($dh)) !== false) { - if($file=='.' or $file=='..') { + if($file === '.' || $file === '..') { continue; } if(is_dir($source.'/'.$file)) { diff --git a/lib/private/Archive/TAR.php b/lib/private/Archive/TAR.php index 07ccd09f3996f767af0cc2413c59bb5e315515c8..e6f7ad2b9981d26f3391b582054ab075a94723b7 100644 --- a/lib/private/Archive/TAR.php +++ b/lib/private/Archive/TAR.php @@ -52,7 +52,7 @@ class TAR extends Archive { /** * @param string $source */ - function __construct($source) { + public function __construct($source) { $types = array(null, 'gz', 'bz2'); $this->path = $source; $this->tar = new \Archive_Tar($source, $types[self::getTarType($source)]); @@ -90,7 +90,7 @@ class TAR extends Archive { * @param string $path * @return bool */ - function addFolder($path) { + public function addFolder($path) { $tmpBase = \OC::$server->getTempManager()->getTemporaryFolder(); if (substr($path, -1, 1) != '/') { $path .= '/'; @@ -120,7 +120,7 @@ class TAR extends Archive { * @param string $source either a local file or string data * @return bool */ - function addFile($path, $source = '') { + public function addFile($path, $source = '') { if ($this->fileExists($path)) { $this->remove($path); } @@ -140,7 +140,7 @@ class TAR extends Archive { * @param string $dest * @return bool */ - function rename($source, $dest) { + public function rename($source, $dest) { //no proper way to delete, rename entire archive, rename file and remake archive $tmp = \OCP\Files::tmpFolder(); $this->tar->extract($tmp); @@ -180,7 +180,7 @@ class TAR extends Archive { * @param string $path * @return int */ - function filesize($path) { + public function filesize($path) { $stat = $this->getHeader($path); return $stat['size']; } @@ -191,7 +191,7 @@ class TAR extends Archive { * @param string $path * @return int */ - function mtime($path) { + public function mtime($path) { $stat = $this->getHeader($path); return $stat['mtime']; } @@ -202,7 +202,7 @@ class TAR extends Archive { * @param string $path * @return array */ - function getFolder($path) { + public function getFolder($path) { $files = $this->getFiles(); $folderContent = array(); $pathLength = strlen($path); @@ -228,7 +228,7 @@ class TAR extends Archive { * * @return array */ - function getFiles() { + public function getFiles() { if ($this->fileList) { return $this->fileList; } @@ -249,7 +249,7 @@ class TAR extends Archive { * @param string $path * @return string */ - function getFile($path) { + public function getFile($path) { return $this->tar->extractInString($path); } @@ -260,7 +260,7 @@ class TAR extends Archive { * @param string $dest * @return bool */ - function extractFile($path, $dest) { + public function extractFile($path, $dest) { $tmp = \OCP\Files::tmpFolder(); if (!$this->fileExists($path)) { return false; @@ -283,7 +283,7 @@ class TAR extends Archive { * @param string $dest * @return bool */ - function extract($dest) { + public function extract($dest) { return $this->tar->extract($dest); } @@ -293,7 +293,7 @@ class TAR extends Archive { * @param string $path * @return bool */ - function fileExists($path) { + public function fileExists($path) { $files = $this->getFiles(); if ((array_search($path, $files) !== false) or (array_search($path . '/', $files) !== false)) { return true; @@ -322,7 +322,7 @@ class TAR extends Archive { * @param string $path * @return bool */ - function remove($path) { + public function remove($path) { if (!$this->fileExists($path)) { return false; } @@ -346,7 +346,7 @@ class TAR extends Archive { * @param string $mode * @return resource */ - function getStream($path, $mode) { + public function getStream($path, $mode) { if (strrpos($path, '.') !== false) { $ext = substr($path, strrpos($path, '.')); } else { @@ -371,7 +371,7 @@ class TAR extends Archive { /** * write back temporary files */ - function writeBack($tmpFile, $path) { + public function writeBack($tmpFile, $path) { $this->addFile($path, $tmpFile); unlink($tmpFile); } diff --git a/lib/private/Archive/ZIP.php b/lib/private/Archive/ZIP.php index 0ed0f48acc4599375f3b4c92e9a4e87ed0311e04..8d616a7ef9a636fee9f8924e3bb53c49b08fecf9 100644 --- a/lib/private/Archive/ZIP.php +++ b/lib/private/Archive/ZIP.php @@ -43,7 +43,7 @@ class ZIP extends Archive{ /** * @param string $source */ - function __construct($source) { + public function __construct($source) { $this->path=$source; $this->zip=new \ZipArchive(); if($this->zip->open($source, \ZipArchive::CREATE)) { @@ -56,7 +56,7 @@ class ZIP extends Archive{ * @param string $path * @return bool */ - function addFolder($path) { + public function addFolder($path) { return $this->zip->addEmptyDir($path); } /** @@ -65,7 +65,7 @@ class ZIP extends Archive{ * @param string $source either a local file or string data * @return bool */ - function addFile($path, $source='') { + public function addFile($path, $source='') { if($source and $source[0]=='/' and file_exists($source)) { $result=$this->zip->addFile($source, $path); }else{ @@ -83,7 +83,7 @@ class ZIP extends Archive{ * @param string $dest * @return boolean|null */ - function rename($source, $dest) { + public function rename($source, $dest) { $source=$this->stripPath($source); $dest=$this->stripPath($dest); $this->zip->renameName($source, $dest); @@ -93,7 +93,7 @@ class ZIP extends Archive{ * @param string $path * @return int */ - function filesize($path) { + public function filesize($path) { $stat=$this->zip->statName($path); return $stat['size']; } @@ -102,7 +102,7 @@ class ZIP extends Archive{ * @param string $path * @return int */ - function mtime($path) { + public function mtime($path) { return filemtime($this->path); } /** @@ -110,7 +110,7 @@ class ZIP extends Archive{ * @param string $path * @return array */ - function getFolder($path) { + public function getFolder($path) { $files=$this->getFiles(); $folderContent=array(); $pathLength=strlen($path); @@ -127,7 +127,7 @@ class ZIP extends Archive{ * get all files in the archive * @return array */ - function getFiles() { + public function getFiles() { $fileCount=$this->zip->numFiles; $files=array(); for($i=0;$i<$fileCount;$i++) { @@ -140,7 +140,7 @@ class ZIP extends Archive{ * @param string $path * @return string */ - function getFile($path) { + public function getFile($path) { return $this->zip->getFromName($path); } /** @@ -149,7 +149,7 @@ class ZIP extends Archive{ * @param string $dest * @return boolean|null */ - function extractFile($path, $dest) { + public function extractFile($path, $dest) { $fp = $this->zip->getStream($path); file_put_contents($dest, $fp); } @@ -158,7 +158,7 @@ class ZIP extends Archive{ * @param string $dest * @return bool */ - function extract($dest) { + public function extract($dest) { return $this->zip->extractTo($dest); } /** @@ -166,7 +166,7 @@ class ZIP extends Archive{ * @param string $path * @return bool */ - function fileExists($path) { + public function fileExists($path) { return ($this->zip->locateName($path)!==false) or ($this->zip->locateName($path.'/')!==false); } /** @@ -174,7 +174,7 @@ class ZIP extends Archive{ * @param string $path * @return bool */ - function remove($path) { + public function remove($path) { if($this->fileExists($path.'/')) { return $this->zip->deleteName($path.'/'); }else{ @@ -187,7 +187,7 @@ class ZIP extends Archive{ * @param string $mode * @return resource */ - function getStream($path, $mode) { + public function getStream($path, $mode) { if($mode=='r' or $mode=='rb') { return $this->zip->getStream($path); } else { @@ -213,7 +213,7 @@ class ZIP extends Archive{ /** * write back temporary files */ - function writeBack($tmpFile, $path) { + public function writeBack($tmpFile, $path) { $this->addFile($path, $tmpFile); unlink($tmpFile); } diff --git a/lib/private/Authentication/Token/DefaultTokenMapper.php b/lib/private/Authentication/Token/DefaultTokenMapper.php index ff31628ffb0e28faba193f64da2800df0dbf271c..a23be624542fbfa000b6f6273be85c1d52c501ef 100644 --- a/lib/private/Authentication/Token/DefaultTokenMapper.php +++ b/lib/private/Authentication/Token/DefaultTokenMapper.php @@ -82,7 +82,6 @@ class DefaultTokenMapper extends Mapper { if ($data === false) { throw new DoesNotExistException('token does not exist'); } -; return DefaultToken::fromRow($data); } @@ -105,7 +104,7 @@ class DefaultTokenMapper extends Mapper { $result->closeCursor(); if ($data === false) { throw new DoesNotExistException('token does not exist'); - }; + } return DefaultToken::fromRow($data); } diff --git a/lib/private/Command/AsyncBus.php b/lib/private/Command/AsyncBus.php index 3c1f67da0cb32be327f9a18a6541b097bb50c197..fb3cbee7240c1cca2e10efa7c77c8f79ac4b28a1 100644 --- a/lib/private/Command/AsyncBus.php +++ b/lib/private/Command/AsyncBus.php @@ -45,7 +45,7 @@ class AsyncBus implements IBus { /** * @param \OCP\BackgroundJob\IJobList $jobList */ - function __construct($jobList) { + public function __construct($jobList) { $this->jobList = $jobList; } diff --git a/lib/private/Files/ObjectStore/S3.php b/lib/private/Files/ObjectStore/S3.php index 5251b473bdf313f21d928984f32547ff61a590b1..6f37492271ce3aee51b613cce55347a48d40e836 100644 --- a/lib/private/Files/ObjectStore/S3.php +++ b/lib/private/Files/ObjectStore/S3.php @@ -39,7 +39,7 @@ class S3 implements IObjectStore { * @return string the container or bucket name where objects are stored * @since 7.0.0 */ - function getStorageId() { + public function getStorageId() { return $this->id; } @@ -49,7 +49,7 @@ class S3 implements IObjectStore { * @throws \Exception when something goes wrong, message will be logged * @since 7.0.0 */ - function readObject($urn) { + public function readObject($urn) { // Create the command and serialize the request $request = $this->getConnection()->getCommand('GetObject', [ 'Bucket' => $this->bucket, @@ -83,7 +83,7 @@ class S3 implements IObjectStore { * @throws \Exception when something goes wrong, message will be logged * @since 7.0.0 */ - function writeObject($urn, $stream) { + public function writeObject($urn, $stream) { $this->getConnection()->putObject([ 'Bucket' => $this->bucket, 'Key' => $urn, @@ -97,7 +97,7 @@ class S3 implements IObjectStore { * @throws \Exception when something goes wrong, message will be logged * @since 7.0.0 */ - function deleteObject($urn) { + public function deleteObject($urn) { $this->getConnection()->deleteObject([ 'Bucket' => $this->bucket, 'Key' => $urn diff --git a/lib/private/Mail/Mailer.php b/lib/private/Mail/Mailer.php index b24f72316ba7b18e62195201b0bbde5bd6ce1c85..e438f75d2ce2de083c2c54cce7856c61bcbabf09 100644 --- a/lib/private/Mail/Mailer.php +++ b/lib/private/Mail/Mailer.php @@ -120,7 +120,7 @@ class Mailer implements IMailer { public function send(Message $message) { $debugMode = $this->config->getSystemValue('mail_smtpdebug', false); - if (sizeof($message->getFrom()) === 0) { + if (empty($message->getFrom())) { $message->setFrom([\OCP\Util::getDefaultEmailAddress($this->defaults->getName()) => $this->defaults->getName()]); } @@ -186,7 +186,7 @@ class Mailer implements IMailer { switch ($this->config->getSystemValue('mail_smtpmode', 'php')) { case 'smtp': - $this->instance = $this->getSMTPInstance(); + $this->instance = $this->getSmtpInstance(); break; case 'sendmail': // FIXME: Move into the return statement but requires proper testing diff --git a/lib/private/Mail/Message.php b/lib/private/Mail/Message.php index 3184f26848beaa11ce02e215dfb21c74ce9c9fa0..5ffc050360aa1dc05846b19ef7150e3abcce7a92 100644 --- a/lib/private/Mail/Message.php +++ b/lib/private/Mail/Message.php @@ -37,7 +37,7 @@ class Message { /** * @param Swift_Message $swiftMessage */ - function __construct(Swift_Message $swiftMessage) { + public function __construct(Swift_Message $swiftMessage) { $this->swiftMessage = $swiftMessage; } diff --git a/lib/private/Memcache/Memcached.php b/lib/private/Memcache/Memcached.php index bf07fd0e6e717a7e7807c311fc89a5001ae8dcbe..4347fc99e5468b7dfd6b29763a6bf704381679d4 100644 --- a/lib/private/Memcache/Memcached.php +++ b/lib/private/Memcache/Memcached.php @@ -97,7 +97,7 @@ class Memcached extends Cache implements IMemcache { } public function get($key) { - $result = self::$cache->get($this->getNamespace() . $key); + $result = self::$cache->get($this->getNameSpace() . $key); if ($result === false and self::$cache->getResultCode() == \Memcached::RES_NOTFOUND) { return null; } else { @@ -107,9 +107,9 @@ class Memcached extends Cache implements IMemcache { public function set($key, $value, $ttl = 0) { if ($ttl > 0) { - $result = self::$cache->set($this->getNamespace() . $key, $value, $ttl); + $result = self::$cache->set($this->getNameSpace() . $key, $value, $ttl); } else { - $result = self::$cache->set($this->getNamespace() . $key, $value); + $result = self::$cache->set($this->getNameSpace() . $key, $value); } if ($result !== true) { $this->verifyReturnCode(); @@ -118,12 +118,12 @@ class Memcached extends Cache implements IMemcache { } public function hasKey($key) { - self::$cache->get($this->getNamespace() . $key); + self::$cache->get($this->getNameSpace() . $key); return self::$cache->getResultCode() === \Memcached::RES_SUCCESS; } public function remove($key) { - $result= self::$cache->delete($this->getNamespace() . $key); + $result= self::$cache->delete($this->getNameSpace() . $key); if (self::$cache->getResultCode() !== \Memcached::RES_NOTFOUND) { $this->verifyReturnCode(); } @@ -131,7 +131,7 @@ class Memcached extends Cache implements IMemcache { } public function clear($prefix = '') { - $prefix = $this->getNamespace() . $prefix; + $prefix = $this->getNameSpace() . $prefix; $allKeys = self::$cache->getAllKeys(); if ($allKeys === false) { // newer Memcached doesn't like getAllKeys(), flush everything diff --git a/lib/private/Memcache/XCache.php b/lib/private/Memcache/XCache.php index 7eb7a138d1ff9db7dbd89ebc1f9a15344d729c55..549896e6c6bd1ccedf00fc870faaca2c25e7980d 100644 --- a/lib/private/Memcache/XCache.php +++ b/lib/private/Memcache/XCache.php @@ -47,28 +47,28 @@ class XCache extends Cache implements IMemcache { } public function get($key) { - return xcache_get($this->getNamespace() . $key); + return xcache_get($this->getNameSpace() . $key); } public function set($key, $value, $ttl = 0) { if ($ttl > 0) { - return xcache_set($this->getNamespace() . $key, $value, $ttl); + return xcache_set($this->getNameSpace() . $key, $value, $ttl); } else { - return xcache_set($this->getNamespace() . $key, $value); + return xcache_set($this->getNameSpace() . $key, $value); } } public function hasKey($key) { - return xcache_isset($this->getNamespace() . $key); + return xcache_isset($this->getNameSpace() . $key); } public function remove($key) { - return xcache_unset($this->getNamespace() . $key); + return xcache_unset($this->getNameSpace() . $key); } public function clear($prefix = '') { if (function_exists('xcache_unset_by_prefix')) { - return xcache_unset_by_prefix($this->getNamespace() . $prefix); + return xcache_unset_by_prefix($this->getNameSpace() . $prefix); } else { // Since we can not clear by prefix, we just clear the whole cache. xcache_clear_cache(\XC_TYPE_VAR, 0); diff --git a/lib/private/Notification/Manager.php b/lib/private/Notification/Manager.php index c5cad7f2db35a6f14bad842c46795c7a1691df05..1d1391675523073356650dd4939c5c6f8b2d4cdf 100644 --- a/lib/private/Notification/Manager.php +++ b/lib/private/Notification/Manager.php @@ -142,7 +142,7 @@ class Manager implements IManager { $this->notifiersInfo = []; foreach ($this->notifiersInfoClosures as $closure) { $notifier = $closure(); - if (!is_array($notifier) || sizeof($notifier) !== 2 || !isset($notifier['id']) || !isset($notifier['name'])) { + if (!is_array($notifier) || count($notifier) !== 2 || !isset($notifier['id']) || !isset($notifier['name'])) { throw new \InvalidArgumentException('The given notifier information is invalid'); } if (isset($this->notifiersInfo[$notifier['id']])) { diff --git a/lib/private/Preview/Bitmap.php b/lib/private/Preview/Bitmap.php index d3f75b4a2058c842f0cb8c185802a17d708e6a81..e9fd6cc7c03734a2df97b3e33054f98a60bc48fb 100644 --- a/lib/private/Preview/Bitmap.php +++ b/lib/private/Preview/Bitmap.php @@ -48,7 +48,7 @@ abstract class Bitmap extends Provider { try { $bp = $this->getResizedPreview($tmpPath, $maxX, $maxY); } catch (\Exception $e) { - \OCP\Util::writeLog('core', 'ImageMagick says: ' . $e->getmessage(), \OCP\Util::ERROR); + \OCP\Util::writeLog('core', 'ImageMagick says: ' . $e->getMessage(), \OCP\Util::ERROR); return false; } diff --git a/lib/private/Preview/Office.php b/lib/private/Preview/Office.php index 9b445a2bbee94e6c897092ed74da239e8a73f8da..a05ffef9e9ac25a32936af836f4f99554f77f935 100644 --- a/lib/private/Preview/Office.php +++ b/lib/private/Preview/Office.php @@ -59,7 +59,7 @@ abstract class Office extends Provider { } catch (\Exception $e) { unlink($absPath); unlink($pdfPreview); - \OCP\Util::writeLog('core', $e->getmessage(), \OCP\Util::ERROR); + \OCP\Util::writeLog('core', $e->getMessage(), \OCP\Util::ERROR); return false; } diff --git a/lib/private/Preview/SVG.php b/lib/private/Preview/SVG.php index 4ad274c893b10a1052f1fb6f0246f9d0e3eb61c7..fb06faf9c23135cf66e57db3b1ace93c32e16cca 100644 --- a/lib/private/Preview/SVG.php +++ b/lib/private/Preview/SVG.php @@ -53,7 +53,7 @@ class SVG extends Provider { $svg->readImageBlob($content); $svg->setImageFormat('png32'); } catch (\Exception $e) { - \OCP\Util::writeLog('core', $e->getmessage(), \OCP\Util::ERROR); + \OCP\Util::writeLog('core', $e->getMessage(), \OCP\Util::ERROR); return false; } diff --git a/lib/private/Repair/CleanTags.php b/lib/private/Repair/CleanTags.php index d3bea0f995779a9533be611785398a669c9884a9..de46d039229c9ecd201e3c7be778abded120ead9 100644 --- a/lib/private/Repair/CleanTags.php +++ b/lib/private/Repair/CleanTags.php @@ -202,7 +202,7 @@ class CleanTags implements IRepairStep { } if ($repairInfo) { - $output->info(sprintf($repairInfo, sizeof($orphanItems))); + $output->info(sprintf($repairInfo, count($orphanItems))); } } } diff --git a/lib/private/Search/Provider/File.php b/lib/private/Search/Provider/File.php index ddb05c759eaa4b43111b93784938e663b98aaadd..787725ab87b427d4813fa6c6bd979e8224f9a206 100644 --- a/lib/private/Search/Provider/File.php +++ b/lib/private/Search/Provider/File.php @@ -37,7 +37,7 @@ class File extends \OCP\Search\Provider { * @param string $query * @return \OCP\Search\Result */ - function search($query) { + public function search($query) { $files = Filesystem::search($query); $results = array(); // edit results diff --git a/lib/private/Security/Crypto.php b/lib/private/Security/Crypto.php index 176faf68e2d275ef0b8681366a277d942f06d967..1dd680ea13f12a952bf226935042b7f873731c7d 100644 --- a/lib/private/Security/Crypto.php +++ b/lib/private/Security/Crypto.php @@ -56,7 +56,7 @@ class Crypto implements ICrypto { * @param IConfig $config * @param ISecureRandom $random */ - function __construct(IConfig $config, ISecureRandom $random) { + public function __construct(IConfig $config, ISecureRandom $random) { $this->cipher = new AES(); $this->config = $config; $this->random = $random; @@ -115,7 +115,7 @@ class Crypto implements ICrypto { $this->cipher->setPassword($password); $parts = explode('|', $authenticatedCiphertext); - if(sizeof($parts) !== 3) { + if(count($parts) !== 3) { throw new \Exception('Authenticated ciphertext could not be decoded.'); } diff --git a/lib/private/Security/Hasher.php b/lib/private/Security/Hasher.php index 3bc546fa0a23597d62e9b6df47f4d4284defed05..ddba82fec43e59351041ca49aa5b43689971b9bb 100644 --- a/lib/private/Security/Hasher.php +++ b/lib/private/Security/Hasher.php @@ -58,7 +58,7 @@ class Hasher implements IHasher { /** * @param IConfig $config */ - function __construct(IConfig $config) { + public function __construct(IConfig $config) { $this->config = $config; $hashingCost = $this->config->getSystemValue('hashingCost', null); @@ -86,7 +86,7 @@ class Hasher implements IHasher { */ protected function splitHash($prefixedHash) { $explodedString = explode('|', $prefixedHash, 2); - if(sizeof($explodedString) === 2) { + if(count($explodedString) === 2) { if((int)$explodedString[0] > 0) { return array('version' => (int)$explodedString[0], 'hash' => $explodedString[1]); } diff --git a/lib/private/Security/TrustedDomainHelper.php b/lib/private/Security/TrustedDomainHelper.php index a8cbdb6ee6cf9c20b464d6a66c7c7899e0d75be5..221d21fb6a49cab6588569f742a94dcf10e31c9d 100644 --- a/lib/private/Security/TrustedDomainHelper.php +++ b/lib/private/Security/TrustedDomainHelper.php @@ -38,7 +38,7 @@ class TrustedDomainHelper { /** * @param IConfig $config */ - function __construct(IConfig $config) { + public function __construct(IConfig $config) { $this->config = $config; } @@ -89,7 +89,7 @@ class TrustedDomainHelper { if (gettype($trusted) !== 'string') { break; } - $regex = '/^' . join('[-\.a-zA-Z0-9]*', array_map(function($v) { return preg_quote($v, '/'); }, explode('*', $trusted))) . '$/'; + $regex = '/^' . implode('[-\.a-zA-Z0-9]*', array_map(function($v) { return preg_quote($v, '/'); }, explode('*', $trusted))) . '$/'; if (preg_match($regex, $domain) || preg_match($regex, $domainWithPort)) { return true; } diff --git a/lib/private/Share20/DefaultShareProvider.php b/lib/private/Share20/DefaultShareProvider.php index 6f3741f5ae74a0427a21332268bbbb0796fab775..6503e67a8f949ff65bad006ff5af26219e4ebd97 100644 --- a/lib/private/Share20/DefaultShareProvider.php +++ b/lib/private/Share20/DefaultShareProvider.php @@ -860,7 +860,7 @@ class DefaultShareProvider implements IShareProvider { if (isset($data['f_permissions'])) { $entryData = $data; $entryData['permissions'] = $entryData['f_permissions']; - $entryData['parent'] = $entryData['f_parent'];; + $entryData['parent'] = $entryData['f_parent']; $share->setNodeCacheEntry(Cache::cacheEntryFromData($entryData, \OC::$server->getMimeTypeLoader())); } diff --git a/lib/private/SystemTag/SystemTagManager.php b/lib/private/SystemTag/SystemTagManager.php index ab0deba0360984ed1b0c6a709551e00f5eef5d8d..08f9b6bc4afe76510dc0ec62431ff00b99bd29d8 100644 --- a/lib/private/SystemTag/SystemTagManager.php +++ b/lib/private/SystemTag/SystemTagManager.php @@ -408,7 +408,7 @@ class SystemTagManager implements ISystemTagManager { $this->connection->commit(); } catch (\Exception $e) { - $this->connection->rollback(); + $this->connection->rollBack(); throw $e; } } diff --git a/lib/private/SystemTag/SystemTagObjectMapper.php b/lib/private/SystemTag/SystemTagObjectMapper.php index e562a2dfd4b7aca5aa14f85dd016e245cf4d0a06..4a6ffdeddfbd5fbaf1ef325d38f87ab97ee594a1 100644 --- a/lib/private/SystemTag/SystemTagObjectMapper.php +++ b/lib/private/SystemTag/SystemTagObjectMapper.php @@ -112,7 +112,7 @@ class SystemTagObjectMapper implements ISystemTagObjectMapper { ->andWhere($query->expr()->eq('objecttype', $query->createNamedParameter($objectType))); if ($limit) { - if (sizeof($tagIds) !== 1) { + if (count($tagIds) !== 1) { throw new \InvalidArgumentException('Limit is only allowed with a single tag'); } diff --git a/lib/private/TempManager.php b/lib/private/TempManager.php index 4dfcbe7f5230bb69310ac253e737c005dbef1742..dc6dad15d3cfc6a791e719eef4a59714e6b4ee86 100644 --- a/lib/private/TempManager.php +++ b/lib/private/TempManager.php @@ -256,7 +256,7 @@ class TempManager implements ITempManager { // suppress any possible errors caused by is_writable // checks missing or invalid path or characters, wrong permissions etc try { - if (is_writeable($directory)) { + if (is_writable($directory)) { return true; } } catch (\Exception $e) { diff --git a/lib/private/legacy/app.php b/lib/private/legacy/app.php index 463e13da91507065665938adcff420e98f77f219..9f6932b3a89ef237d9e8a30207a1dd7216801ccc 100644 --- a/lib/private/legacy/app.php +++ b/lib/private/legacy/app.php @@ -1244,7 +1244,7 @@ class OC_App { $dependencyAnalyzer = new DependencyAnalyzer(new Platform($config), $l); $missing = $dependencyAnalyzer->analyze($info); if (!empty($missing)) { - $missingMsg = join(PHP_EOL, $missing); + $missingMsg = implode(PHP_EOL, $missing); throw new \Exception( $l->t('App "%s" cannot be installed because the following dependencies are not fulfilled: %s', [$info['name'], $missingMsg]