diff options
Diffstat (limited to 'lib/private')
81 files changed, 272 insertions, 263 deletions
diff --git a/lib/private/App/AppStore/Bundles/Bundle.php b/lib/private/App/AppStore/Bundles/Bundle.php index d6b74ff3b6b..16458121b36 100644 --- a/lib/private/App/AppStore/Bundles/Bundle.php +++ b/lib/private/App/AppStore/Bundles/Bundle.php @@ -41,7 +41,7 @@ abstract class Bundle { * * @return string */ - public final function getIdentifier() { + final public function getIdentifier() { return substr(strrchr(get_class($this), '\\'), 1); } @@ -50,12 +50,12 @@ abstract class Bundle { * * @return string */ - public abstract function getName(); + abstract public function getName(); /** * Get the list of app identifiers in the bundle * * @return array */ - public abstract function getAppIdentifiers(); + abstract public function getAppIdentifiers(); } diff --git a/lib/private/App/AppStore/Fetcher/Fetcher.php b/lib/private/App/AppStore/Fetcher/Fetcher.php index fd0600a3ce4..a54d149df62 100644 --- a/lib/private/App/AppStore/Fetcher/Fetcher.php +++ b/lib/private/App/AppStore/Fetcher/Fetcher.php @@ -40,7 +40,7 @@ use OCP\IConfig; use OCP\ILogger; abstract class Fetcher { - const INVALIDATE_AFTER_SECONDS = 300; + public const INVALIDATE_AFTER_SECONDS = 300; /** @var IAppData */ protected $appData; diff --git a/lib/private/App/CodeChecker/CodeChecker.php b/lib/private/App/CodeChecker/CodeChecker.php index aa8f43e6af2..01969006af4 100644 --- a/lib/private/App/CodeChecker/CodeChecker.php +++ b/lib/private/App/CodeChecker/CodeChecker.php @@ -37,14 +37,14 @@ use RegexIterator; use SplFileInfo; class CodeChecker extends BasicEmitter { - const CLASS_EXTENDS_NOT_ALLOWED = 1000; - const CLASS_IMPLEMENTS_NOT_ALLOWED = 1001; - const STATIC_CALL_NOT_ALLOWED = 1002; - const CLASS_CONST_FETCH_NOT_ALLOWED = 1003; - const CLASS_NEW_NOT_ALLOWED = 1004; - const OP_OPERATOR_USAGE_DISCOURAGED = 1005; - const CLASS_USE_NOT_ALLOWED = 1006; - const CLASS_METHOD_CALL_NOT_ALLOWED = 1007; + public const CLASS_EXTENDS_NOT_ALLOWED = 1000; + public const CLASS_IMPLEMENTS_NOT_ALLOWED = 1001; + public const STATIC_CALL_NOT_ALLOWED = 1002; + public const CLASS_CONST_FETCH_NOT_ALLOWED = 1003; + public const CLASS_NEW_NOT_ALLOWED = 1004; + public const OP_OPERATOR_USAGE_DISCOURAGED = 1005; + public const CLASS_USE_NOT_ALLOWED = 1006; + public const CLASS_METHOD_CALL_NOT_ALLOWED = 1007; /** @var Parser */ private $parser; diff --git a/lib/private/App/CompareVersion.php b/lib/private/App/CompareVersion.php index 12cd7615769..5d38d4c358e 100644 --- a/lib/private/App/CompareVersion.php +++ b/lib/private/App/CompareVersion.php @@ -26,10 +26,10 @@ namespace OC\App; use InvalidArgumentException; class CompareVersion { - const REGEX_MAJOR = '/^\d+$/'; - const REGEX_MAJOR_MINOR = '/^\d+.\d+$/'; - const REGEX_MAJOR_MINOR_PATCH = '/^\d+.\d+.\d+$/'; - const REGEX_SERVER = '/^\d+.\d+.\d+(.\d+)?$/'; + public const REGEX_MAJOR = '/^\d+$/'; + public const REGEX_MAJOR_MINOR = '/^\d+.\d+$/'; + public const REGEX_MAJOR_MINOR_PATCH = '/^\d+.\d+.\d+$/'; + public const REGEX_SERVER = '/^\d+.\d+.\d+(.\d+)?$/'; /** * Checks if the given server version fulfills the given (app) version requirements. diff --git a/lib/private/App/Platform.php b/lib/private/App/Platform.php index 45b00c20219..f03e241e9a0 100644 --- a/lib/private/App/Platform.php +++ b/lib/private/App/Platform.php @@ -38,7 +38,7 @@ class Platform { /** * @param IConfig $config */ - function __construct(IConfig $config) { + public function __construct(IConfig $config) { $this->config = $config; } diff --git a/lib/private/AppFramework/Http/Request.php b/lib/private/AppFramework/Http/Request.php index 1dcec3c3b98..2ef7b4a0995 100644 --- a/lib/private/AppFramework/Http/Request.php +++ b/lib/private/AppFramework/Http/Request.php @@ -64,32 +64,32 @@ use OCP\Security\ISecureRandom; * @property mixed[] server */ class Request implements \ArrayAccess, \Countable, IRequest { - const USER_AGENT_IE = '/(MSIE)|(Trident)/'; + public const USER_AGENT_IE = '/(MSIE)|(Trident)/'; // Microsoft Edge User Agent from https://msdn.microsoft.com/en-us/library/hh869301(v=vs.85).aspx - const USER_AGENT_MS_EDGE = '/^Mozilla\/5\.0 \([^)]+\) AppleWebKit\/[0-9.]+ \(KHTML, like Gecko\) Chrome\/[0-9.]+ (Mobile Safari|Safari)\/[0-9.]+ Edge\/[0-9.]+$/'; + public const USER_AGENT_MS_EDGE = '/^Mozilla\/5\.0 \([^)]+\) AppleWebKit\/[0-9.]+ \(KHTML, like Gecko\) Chrome\/[0-9.]+ (Mobile Safari|Safari)\/[0-9.]+ Edge\/[0-9.]+$/'; // Firefox User Agent from https://developer.mozilla.org/en-US/docs/Web/HTTP/Gecko_user_agent_string_reference - const USER_AGENT_FIREFOX = '/^Mozilla\/5\.0 \([^)]+\) Gecko\/[0-9.]+ Firefox\/[0-9.]+$/'; + public const USER_AGENT_FIREFOX = '/^Mozilla\/5\.0 \([^)]+\) Gecko\/[0-9.]+ Firefox\/[0-9.]+$/'; // Chrome User Agent from https://developer.chrome.com/multidevice/user-agent - const USER_AGENT_CHROME = '/^Mozilla\/5\.0 \([^)]+\) AppleWebKit\/[0-9.]+ \(KHTML, like Gecko\)( Ubuntu Chromium\/[0-9.]+|) Chrome\/[0-9.]+ (Mobile Safari|Safari)\/[0-9.]+( (Vivaldi|Brave|OPR)\/[0-9.]+|)$/'; + public const USER_AGENT_CHROME = '/^Mozilla\/5\.0 \([^)]+\) AppleWebKit\/[0-9.]+ \(KHTML, like Gecko\)( Ubuntu Chromium\/[0-9.]+|) Chrome\/[0-9.]+ (Mobile Safari|Safari)\/[0-9.]+( (Vivaldi|Brave|OPR)\/[0-9.]+|)$/'; // Safari User Agent from http://www.useragentstring.com/pages/Safari/ - const USER_AGENT_SAFARI = '/^Mozilla\/5\.0 \([^)]+\) AppleWebKit\/[0-9.]+ \(KHTML, like Gecko\) Version\/[0-9.]+ Safari\/[0-9.A-Z]+$/'; + public const USER_AGENT_SAFARI = '/^Mozilla\/5\.0 \([^)]+\) AppleWebKit\/[0-9.]+ \(KHTML, like Gecko\) Version\/[0-9.]+ Safari\/[0-9.A-Z]+$/'; // Android Chrome user agent: https://developers.google.com/chrome/mobile/docs/user-agent - const USER_AGENT_ANDROID_MOBILE_CHROME = '#Android.*Chrome/[.0-9]*#'; - const USER_AGENT_FREEBOX = '#^Mozilla/5\.0$#'; - const REGEX_LOCALHOST = '/^(127\.0\.0\.1|localhost|::1)$/'; + public const USER_AGENT_ANDROID_MOBILE_CHROME = '#Android.*Chrome/[.0-9]*#'; + public const USER_AGENT_FREEBOX = '#^Mozilla/5\.0$#'; + public const REGEX_LOCALHOST = '/^(127\.0\.0\.1|localhost|::1)$/'; /** * @deprecated use \OCP\IRequest::USER_AGENT_CLIENT_IOS instead */ - const USER_AGENT_OWNCLOUD_IOS = '/^Mozilla\/5\.0 \(iOS\) (ownCloud|Nextcloud)\-iOS.*$/'; + public const USER_AGENT_OWNCLOUD_IOS = '/^Mozilla\/5\.0 \(iOS\) (ownCloud|Nextcloud)\-iOS.*$/'; /** * @deprecated use \OCP\IRequest::USER_AGENT_CLIENT_ANDROID instead */ - const USER_AGENT_OWNCLOUD_ANDROID = '/^Mozilla\/5\.0 \(Android\) ownCloud\-android.*$/'; + public const USER_AGENT_OWNCLOUD_ANDROID = '/^Mozilla\/5\.0 \(Android\) ownCloud\-android.*$/'; /** * @deprecated use \OCP\IRequest::USER_AGENT_CLIENT_DESKTOP instead */ - const USER_AGENT_OWNCLOUD_DESKTOP = '/^Mozilla\/5\.0 \([A-Za-z ]+\) (mirall|csyncoC)\/.*$/'; + public const USER_AGENT_OWNCLOUD_DESKTOP = '/^Mozilla\/5\.0 \([A-Za-z ]+\) (mirall|csyncoC)\/.*$/'; protected $inputStream; protected $content; @@ -282,7 +282,7 @@ class Request implements \ArrayAccess, \Countable, IRequest { case 'parameters': case 'params': return $this->getContent(); - default; + default: return isset($this[$name]) ? $this[$name] : null; diff --git a/lib/private/Archive/Archive.php b/lib/private/Archive/Archive.php index 5150e6ddee3..43b44e5a23a 100644 --- a/lib/private/Archive/Archive.php +++ b/lib/private/Archive/Archive.php @@ -34,88 +34,88 @@ abstract class Archive { /** * @param $source */ - public abstract function __construct($source); + abstract public function __construct($source); /** * add an empty folder to the archive * @param string $path * @return bool */ - public abstract function addFolder($path); + abstract public function addFolder($path); /** * add a file to the archive * @param string $path * @param string $source either a local file or string data * @return bool */ - public abstract function addFile($path, $source=''); + abstract public function addFile($path, $source=''); /** * rename a file or folder in the archive * @param string $source * @param string $dest * @return bool */ - public abstract function rename($source, $dest); + abstract public function rename($source, $dest); /** * get the uncompressed size of a file in the archive * @param string $path * @return int */ - public abstract function filesize($path); + abstract public function filesize($path); /** * get the last modified time of a file in the archive * @param string $path * @return int */ - public abstract function mtime($path); + abstract public function mtime($path); /** * get the files in a folder * @param string $path * @return array */ - public abstract function getFolder($path); + abstract public function getFolder($path); /** * get all files in the archive * @return array */ - public abstract function getFiles(); + abstract public function getFiles(); /** * get the content of a file * @param string $path * @return string */ - public abstract function getFile($path); + abstract public function getFile($path); /** * extract a single file from the archive * @param string $path * @param string $dest * @return bool */ - public abstract function extractFile($path, $dest); + abstract public function extractFile($path, $dest); /** * extract the archive * @param string $dest * @return bool */ - public abstract function extract($dest); + abstract public function extract($dest); /** * check if a file or folder exists in the archive * @param string $path * @return bool */ - public abstract function fileExists($path); + abstract public function fileExists($path); /** * remove a file or folder from the archive * @param string $path * @return bool */ - public abstract function remove($path); + abstract public function remove($path); /** * get a file handler * @param string $path * @param string $mode * @return resource */ - public abstract function getStream($path, $mode); + abstract public function getStream($path, $mode); /** * add a folder and all its content * @param string $path diff --git a/lib/private/Archive/TAR.php b/lib/private/Archive/TAR.php index d90e21305c3..0d4103299ce 100644 --- a/lib/private/Archive/TAR.php +++ b/lib/private/Archive/TAR.php @@ -35,9 +35,9 @@ namespace OC\Archive; use Icewind\Streams\CallbackWrapper; class TAR extends Archive { - const PLAIN = 0; - const GZIP = 1; - const BZIP = 2; + public const PLAIN = 0; + public const GZIP = 1; + public const BZIP = 2; private $fileList; private $cachedHeaders; @@ -63,7 +63,7 @@ class TAR extends Archive { * @param string $file * @return integer */ - static public function getTarType($file) { + public static function getTarType($file) { if (strpos($file, '.')) { $extension = substr($file, strrpos($file, '.')); switch ($extension) { diff --git a/lib/private/Authentication/Login/ALoginCommand.php b/lib/private/Authentication/Login/ALoginCommand.php index 8ad162842bf..effc9adf1c0 100644 --- a/lib/private/Authentication/Login/ALoginCommand.php +++ b/lib/private/Authentication/Login/ALoginCommand.php @@ -43,5 +43,5 @@ abstract class ALoginCommand { } } - public abstract function process(LoginData $loginData): LoginResult; + abstract public function process(LoginData $loginData): LoginResult; } diff --git a/lib/private/Authentication/Token/DefaultToken.php b/lib/private/Authentication/Token/DefaultToken.php index 7ca05849635..9df907dfb4a 100644 --- a/lib/private/Authentication/Token/DefaultToken.php +++ b/lib/private/Authentication/Token/DefaultToken.php @@ -43,7 +43,7 @@ use OCP\AppFramework\Db\Entity; * @method void setVersion(int $version) */ class DefaultToken extends Entity implements INamedToken { - const VERSION = 1; + public const VERSION = 1; /** @var string user UID */ protected $uid; diff --git a/lib/private/Authentication/Token/IToken.php b/lib/private/Authentication/Token/IToken.php index 1f7c736f86b..326e9554b8e 100644 --- a/lib/private/Authentication/Token/IToken.php +++ b/lib/private/Authentication/Token/IToken.php @@ -30,11 +30,11 @@ namespace OC\Authentication\Token; use JsonSerializable; interface IToken extends JsonSerializable { - const TEMPORARY_TOKEN = 0; - const PERMANENT_TOKEN = 1; - const WIPE_TOKEN = 2; - const DO_NOT_REMEMBER = 0; - const REMEMBER = 1; + public const TEMPORARY_TOKEN = 0; + public const PERMANENT_TOKEN = 1; + public const WIPE_TOKEN = 2; + public const DO_NOT_REMEMBER = 0; + public const REMEMBER = 1; /** * Get the token ID diff --git a/lib/private/Authentication/Token/PublicKeyToken.php b/lib/private/Authentication/Token/PublicKeyToken.php index 27eda0b6889..0724eabc70c 100644 --- a/lib/private/Authentication/Token/PublicKeyToken.php +++ b/lib/private/Authentication/Token/PublicKeyToken.php @@ -47,7 +47,7 @@ use OCP\AppFramework\Db\Entity; * @method bool getPasswordInvalid() */ class PublicKeyToken extends Entity implements INamedToken, IWipeableToken { - const VERSION = 2; + public const VERSION = 2; /** @var string user UID */ protected $uid; diff --git a/lib/private/Authentication/TwoFactorAuth/Db/ProviderUserAssignmentDao.php b/lib/private/Authentication/TwoFactorAuth/Db/ProviderUserAssignmentDao.php index a5ddad47e01..02e6863d1c4 100644 --- a/lib/private/Authentication/TwoFactorAuth/Db/ProviderUserAssignmentDao.php +++ b/lib/private/Authentication/TwoFactorAuth/Db/ProviderUserAssignmentDao.php @@ -35,7 +35,7 @@ use OCP\IDBConnection; * 2FA providers */ class ProviderUserAssignmentDao { - const TABLE_NAME = 'twofactor_providers'; + public const TABLE_NAME = 'twofactor_providers'; /** @var IDBConnection */ private $conn; diff --git a/lib/private/Authentication/TwoFactorAuth/Manager.php b/lib/private/Authentication/TwoFactorAuth/Manager.php index ec414e67938..07e61175361 100644 --- a/lib/private/Authentication/TwoFactorAuth/Manager.php +++ b/lib/private/Authentication/TwoFactorAuth/Manager.php @@ -46,10 +46,10 @@ use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Symfony\Component\EventDispatcher\GenericEvent; class Manager { - const SESSION_UID_KEY = 'two_factor_auth_uid'; - const SESSION_UID_DONE = 'two_factor_auth_passed'; - const REMEMBER_LOGIN = 'two_factor_remember_login'; - const BACKUP_CODES_PROVIDER_ID = 'backup_codes'; + public const SESSION_UID_KEY = 'two_factor_auth_uid'; + public const SESSION_UID_DONE = 'two_factor_auth_passed'; + public const REMEMBER_LOGIN = 'two_factor_remember_login'; + public const BACKUP_CODES_PROVIDER_ID = 'backup_codes'; /** @var ProviderLoader */ private $providerLoader; diff --git a/lib/private/Authentication/TwoFactorAuth/ProviderLoader.php b/lib/private/Authentication/TwoFactorAuth/ProviderLoader.php index 0754679adf1..40385d737ae 100644 --- a/lib/private/Authentication/TwoFactorAuth/ProviderLoader.php +++ b/lib/private/Authentication/TwoFactorAuth/ProviderLoader.php @@ -35,7 +35,7 @@ use OCP\Authentication\TwoFactorAuth\IProvider; use OCP\IUser; class ProviderLoader { - const BACKUP_CODES_APP_ID = 'twofactor_backupcodes'; + public const BACKUP_CODES_APP_ID = 'twofactor_backupcodes'; /** @var IAppManager */ private $appManager; diff --git a/lib/private/Authentication/WebAuthn/Db/PublicKeyCredentialEntity.php b/lib/private/Authentication/WebAuthn/Db/PublicKeyCredentialEntity.php index c9ebf8ce456..2a4740bef4b 100644 --- a/lib/private/Authentication/WebAuthn/Db/PublicKeyCredentialEntity.php +++ b/lib/private/Authentication/WebAuthn/Db/PublicKeyCredentialEntity.php @@ -62,7 +62,7 @@ class PublicKeyCredentialEntity extends Entity implements JsonSerializable { $this->addType('data', 'string'); } - static function fromPublicKeyCrendentialSource(string $name, PublicKeyCredentialSource $publicKeyCredentialSource): PublicKeyCredentialEntity { + public static function fromPublicKeyCrendentialSource(string $name, PublicKeyCredentialSource $publicKeyCredentialSource): PublicKeyCredentialEntity { $publicKeyCredentialEntity = new self(); $publicKeyCredentialEntity->setName($name); @@ -73,7 +73,7 @@ class PublicKeyCredentialEntity extends Entity implements JsonSerializable { return $publicKeyCredentialEntity; } - function toPublicKeyCredentialSource(): PublicKeyCredentialSource { + public function toPublicKeyCredentialSource(): PublicKeyCredentialSource { return PublicKeyCredentialSource::createFromArray( json_decode($this->getData(), true) ); diff --git a/lib/private/Config.php b/lib/private/Config.php index 1724222f4bb..d44f713f361 100644 --- a/lib/private/Config.php +++ b/lib/private/Config.php @@ -42,7 +42,7 @@ namespace OC; * configuration file of Nextcloud. */ class Config { - const ENV_PREFIX = 'NC_'; + public const ENV_PREFIX = 'NC_'; /** @var array Associative array ($key => $value) */ protected $cache = []; diff --git a/lib/private/DB/AdapterOCI8.php b/lib/private/DB/AdapterOCI8.php index 3eb50916aab..33a30b8348d 100644 --- a/lib/private/DB/AdapterOCI8.php +++ b/lib/private/DB/AdapterOCI8.php @@ -37,7 +37,7 @@ class AdapterOCI8 extends Adapter { return $this->conn->realLastInsertId($table); } - const UNIX_TIMESTAMP_REPLACEMENT = "(cast(sys_extract_utc(systimestamp) as date) - date'1970-01-01') * 86400"; + public const UNIX_TIMESTAMP_REPLACEMENT = "(cast(sys_extract_utc(systimestamp) as date) - date'1970-01-01') * 86400"; public function fixupStatement($statement) { $statement = preg_replace('/`(\w+)` ILIKE \?/', 'REGEXP_LIKE(`$1`, \'^\' || REPLACE(?, \'%\', \'.*\') || \'$\', \'i\')', $statement); diff --git a/lib/private/DB/AdapterPgSql.php b/lib/private/DB/AdapterPgSql.php index 7457ab9a77d..bc7fa7698ee 100644 --- a/lib/private/DB/AdapterPgSql.php +++ b/lib/private/DB/AdapterPgSql.php @@ -33,7 +33,7 @@ class AdapterPgSql extends Adapter { return $this->conn->fetchColumn('SELECT lastval()'); } - const UNIX_TIMESTAMP_REPLACEMENT = 'cast(extract(epoch from current_timestamp) as integer)'; + public const UNIX_TIMESTAMP_REPLACEMENT = 'cast(extract(epoch from current_timestamp) as integer)'; public function fixupStatement($statement) { $statement = str_replace('`', '"', $statement); $statement = str_ireplace('UNIX_TIMESTAMP()', self::UNIX_TIMESTAMP_REPLACEMENT, $statement); diff --git a/lib/private/DB/ConnectionFactory.php b/lib/private/DB/ConnectionFactory.php index fe97048aaac..441e4567dbd 100644 --- a/lib/private/DB/ConnectionFactory.php +++ b/lib/private/DB/ConnectionFactory.php @@ -41,10 +41,10 @@ use OC\SystemConfig; */ class ConnectionFactory { /** @var string default database name */ - const DEFAULT_DBNAME = 'owncloud'; + public const DEFAULT_DBNAME = 'owncloud'; /** @var string default database table prefix */ - const DEFAULT_DBTABLEPREFIX = 'oc_'; + public const DEFAULT_DBTABLEPREFIX = 'oc_'; /** * @var array diff --git a/lib/private/DB/MDB2SchemaWriter.php b/lib/private/DB/MDB2SchemaWriter.php index 3cabff9d8f1..4af68709387 100644 --- a/lib/private/DB/MDB2SchemaWriter.php +++ b/lib/private/DB/MDB2SchemaWriter.php @@ -36,7 +36,7 @@ class MDB2SchemaWriter { * @param \OC\DB\Connection $conn * @return bool */ - static public function saveSchemaToFile($file, \OC\DB\Connection $conn) { + public static function saveSchemaToFile($file, \OC\DB\Connection $conn) { $config = \OC::$server->getConfig(); $xml = new \SimpleXMLElement('<database/>'); diff --git a/lib/private/DB/ReconnectWrapper.php b/lib/private/DB/ReconnectWrapper.php index ebb4c56fc6a..df3a0518e35 100644 --- a/lib/private/DB/ReconnectWrapper.php +++ b/lib/private/DB/ReconnectWrapper.php @@ -28,7 +28,7 @@ use Doctrine\DBAL\Configuration; use Doctrine\DBAL\Driver; class ReconnectWrapper extends \Doctrine\DBAL\Connection { - const CHECK_CONNECTION_INTERVAL = 60; + public const CHECK_CONNECTION_INTERVAL = 60; private $lastConnectionCheck = null; diff --git a/lib/private/Encryption/Keys/Storage.php b/lib/private/Encryption/Keys/Storage.php index 2030f26f8f5..38cbfbfdd9f 100644 --- a/lib/private/Encryption/Keys/Storage.php +++ b/lib/private/Encryption/Keys/Storage.php @@ -36,7 +36,7 @@ use OCP\Encryption\Keys\IStorage; class Storage implements IStorage { // hidden file which indicate that the folder is a valid key storage - const KEY_STORAGE_MARKER = '.oc_key_storage'; + public const KEY_STORAGE_MARKER = '.oc_key_storage'; /** @var View */ private $view; diff --git a/lib/private/Encryption/Util.php b/lib/private/Encryption/Util.php index a5414a66796..8b3360c30e0 100644 --- a/lib/private/Encryption/Util.php +++ b/lib/private/Encryption/Util.php @@ -38,11 +38,11 @@ use OCP\IConfig; use OCP\IUser; class Util { - const HEADER_START = 'HBEGIN'; - const HEADER_END = 'HEND'; - const HEADER_PADDING_CHAR = '-'; + public const HEADER_START = 'HBEGIN'; + public const HEADER_END = 'HEND'; + public const HEADER_PADDING_CHAR = '-'; - const HEADER_ENCRYPTION_MODULE_KEY = 'oc_encryption_module'; + public const HEADER_ENCRYPTION_MODULE_KEY = 'oc_encryption_module'; /** * block size will always be 8192 for a PHP stream diff --git a/lib/private/Files/Cache/Cache.php b/lib/private/Files/Cache/Cache.php index 2dfefeff662..78749da0cac 100644 --- a/lib/private/Files/Cache/Cache.php +++ b/lib/private/Files/Cache/Cache.php @@ -963,7 +963,7 @@ class Cache implements ICache { * @return array first element holding the storage id, second the path * @deprecated use getPathById() instead */ - static public function getById($id) { + public static function getById($id) { $query = \OC::$server->getDatabaseConnection()->getQueryBuilder(); $query->select('path', 'storage') ->from('filecache') diff --git a/lib/private/Files/Cache/QuerySearchHelper.php b/lib/private/Files/Cache/QuerySearchHelper.php index 9f2d7aadd7e..e1ecad50733 100644 --- a/lib/private/Files/Cache/QuerySearchHelper.php +++ b/lib/private/Files/Cache/QuerySearchHelper.php @@ -36,7 +36,7 @@ use OCP\Files\Search\ISearchOrder; * Tools for transforming search queries into database queries */ class QuerySearchHelper { - static protected $searchOperatorMap = [ + protected static $searchOperatorMap = [ ISearchComparison::COMPARE_LIKE => 'iLike', ISearchComparison::COMPARE_EQUAL => 'eq', ISearchComparison::COMPARE_GREATER_THAN => 'gt', @@ -45,7 +45,7 @@ class QuerySearchHelper { ISearchComparison::COMPARE_LESS_THAN_EQUAL => 'lte' ]; - static protected $searchOperatorNegativeMap = [ + protected static $searchOperatorNegativeMap = [ ISearchComparison::COMPARE_LIKE => 'notLike', ISearchComparison::COMPARE_EQUAL => 'neq', ISearchComparison::COMPARE_GREATER_THAN => 'lte', @@ -54,7 +54,7 @@ class QuerySearchHelper { ISearchComparison::COMPARE_LESS_THAN_EQUAL => 'lt' ]; - const TAG_FAVORITE = '_$!<Favorite>!$_'; + public const TAG_FAVORITE = '_$!<Favorite>!$_'; /** @var IMimeTypeLoader */ private $mimetypeLoader; @@ -110,6 +110,7 @@ class QuerySearchHelper { } else { throw new \InvalidArgumentException('Binary operators inside "not" is not supported'); } + // no break case ISearchBinaryOperator::OPERATOR_AND: return call_user_func_array([$expr, 'andX'], $this->searchOperatorArrayToDBExprArray($builder, $operator->getArguments())); case ISearchBinaryOperator::OPERATOR_OR: diff --git a/lib/private/Files/Cache/Wrapper/CacheWrapper.php b/lib/private/Files/Cache/Wrapper/CacheWrapper.php index 302758bbc22..4901a530799 100644 --- a/lib/private/Files/Cache/Wrapper/CacheWrapper.php +++ b/lib/private/Files/Cache/Wrapper/CacheWrapper.php @@ -319,7 +319,7 @@ class CacheWrapper extends Cache { * @param int $id * @return array first element holding the storage id, second the path */ - static public function getById($id) { + public static function getById($id) { return parent::getById($id); } } diff --git a/lib/private/Files/Filesystem.php b/lib/private/Files/Filesystem.php index 1999edf67fd..d3c4e1afc62 100644 --- a/lib/private/Files/Filesystem.php +++ b/lib/private/Files/Filesystem.php @@ -80,19 +80,19 @@ class Filesystem { /** * @var \OC\Files\View $defaultInstance */ - static private $defaultInstance; + private static $defaultInstance; - static private $usersSetup = []; + private static $usersSetup = []; - static private $normalizedPathCache = null; + private static $normalizedPathCache = null; - static private $listeningForProviders = false; + private static $listeningForProviders = false; /** * classname which used for hooks handling * used as signalclass in OC_Hooks::emit() */ - const CLASSNAME = 'OC_Filesystem'; + public const CLASSNAME = 'OC_Filesystem'; /** * signalname emitted before file renaming @@ -100,7 +100,7 @@ class Filesystem { * @param string $oldpath * @param string $newpath */ - const signal_rename = 'rename'; + public const signal_rename = 'rename'; /** * signal emitted after file renaming @@ -108,7 +108,7 @@ class Filesystem { * @param string $oldpath * @param string $newpath */ - const signal_post_rename = 'post_rename'; + public const signal_post_rename = 'post_rename'; /** * signal emitted before file/dir creation @@ -116,7 +116,7 @@ class Filesystem { * @param string $path * @param bool $run changing this flag to false in hook handler will cancel event */ - const signal_create = 'create'; + public const signal_create = 'create'; /** * signal emitted after file/dir creation @@ -124,7 +124,7 @@ class Filesystem { * @param string $path * @param bool $run changing this flag to false in hook handler will cancel event */ - const signal_post_create = 'post_create'; + public const signal_post_create = 'post_create'; /** * signal emits before file/dir copy @@ -133,7 +133,7 @@ class Filesystem { * @param string $newpath * @param bool $run changing this flag to false in hook handler will cancel event */ - const signal_copy = 'copy'; + public const signal_copy = 'copy'; /** * signal emits after file/dir copy @@ -141,7 +141,7 @@ class Filesystem { * @param string $oldpath * @param string $newpath */ - const signal_post_copy = 'post_copy'; + public const signal_post_copy = 'post_copy'; /** * signal emits before file/dir save @@ -149,14 +149,14 @@ class Filesystem { * @param string $path * @param bool $run changing this flag to false in hook handler will cancel event */ - const signal_write = 'write'; + public const signal_write = 'write'; /** * signal emits after file/dir save * * @param string $path */ - const signal_post_write = 'post_write'; + public const signal_post_write = 'post_write'; /** * signal emitted before file/dir update @@ -164,7 +164,7 @@ class Filesystem { * @param string $path * @param bool $run changing this flag to false in hook handler will cancel event */ - const signal_update = 'update'; + public const signal_update = 'update'; /** * signal emitted after file/dir update @@ -172,38 +172,38 @@ class Filesystem { * @param string $path * @param bool $run changing this flag to false in hook handler will cancel event */ - const signal_post_update = 'post_update'; + public const signal_post_update = 'post_update'; /** * signal emits when reading file/dir * * @param string $path */ - const signal_read = 'read'; + public const signal_read = 'read'; /** * signal emits when removing file/dir * * @param string $path */ - const signal_delete = 'delete'; + public const signal_delete = 'delete'; /** * parameters definitions for signals */ - const signal_param_path = 'path'; - const signal_param_oldpath = 'oldpath'; - const signal_param_newpath = 'newpath'; + public const signal_param_path = 'path'; + public const signal_param_oldpath = 'oldpath'; + public const signal_param_newpath = 'newpath'; /** * run - changing this flag to false in hook handler will cancel event */ - const signal_param_run = 'run'; + public const signal_param_run = 'run'; - const signal_create_mount = 'create_mount'; - const signal_delete_mount = 'delete_mount'; - const signal_param_mount_type = 'mounttype'; - const signal_param_users = 'users'; + public const signal_create_mount = 'create_mount'; + public const signal_delete_mount = 'delete_mount'; + public const signal_param_mount_type = 'mounttype'; + public const signal_param_users = 'users'; /** * @var \OC\Files\Storage\StorageFactory $loader @@ -277,7 +277,7 @@ class Filesystem { * @param string $path * @return string */ - static public function getMountPoint($path) { + public static function getMountPoint($path) { if (!self::$mounts) { \OC_Util::setupFS(); } @@ -295,7 +295,7 @@ class Filesystem { * @param string $path * @return string[] */ - static public function getMountPoints($path) { + public static function getMountPoints($path) { if (!self::$mounts) { \OC_Util::setupFS(); } @@ -349,7 +349,7 @@ class Filesystem { * @param string $path * @return array an array consisting of the storage and the internal path */ - static public function resolvePath($path) { + public static function resolvePath($path) { if (!self::$mounts) { \OC_Util::setupFS(); } @@ -361,7 +361,7 @@ class Filesystem { } } - static public function init($user, $root) { + public static function init($user, $root) { if (self::$defaultInstance) { return false; } @@ -380,7 +380,7 @@ class Filesystem { return true; } - static public function initMountManager() { + public static function initMountManager() { if (!self::$mounts) { self::$mounts = \OC::$server->getMountManager(); } @@ -489,14 +489,14 @@ class Filesystem { * * @return View */ - static public function getView() { + public static function getView() { return self::$defaultInstance; } /** * tear down the filesystem, removing all storage providers */ - static public function tearDown() { + public static function tearDown() { self::clearMounts(); self::$defaultInstance = null; } @@ -508,7 +508,7 @@ class Filesystem { * * Returns path like /admin/files */ - static public function getRoot() { + public static function getRoot() { if (!self::$defaultInstance) { return null; } @@ -532,7 +532,7 @@ class Filesystem { * @param array $arguments * @param string $mountpoint */ - static public function mount($class, $arguments, $mountpoint) { + public static function mount($class, $arguments, $mountpoint) { if (!self::$mounts) { \OC_Util::setupFS(); } @@ -548,7 +548,7 @@ class Filesystem { * @param string $path * @return string */ - static public function getLocalFile($path) { + public static function getLocalFile($path) { return self::$defaultInstance->getLocalFile($path); } @@ -556,7 +556,7 @@ class Filesystem { * @param string $path * @return string */ - static public function getLocalFolder($path) { + public static function getLocalFolder($path) { return self::$defaultInstance->getLocalFolder($path); } @@ -566,7 +566,7 @@ class Filesystem { * @param string $path * @return string */ - static public function getLocalPath($path) { + public static function getLocalPath($path) { $datadir = \OC_User::getHome(\OC_User::getUser()) . '/files'; $newpath = $path; if (strncmp($newpath, $datadir, strlen($datadir)) == 0) { @@ -581,7 +581,7 @@ class Filesystem { * @param string $path * @return bool */ - static public function isValidPath($path) { + public static function isValidPath($path) { $path = self::normalizePath($path); if (!$path || $path[0] !== '/') { $path = '/' . $path; @@ -598,7 +598,7 @@ class Filesystem { * * @param array $data from hook */ - static public function isBlacklisted($data) { + public static function isBlacklisted($data) { if (isset($data['path'])) { $path = $data['path']; } elseif (isset($data['newpath'])) { @@ -615,7 +615,7 @@ class Filesystem { * @param string $filename * @return bool */ - static public function isFileBlacklisted($filename) { + public static function isFileBlacklisted($filename) { $filename = self::normalizePath($filename); $blacklist = \OC::$server->getConfig()->getSystemValue('blacklisted_files', ['.htaccess']); @@ -630,7 +630,7 @@ class Filesystem { * @param string $dir * @return boolean */ - static public function isIgnoredDir($dir) { + public static function isIgnoredDir($dir) { if ($dir === '.' || $dir === '..') { return true; } @@ -640,128 +640,128 @@ class Filesystem { /** * following functions are equivalent to their php builtin equivalents for arguments/return values. */ - static public function mkdir($path) { + public static function mkdir($path) { return self::$defaultInstance->mkdir($path); } - static public function rmdir($path) { + public static function rmdir($path) { return self::$defaultInstance->rmdir($path); } - static public function is_dir($path) { + public static function is_dir($path) { return self::$defaultInstance->is_dir($path); } - static public function is_file($path) { + public static function is_file($path) { return self::$defaultInstance->is_file($path); } - static public function stat($path) { + public static function stat($path) { return self::$defaultInstance->stat($path); } - static public function filetype($path) { + public static function filetype($path) { return self::$defaultInstance->filetype($path); } - static public function filesize($path) { + public static function filesize($path) { return self::$defaultInstance->filesize($path); } - static public function readfile($path) { + public static function readfile($path) { return self::$defaultInstance->readfile($path); } - static public function isCreatable($path) { + public static function isCreatable($path) { return self::$defaultInstance->isCreatable($path); } - static public function isReadable($path) { + public static function isReadable($path) { return self::$defaultInstance->isReadable($path); } - static public function isUpdatable($path) { + public static function isUpdatable($path) { return self::$defaultInstance->isUpdatable($path); } - static public function isDeletable($path) { + public static function isDeletable($path) { return self::$defaultInstance->isDeletable($path); } - static public function isSharable($path) { + public static function isSharable($path) { return self::$defaultInstance->isSharable($path); } - static public function file_exists($path) { + public static function file_exists($path) { return self::$defaultInstance->file_exists($path); } - static public function filemtime($path) { + public static function filemtime($path) { return self::$defaultInstance->filemtime($path); } - static public function touch($path, $mtime = null) { + public static function touch($path, $mtime = null) { return self::$defaultInstance->touch($path, $mtime); } /** * @return string */ - static public function file_get_contents($path) { + public static function file_get_contents($path) { return self::$defaultInstance->file_get_contents($path); } - static public function file_put_contents($path, $data) { + public static function file_put_contents($path, $data) { return self::$defaultInstance->file_put_contents($path, $data); } - static public function unlink($path) { + public static function unlink($path) { return self::$defaultInstance->unlink($path); } - static public function rename($path1, $path2) { + public static function rename($path1, $path2) { return self::$defaultInstance->rename($path1, $path2); } - static public function copy($path1, $path2) { + public static function copy($path1, $path2) { return self::$defaultInstance->copy($path1, $path2); } - static public function fopen($path, $mode) { + public static function fopen($path, $mode) { return self::$defaultInstance->fopen($path, $mode); } /** * @return string */ - static public function toTmpFile($path) { + public static function toTmpFile($path) { return self::$defaultInstance->toTmpFile($path); } - static public function fromTmpFile($tmpFile, $path) { + public static function fromTmpFile($tmpFile, $path) { return self::$defaultInstance->fromTmpFile($tmpFile, $path); } - static public function getMimeType($path) { + public static function getMimeType($path) { return self::$defaultInstance->getMimeType($path); } - static public function hash($type, $path, $raw = false) { + public static function hash($type, $path, $raw = false) { return self::$defaultInstance->hash($type, $path, $raw); } - static public function free_space($path = '/') { + public static function free_space($path = '/') { return self::$defaultInstance->free_space($path); } - static public function search($query) { + public static function search($query) { return self::$defaultInstance->search($query); } /** * @param string $query */ - static public function searchByMime($query) { + public static function searchByMime($query) { return self::$defaultInstance->searchByMime($query); } @@ -770,7 +770,7 @@ class Filesystem { * @param string $userId owner of the tags * @return FileInfo[] array or file info */ - static public function searchByTag($tag, $userId) { + public static function searchByTag($tag, $userId) { return self::$defaultInstance->searchByTag($tag, $userId); } @@ -781,7 +781,7 @@ class Filesystem { * @param int $time * @return bool */ - static public function hasUpdated($path, $time) { + public static function hasUpdated($path, $time) { return self::$defaultInstance->hasUpdated($path, $time); } @@ -912,7 +912,7 @@ class Filesystem { * @param string $path * @return string */ - static public function getETag($path) { + public static function getETag($path) { return self::$defaultInstance->getETag($path); } } diff --git a/lib/private/Files/ObjectStore/ObjectStoreStorage.php b/lib/private/Files/ObjectStore/ObjectStoreStorage.php index 1faa44ad888..a5112bcbba6 100644 --- a/lib/private/Files/ObjectStore/ObjectStoreStorage.php +++ b/lib/private/Files/ObjectStore/ObjectStoreStorage.php @@ -304,6 +304,7 @@ class ObjectStoreStorage extends \OC\Files\Storage\Common { } else { return false; } + // no break case 'w': case 'wb': case 'w+': diff --git a/lib/private/Files/ObjectStore/S3ObjectTrait.php b/lib/private/Files/ObjectStore/S3ObjectTrait.php index 0939dd2a23c..a0a19954a8d 100644 --- a/lib/private/Files/ObjectStore/S3ObjectTrait.php +++ b/lib/private/Files/ObjectStore/S3ObjectTrait.php @@ -49,7 +49,7 @@ trait S3ObjectTrait { * @throws \Exception when something goes wrong, message will be logged * @since 7.0.0 */ - function readObject($urn) { + public function readObject($urn) { return SeekableHttpStream::open(function ($range) use ($urn) { $command = $this->getConnection()->getCommand('GetObject', [ 'Bucket' => $this->bucket, @@ -81,7 +81,7 @@ trait S3ObjectTrait { * @throws \Exception when something goes wrong, message will be logged * @since 7.0.0 */ - function writeObject($urn, $stream) { + public function writeObject($urn, $stream) { $count = 0; $countStream = CallbackWrapper::wrap($stream, function ($read) use (&$count) { $count += $read; @@ -114,7 +114,7 @@ trait S3ObjectTrait { * @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/Files/ObjectStore/StorageObjectStore.php b/lib/private/Files/ObjectStore/StorageObjectStore.php index 0321b7cdf5f..6151214ca70 100644 --- a/lib/private/Files/ObjectStore/StorageObjectStore.php +++ b/lib/private/Files/ObjectStore/StorageObjectStore.php @@ -44,7 +44,7 @@ class StorageObjectStore implements IObjectStore { * @return string the container or bucket name where objects are stored * @since 7.0.0 */ - function getStorageId() { + public function getStorageId() { $this->storage->getId(); } @@ -54,7 +54,7 @@ class StorageObjectStore implements IObjectStore { * @throws \Exception when something goes wrong, message will be logged * @since 7.0.0 */ - function readObject($urn) { + public function readObject($urn) { $handle = $this->storage->fopen($urn, 'r'); if ($handle) { return $handle; @@ -69,7 +69,7 @@ class StorageObjectStore 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) { $handle = $this->storage->fopen($urn, 'w'); if ($handle) { stream_copy_to_stream($stream, $handle); @@ -85,7 +85,7 @@ class StorageObjectStore implements IObjectStore { * @throws \Exception when something goes wrong, message will be logged * @since 7.0.0 */ - function deleteObject($urn) { + public function deleteObject($urn) { $this->storage->unlink($urn); } diff --git a/lib/private/Files/ObjectStore/SwiftFactory.php b/lib/private/Files/ObjectStore/SwiftFactory.php index c7d2e691bbd..59446576400 100644 --- a/lib/private/Files/ObjectStore/SwiftFactory.php +++ b/lib/private/Files/ObjectStore/SwiftFactory.php @@ -56,7 +56,7 @@ class SwiftFactory { private $container = null; private $logger; - const DEFAULT_OPTIONS = [ + public const DEFAULT_OPTIONS = [ 'autocreate' => false, 'urlType' => 'publicURL', 'catalogName' => 'swift', diff --git a/lib/private/Files/Storage/Flysystem.php b/lib/private/Files/Storage/Flysystem.php index 2644bfbb1d3..fba64c64250 100644 --- a/lib/private/Files/Storage/Flysystem.php +++ b/lib/private/Files/Storage/Flysystem.php @@ -189,6 +189,7 @@ abstract class Flysystem extends Common { case 'wb': case 'wb+': $useExisting = false; + // no break case 'a': case 'ab': case 'r+': diff --git a/lib/private/Files/Storage/Wrapper/Availability.php b/lib/private/Files/Storage/Wrapper/Availability.php index b949c9103a7..300ba7e7f7c 100644 --- a/lib/private/Files/Storage/Wrapper/Availability.php +++ b/lib/private/Files/Storage/Wrapper/Availability.php @@ -37,7 +37,7 @@ use OCP\IConfig; * Throws a StorageNotAvailableException for storages with known failures */ class Availability extends Wrapper { - const RECHECK_TTL_SEC = 600; // 10 minutes + public const RECHECK_TTL_SEC = 600; // 10 minutes /** @var IConfig */ protected $config; diff --git a/lib/private/Files/Stream/Quota.php b/lib/private/Files/Stream/Quota.php index d0609d7e459..3bf46264b83 100644 --- a/lib/private/Files/Stream/Quota.php +++ b/lib/private/Files/Stream/Quota.php @@ -44,7 +44,7 @@ class Quota extends Wrapper { * @param int $limit * @return resource */ - static public function wrap($stream, $limit) { + public static function wrap($stream, $limit) { $context = stream_context_create([ 'quota' => [ 'source' => $stream, diff --git a/lib/private/Files/Utils/Scanner.php b/lib/private/Files/Utils/Scanner.php index a729da89fb0..996380037b7 100644 --- a/lib/private/Files/Utils/Scanner.php +++ b/lib/private/Files/Utils/Scanner.php @@ -61,7 +61,7 @@ use OCP\ILogger; * @package OC\Files\Utils */ class Scanner extends PublicEmitter { - const MAX_ENTRIES_TO_COMMIT = 10000; + public const MAX_ENTRIES_TO_COMMIT = 10000; /** @var string $user */ private $user; diff --git a/lib/private/Group/Backend.php b/lib/private/Group/Backend.php index 0f0e2c743e8..ebd8d3620d4 100644 --- a/lib/private/Group/Backend.php +++ b/lib/private/Group/Backend.php @@ -32,7 +32,7 @@ abstract class Backend implements \OCP\GroupInterface { /** * error code for functions not provided by the group backend */ - const NOT_IMPLEMENTED = -501; + public const NOT_IMPLEMENTED = -501; protected $possibleActions = [ self::CREATE_GROUP => 'createGroup', diff --git a/lib/private/Group/Database.php b/lib/private/Group/Database.php index b75dc097c97..1202ba09b13 100644 --- a/lib/private/Group/Database.php +++ b/lib/private/Group/Database.php @@ -60,8 +60,8 @@ use OCP\IDBConnection; /** * Class for group management in a SQL Database (e.g. MySQL, SQLite) */ -class Database extends ABackend - implements IAddToGroupBackend, +class Database extends ABackend implements + IAddToGroupBackend, ICountDisabledInGroup, ICountUsersBackend, ICreateGroupBackend, diff --git a/lib/private/Group/MetaData.php b/lib/private/Group/MetaData.php index 880dbf6437c..6950a239678 100644 --- a/lib/private/Group/MetaData.php +++ b/lib/private/Group/MetaData.php @@ -35,9 +35,9 @@ use OCP\IGroupManager; use OCP\IUserSession; class MetaData { - const SORT_NONE = 0; - const SORT_USERCOUNT = 1; // May have performance issues on LDAP backends - const SORT_GROUPNAME = 2; + public const SORT_NONE = 0; + public const SORT_USERCOUNT = 1; // May have performance issues on LDAP backends + public const SORT_GROUPNAME = 2; /** @var string */ protected $user; diff --git a/lib/private/Http/CookieHelper.php b/lib/private/Http/CookieHelper.php index 7083584bffa..8c20ddb9f65 100644 --- a/lib/private/Http/CookieHelper.php +++ b/lib/private/Http/CookieHelper.php @@ -27,9 +27,9 @@ declare(strict_types=1); namespace OC\Http; class CookieHelper { - const SAMESITE_NONE = 0; - const SAMESITE_LAX = 1; - const SAMESITE_STRICT = 2; + public const SAMESITE_NONE = 0; + public const SAMESITE_LAX = 1; + public const SAMESITE_STRICT = 2; public static function setCookie(string $name, string $value = '', diff --git a/lib/private/IntegrityCheck/Checker.php b/lib/private/IntegrityCheck/Checker.php index 1084a9e1dd5..af1e3555c32 100644 --- a/lib/private/IntegrityCheck/Checker.php +++ b/lib/private/IntegrityCheck/Checker.php @@ -58,7 +58,7 @@ use phpseclib\File\X509; * @package OC\IntegrityCheck */ class Checker { - const CACHE_KEY = 'oc.integritycheck.checker'; + public const CACHE_KEY = 'oc.integritycheck.checker'; /** @var EnvironmentHelper */ private $environmentHelper; /** @var AppLocator */ diff --git a/lib/private/L10N/Factory.php b/lib/private/L10N/Factory.php index a1afb1f4f0a..03240f48410 100644 --- a/lib/private/L10N/Factory.php +++ b/lib/private/L10N/Factory.php @@ -72,7 +72,7 @@ class Factory implements IFactory { */ protected $pluralFunctions = []; - const COMMON_LANGUAGE_CODES = [ + public const COMMON_LANGUAGE_CODES = [ 'en', 'es', 'fr', 'de', 'de_DE', 'ja', 'ar', 'ru', 'nl', 'it', 'pt_BR', 'pt_PT', 'da', 'fi_FI', 'nb_NO', 'sv', 'tr', 'zh_CN', 'ko' ]; diff --git a/lib/private/L10N/LanguageIterator.php b/lib/private/L10N/LanguageIterator.php index 0670ac56503..a03ec114ef9 100644 --- a/lib/private/L10N/LanguageIterator.php +++ b/lib/private/L10N/LanguageIterator.php @@ -64,6 +64,7 @@ class LanguageIterator implements ILanguageIterator { } $this->next(); /** @noinspection PhpMissingBreakStatementInspection */ + // no break case 1: $forcedLang = $this->config->getSystemValue('force_language', false); if (is_string($forcedLang) @@ -73,6 +74,7 @@ class LanguageIterator implements ILanguageIterator { } $this->next(); /** @noinspection PhpMissingBreakStatementInspection */ + // no break case 2: $userLang = $this->config->getUserValue($this->user->getUID(), 'core', 'lang', null); if (is_string($userLang)) { @@ -80,6 +82,7 @@ class LanguageIterator implements ILanguageIterator { } $this->next(); /** @noinspection PhpMissingBreakStatementInspection */ + // no break case 3: $userLang = $this->config->getUserValue($this->user->getUID(), 'core', 'lang', null); if (is_string($userLang) @@ -88,6 +91,7 @@ class LanguageIterator implements ILanguageIterator { return $truncated; } $this->next(); + // no break case 4: return $this->config->getSystemValue('default_language', 'en'); /** @noinspection PhpMissingBreakStatementInspection */ @@ -97,6 +101,7 @@ class LanguageIterator implements ILanguageIterator { return $truncated; } $this->next(); + // no break default: return 'en'; } diff --git a/lib/private/LargeFileHelper.php b/lib/private/LargeFileHelper.php index c24657a5c9c..2a6a6714eb3 100755 --- a/lib/private/LargeFileHelper.php +++ b/lib/private/LargeFileHelper.php @@ -37,13 +37,13 @@ class LargeFileHelper { * pow(2, 53) as a base-10 string. * @var string */ - const POW_2_53 = '9007199254740992'; + public const POW_2_53 = '9007199254740992'; /** * pow(2, 53) - 1 as a base-10 string. * @var string */ - const POW_2_53_MINUS_1 = '9007199254740991'; + public const POW_2_53_MINUS_1 = '9007199254740991'; /** * @brief Checks whether our assumptions hold on the PHP platform we are on. diff --git a/lib/private/Log/ExceptionSerializer.php b/lib/private/Log/ExceptionSerializer.php index 50544d7149c..237d33cfefa 100644 --- a/lib/private/Log/ExceptionSerializer.php +++ b/lib/private/Log/ExceptionSerializer.php @@ -32,7 +32,7 @@ use OC\HintException; use OC\Setup; class ExceptionSerializer { - const methodsWithSensitiveParameters = [ + public const methodsWithSensitiveParameters = [ // Session/User 'completeLogin', 'login', @@ -86,7 +86,7 @@ class ExceptionSerializer { 'update', ]; - const methodsWithSensitiveParametersByClass = [ + public const methodsWithSensitiveParametersByClass = [ SetupController::class => [ 'run', 'display', diff --git a/lib/private/Memcache/APCu.php b/lib/private/Memcache/APCu.php index 3523ea2a86b..5886f75731a 100644 --- a/lib/private/Memcache/APCu.php +++ b/lib/private/Memcache/APCu.php @@ -150,7 +150,7 @@ class APCu extends Cache implements IMemcache { /** * @return bool */ - static public function isAvailable() { + public static function isAvailable() { if (!extension_loaded('apcu')) { return false; } elseif (!\OC::$server->getIniWrapper()->getBool('apc.enabled')) { diff --git a/lib/private/Memcache/ArrayCache.php b/lib/private/Memcache/ArrayCache.php index 407f4af06f4..8c91d9fcbbb 100644 --- a/lib/private/Memcache/ArrayCache.php +++ b/lib/private/Memcache/ArrayCache.php @@ -154,7 +154,7 @@ class ArrayCache extends Cache implements IMemcache { /** * {@inheritDoc} */ - static public function isAvailable() { + public static function isAvailable() { return true; } } diff --git a/lib/private/Memcache/Factory.php b/lib/private/Memcache/Factory.php index 0e6552ba436..52c5af4ef98 100644 --- a/lib/private/Memcache/Factory.php +++ b/lib/private/Memcache/Factory.php @@ -36,7 +36,7 @@ use OCP\ILogger; use OCP\IMemcache; class Factory implements ICacheFactory { - const NULL_CACHE = NullCache::class; + public const NULL_CACHE = NullCache::class; /** * @var string $globalPrefix diff --git a/lib/private/Memcache/Memcached.php b/lib/private/Memcache/Memcached.php index e3fc1b35f1a..eff76a41c45 100644 --- a/lib/private/Memcache/Memcached.php +++ b/lib/private/Memcache/Memcached.php @@ -210,7 +210,7 @@ class Memcached extends Cache implements IMemcache { return $result; } - static public function isAvailable() { + public static function isAvailable() { return extension_loaded('memcached'); } diff --git a/lib/private/Memcache/NullCache.php b/lib/private/Memcache/NullCache.php index 371c9381f56..6ea90e9045b 100644 --- a/lib/private/Memcache/NullCache.php +++ b/lib/private/Memcache/NullCache.php @@ -67,7 +67,7 @@ class NullCache extends Cache implements \OCP\IMemcache { return true; } - static public function isAvailable() { + public static function isAvailable() { return true; } } diff --git a/lib/private/Memcache/Redis.php b/lib/private/Memcache/Redis.php index 7023c6b7871..af1a6864b43 100644 --- a/lib/private/Memcache/Redis.php +++ b/lib/private/Memcache/Redis.php @@ -174,7 +174,7 @@ class Redis extends Cache implements IMemcacheTTL { self::$cache->expire($this->getNameSpace() . $key, $ttl); } - static public function isAvailable() { + public static function isAvailable() { return \OC::$server->getGetRedisFactory()->isAvailable(); } } diff --git a/lib/private/MemoryInfo.php b/lib/private/MemoryInfo.php index 520225fc6d1..88ba69aae95 100644 --- a/lib/private/MemoryInfo.php +++ b/lib/private/MemoryInfo.php @@ -30,7 +30,7 @@ namespace OC; * Helper class that covers memory info. */ class MemoryInfo { - const RECOMMENDED_MEMORY_LIMIT = 512 * 1024 * 1024; + public const RECOMMENDED_MEMORY_LIMIT = 512 * 1024 * 1024; /** * Tests if the memory limit is greater or equal the recommended value. @@ -72,8 +72,10 @@ class MemoryInfo { switch ($last) { case 'g': $memoryLimit *= 1024; + // no break case 'm': $memoryLimit *= 1024; + // no break case 'k': $memoryLimit *= 1024; } diff --git a/lib/private/Remote/User.php b/lib/private/Remote/User.php index 5519d7dc22f..31ded598b7c 100644 --- a/lib/private/Remote/User.php +++ b/lib/private/Remote/User.php @@ -26,7 +26,7 @@ namespace OC\Remote; use OCP\Remote\IUser; class User implements IUser { - const EXPECTED_KEYS = [ + public const EXPECTED_KEYS = [ 'id', 'email', 'displayname', diff --git a/lib/private/Repair/Owncloud/SaveAccountsTableData.php b/lib/private/Repair/Owncloud/SaveAccountsTableData.php index 6dd49e6c9fd..6eccf53c5a8 100644 --- a/lib/private/Repair/Owncloud/SaveAccountsTableData.php +++ b/lib/private/Repair/Owncloud/SaveAccountsTableData.php @@ -35,7 +35,7 @@ use OCP\PreConditionNotMetException; * before the data structure is changed and the information is gone */ class SaveAccountsTableData implements IRepairStep { - const BATCH_SIZE = 75; + public const BATCH_SIZE = 75; /** @var IDBConnection */ protected $db; diff --git a/lib/private/Repair/RepairInvalidShares.php b/lib/private/Repair/RepairInvalidShares.php index becf8ba7594..a0fe246571a 100644 --- a/lib/private/Repair/RepairInvalidShares.php +++ b/lib/private/Repair/RepairInvalidShares.php @@ -32,7 +32,7 @@ use OCP\Migration\IRepairStep; * Repairs shares with invalid data */ class RepairInvalidShares implements IRepairStep { - const CHUNK_SIZE = 200; + public const CHUNK_SIZE = 200; /** @var \OCP\IConfig */ protected $config; diff --git a/lib/private/Search/Result/File.php b/lib/private/Search/Result/File.php index b0f6b3df622..242bf7cb953 100644 --- a/lib/private/Search/Result/File.php +++ b/lib/private/Search/Result/File.php @@ -97,7 +97,7 @@ class File extends \OCP\Search\Result { /** * @var Folder $userFolderCache */ - static protected $userFolderCache = null; + protected static $userFolderCache = null; /** * converts a path relative to the users files folder diff --git a/lib/private/Security/Bruteforce/Throttler.php b/lib/private/Security/Bruteforce/Throttler.php index c04e0e1b383..d1fead6759f 100644 --- a/lib/private/Security/Bruteforce/Throttler.php +++ b/lib/private/Security/Bruteforce/Throttler.php @@ -48,7 +48,7 @@ use OCP\ILogger; * @package OC\Security\Bruteforce */ class Throttler { - const LOGIN_ACTION = 'login'; + public const LOGIN_ACTION = 'login'; /** @var IDBConnection */ private $db; diff --git a/lib/private/Security/CredentialsManager.php b/lib/private/Security/CredentialsManager.php index ab06a807613..770919dacd7 100644 --- a/lib/private/Security/CredentialsManager.php +++ b/lib/private/Security/CredentialsManager.php @@ -33,7 +33,7 @@ use OCP\Security\ICrypto; * @package OC\Security */ class CredentialsManager implements ICredentialsManager { - const DB_TABLE = 'credentials'; + public const DB_TABLE = 'credentials'; /** @var ICrypto */ protected $crypto; diff --git a/lib/private/Server.php b/lib/private/Server.php index 629673418f7..1a3eabc852e 100644 --- a/lib/private/Server.php +++ b/lib/private/Server.php @@ -1971,14 +1971,14 @@ class Server extends ServerContainer implements IServerContainer { /** * @return IMountManager **/ - function getMountManager() { + public function getMountManager() { return $this->query(IMountManager::class); } /** * @return IUserMountCache */ - function getUserMountCache() { + public function getUserMountCache() { return $this->query(IUserMountCache::class); } diff --git a/lib/private/Session/CryptoSessionData.php b/lib/private/Session/CryptoSessionData.php index 892c2436040..fc7693b71b2 100644 --- a/lib/private/Session/CryptoSessionData.php +++ b/lib/private/Session/CryptoSessionData.php @@ -50,7 +50,7 @@ class CryptoSessionData implements \ArrayAccess, ISession { protected $sessionValues; /** @var bool */ protected $isModified = false; - const encryptedSessionName = 'encrypted_session_data'; + public const encryptedSessionName = 'encrypted_session_data'; /** * @param ISession $session diff --git a/lib/private/Session/CryptoWrapper.php b/lib/private/Session/CryptoWrapper.php index bb82652a01d..f4d30bee145 100644 --- a/lib/private/Session/CryptoWrapper.php +++ b/lib/private/Session/CryptoWrapper.php @@ -48,7 +48,7 @@ use OCP\Security\ISecureRandom; * @package OC\Session */ class CryptoWrapper { - const COOKIE_NAME = 'oc_sessionPassphrase'; + public const COOKIE_NAME = 'oc_sessionPassphrase'; /** @var IConfig */ protected $config; diff --git a/lib/private/Setup.php b/lib/private/Setup.php index afdc881b482..3fc8415e29a 100644 --- a/lib/private/Setup.php +++ b/lib/private/Setup.php @@ -105,7 +105,7 @@ class Setup { $this->installer = $installer; } - static protected $dbSetupClasses = [ + protected static $dbSetupClasses = [ 'mysql' => \OC\Setup\MySQL::class, 'pgsql' => \OC\Setup\PostgreSQL::class, 'oci' => \OC\Setup\OCI::class, diff --git a/lib/private/Share/Constants.php b/lib/private/Share/Constants.php index d1b47f1dd47..18f6864b6c9 100644 --- a/lib/private/Share/Constants.php +++ b/lib/private/Share/Constants.php @@ -37,50 +37,50 @@ class Constants { /** * @deprecated 17.0.0 - use IShare::TYPE_USER instead */ - const SHARE_TYPE_USER = 0; + public const SHARE_TYPE_USER = 0; /** * @deprecated 17.0.0 - use IShare::TYPE_GROUP instead */ - const SHARE_TYPE_GROUP = 1; + public const SHARE_TYPE_GROUP = 1; // const SHARE_TYPE_USERGROUP = 2; // Internal type used by DefaultShareProvider /** * @deprecated 17.0.0 - use IShare::TYPE_LINK instead */ - const SHARE_TYPE_LINK = 3; + public const SHARE_TYPE_LINK = 3; /** * @deprecated 17.0.0 - use IShare::TYPE_EMAIL instead */ - const SHARE_TYPE_EMAIL = 4; - const SHARE_TYPE_CONTACT = 5; // ToDo Check if it is still in use otherwise remove it + public const SHARE_TYPE_EMAIL = 4; + public const SHARE_TYPE_CONTACT = 5; // ToDo Check if it is still in use otherwise remove it /** * @deprecated 17.0.0 - use IShare::TYPE_REMOTE instead */ - const SHARE_TYPE_REMOTE = 6; + public const SHARE_TYPE_REMOTE = 6; /** * @deprecated 17.0.0 - use IShare::TYPE_CIRCLE instead */ - const SHARE_TYPE_CIRCLE = 7; + public const SHARE_TYPE_CIRCLE = 7; /** * @deprecated 17.0.0 - use IShare::TYPE_GUEST instead */ - const SHARE_TYPE_GUEST = 8; + public const SHARE_TYPE_GUEST = 8; /** * @deprecated 17.0.0 - use IShare::REMOTE_GROUP instead */ - const SHARE_TYPE_REMOTE_GROUP = 9; + public const SHARE_TYPE_REMOTE_GROUP = 9; /** * @deprecated 17.0.0 - use IShare::TYPE_ROOM instead */ - const SHARE_TYPE_ROOM = 10; + public const SHARE_TYPE_ROOM = 10; // const SHARE_TYPE_USERROOM = 11; // Internal type used by RoomShareProvider - const FORMAT_NONE = -1; - const FORMAT_STATUSES = -2; - const FORMAT_SOURCES = -3; // ToDo Check if it is still in use otherwise remove it + public const FORMAT_NONE = -1; + public const FORMAT_STATUSES = -2; + public const FORMAT_SOURCES = -3; // ToDo Check if it is still in use otherwise remove it - const RESPONSE_FORMAT = 'json'; // default resonse format for ocs calls + public const RESPONSE_FORMAT = 'json'; // default resonse format for ocs calls - const TOKEN_LENGTH = 15; // old (oc7) length is 32, keep token length in db at least that for compatibility + public const TOKEN_LENGTH = 15; // old (oc7) length is 32, keep token length in db at least that for compatibility protected static $shareTypeUserAndGroups = -1; protected static $shareTypeGroupUserUnique = 2; diff --git a/lib/private/Share20/DefaultShareProvider.php b/lib/private/Share20/DefaultShareProvider.php index 41a727593b3..75745a7fe97 100644 --- a/lib/private/Share20/DefaultShareProvider.php +++ b/lib/private/Share20/DefaultShareProvider.php @@ -63,7 +63,7 @@ use OCP\Share\IShareProvider; class DefaultShareProvider implements IShareProvider { // Special share type for user modified group shares - const SHARE_TYPE_USERGROUP = 2; + public const SHARE_TYPE_USERGROUP = 2; /** @var IDBConnection */ private $dbConn; diff --git a/lib/private/SystemTag/SystemTagManager.php b/lib/private/SystemTag/SystemTagManager.php index 2d7b1bc3ae4..a718a007e34 100644 --- a/lib/private/SystemTag/SystemTagManager.php +++ b/lib/private/SystemTag/SystemTagManager.php @@ -44,8 +44,8 @@ use Symfony\Component\EventDispatcher\EventDispatcherInterface; * Manager class for system tags */ class SystemTagManager implements ISystemTagManager { - const TAG_TABLE = 'systemtag'; - const TAG_GROUP_TABLE = 'systemtag_group'; + public const TAG_TABLE = 'systemtag'; + public const TAG_GROUP_TABLE = 'systemtag_group'; /** @var IDBConnection */ protected $connection; diff --git a/lib/private/SystemTag/SystemTagObjectMapper.php b/lib/private/SystemTag/SystemTagObjectMapper.php index eb33d2d30bb..c6d6d09b95a 100644 --- a/lib/private/SystemTag/SystemTagObjectMapper.php +++ b/lib/private/SystemTag/SystemTagObjectMapper.php @@ -38,7 +38,7 @@ use OCP\SystemTag\TagNotFoundException; use Symfony\Component\EventDispatcher\EventDispatcherInterface; class SystemTagObjectMapper implements ISystemTagObjectMapper { - const RELATION_TABLE = 'systemtag_object_mapping'; + public const RELATION_TABLE = 'systemtag_object_mapping'; /** @var ISystemTagManager */ protected $tagManager; diff --git a/lib/private/Tags.php b/lib/private/Tags.php index a176967bd2b..6d06b3a4829 100644 --- a/lib/private/Tags.php +++ b/lib/private/Tags.php @@ -112,8 +112,8 @@ class Tags implements ITags { */ private $backend; - const TAG_TABLE = '*PREFIX*vcategory'; - const RELATION_TABLE = '*PREFIX*vcategory_to_object'; + public const TAG_TABLE = '*PREFIX*vcategory'; + public const RELATION_TABLE = '*PREFIX*vcategory_to_object'; /** * Constructor. diff --git a/lib/private/TempManager.php b/lib/private/TempManager.php index 13735d69d47..8b47193feaa 100644 --- a/lib/private/TempManager.php +++ b/lib/private/TempManager.php @@ -45,7 +45,7 @@ class TempManager implements ITempManager { protected $config; /** Prefix */ - const TMP_PREFIX = 'oc_tmp_'; + public const TMP_PREFIX = 'oc_tmp_'; /** * @param \OCP\ILogger $logger diff --git a/lib/private/TemplateLayout.php b/lib/private/TemplateLayout.php index 89904827b2a..ddddb8704c8 100644 --- a/lib/private/TemplateLayout.php +++ b/lib/private/TemplateLayout.php @@ -287,7 +287,7 @@ class TemplateLayout extends \OC_Template { * @param array $styles * @return array */ - static public function findStylesheetFiles($styles, $compileScss = true) { + public static function findStylesheetFiles($styles, $compileScss = true) { // Read the selected theme from the config file $theme = \OC_Util::getTheme(); @@ -328,7 +328,7 @@ class TemplateLayout extends \OC_Template { * @param array $scripts * @return array */ - static public function findJavascriptFiles($scripts) { + public static function findJavascriptFiles($scripts) { // Read the selected theme from the config file $theme = \OC_Util::getTheme(); diff --git a/lib/private/Updater/ChangesCheck.php b/lib/private/Updater/ChangesCheck.php index 8700b9609d2..cde7517d3c5 100644 --- a/lib/private/Updater/ChangesCheck.php +++ b/lib/private/Updater/ChangesCheck.php @@ -40,9 +40,9 @@ class ChangesCheck { /** @var ILogger */ private $logger; - const RESPONSE_NO_CONTENT = 0; - const RESPONSE_USE_CACHE = 1; - const RESPONSE_HAS_CONTENT = 2; + public const RESPONSE_NO_CONTENT = 0; + public const RESPONSE_USE_CACHE = 1; + public const RESPONSE_HAS_CONTENT = 2; public function __construct(IClientService $clientService, ChangesMapper $mapper, ILogger $logger) { $this->clientService = $clientService; diff --git a/lib/private/Updater/ChangesMapper.php b/lib/private/Updater/ChangesMapper.php index b79eadbff58..b3b578f61e1 100644 --- a/lib/private/Updater/ChangesMapper.php +++ b/lib/private/Updater/ChangesMapper.php @@ -32,7 +32,7 @@ use OCP\DB\QueryBuilder\IQueryBuilder; use OCP\IDBConnection; class ChangesMapper extends QBMapper { - const TABLE_NAME = 'whats_new'; + public const TABLE_NAME = 'whats_new'; public function __construct(IDBConnection $db) { parent::__construct($db, self::TABLE_NAME); diff --git a/lib/private/User/Backend.php b/lib/private/User/Backend.php index 354e1c3fd71..477448279a5 100644 --- a/lib/private/User/Backend.php +++ b/lib/private/User/Backend.php @@ -34,19 +34,19 @@ abstract class Backend implements UserInterface { /** * error code for functions not provided by the user backend */ - const NOT_IMPLEMENTED = -501; + public const NOT_IMPLEMENTED = -501; /** * actions that user backends can define */ - const CREATE_USER = 1; // 1 << 0 - const SET_PASSWORD = 16; // 1 << 4 - const CHECK_PASSWORD = 256; // 1 << 8 - const GET_HOME = 4096; // 1 << 12 - const GET_DISPLAYNAME = 65536; // 1 << 16 - const SET_DISPLAYNAME = 1048576; // 1 << 20 - const PROVIDE_AVATAR = 16777216; // 1 << 24 - const COUNT_USERS = 268435456; // 1 << 28 + public const CREATE_USER = 1; // 1 << 0 + public const SET_PASSWORD = 16; // 1 << 4 + public const CHECK_PASSWORD = 256; // 1 << 8 + public const GET_HOME = 4096; // 1 << 12 + public const GET_DISPLAYNAME = 65536; // 1 << 16 + public const SET_DISPLAYNAME = 1048576; // 1 << 20 + public const PROVIDE_AVATAR = 16777216; // 1 << 24 + public const COUNT_USERS = 268435456; // 1 << 28 protected $possibleActions = [ self::CREATE_USER => 'createUser', diff --git a/lib/private/User/Database.php b/lib/private/User/Database.php index d5098483d61..e88549c8d81 100644 --- a/lib/private/User/Database.php +++ b/lib/private/User/Database.php @@ -76,8 +76,8 @@ use OCP\User\Backend\ISetPasswordBackend; /** * Class for user management in a SQL Database (e.g. MySQL, SQLite) */ -class Database extends ABackend - implements ICreateUserBackend, +class Database extends ABackend implements + ICreateUserBackend, ISetPasswordBackend, ISetDisplayNameBackend, IGetDisplayNameBackend, diff --git a/lib/private/legacy/OC_App.php b/lib/private/legacy/OC_App.php index 5c06f66a20a..2454d6be4f0 100644 --- a/lib/private/legacy/OC_App.php +++ b/lib/private/legacy/OC_App.php @@ -65,14 +65,14 @@ use OCP\ILogger; * upgrading and removing apps. */ class OC_App { - static private $adminForms = []; - static private $personalForms = []; - static private $appTypes = []; - static private $loadedApps = []; - static private $altLogin = []; - static private $alreadyRegistered = []; - const supportedApp = 300; - const officialApp = 200; + private static $adminForms = []; + private static $personalForms = []; + private static $appTypes = []; + private static $loadedApps = []; + private static $altLogin = []; + private static $alreadyRegistered = []; + public const supportedApp = 300; + public const officialApp = 200; /** * clean the appId diff --git a/lib/private/legacy/OC_DB.php b/lib/private/legacy/OC_DB.php index 63f1447ad91..1d2e9bd1429 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) { + public static 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) { + public static 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 = []) { + public static 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 diff --git a/lib/private/legacy/OC_FileChunking.php b/lib/private/legacy/OC_FileChunking.php index 37cf42a31cb..188023a960a 100644 --- a/lib/private/legacy/OC_FileChunking.php +++ b/lib/private/legacy/OC_FileChunking.php @@ -40,7 +40,7 @@ class OC_FileChunking { */ protected $ttl; - static public function decodeName($name) { + public static function decodeName($name) { preg_match('/(?P<name>.*)-chunking-(?P<transferid>\d+)-(?P<chunkcount>\d+)-(?P<index>\d+)/', $name, $matches); return $matches; } diff --git a/lib/private/legacy/OC_Files.php b/lib/private/legacy/OC_Files.php index e046a577026..ddb824cd6cd 100644 --- a/lib/private/legacy/OC_Files.php +++ b/lib/private/legacy/OC_Files.php @@ -50,11 +50,11 @@ use OCP\Lock\ILockingProvider; * */ class OC_Files { - const FILE = 1; - const ZIP_FILES = 2; - const ZIP_DIR = 3; + public const FILE = 1; + public const ZIP_FILES = 2; + public const ZIP_DIR = 3; - const UPLOAD_MIN_LIMIT_BYTES = 1048576; // 1 MiB + public const UPLOAD_MIN_LIMIT_BYTES = 1048576; // 1 MiB private static $multipartBoundary = ''; diff --git a/lib/private/legacy/OC_Helper.php b/lib/private/legacy/OC_Helper.php index 3439d1f8936..8cd492de117 100644 --- a/lib/private/legacy/OC_Helper.php +++ b/lib/private/legacy/OC_Helper.php @@ -135,7 +135,7 @@ class OC_Helper { * @param string $dest target folder * */ - static function copyr($src, $dest) { + public static function copyr($src, $dest) { if (is_dir($src)) { if (!is_dir($dest)) { mkdir($dest); @@ -157,7 +157,7 @@ class OC_Helper { * @param bool $deleteSelf if set to false only the content of the folder will be deleted * @return bool */ - static function rmdirr($dir, $deleteSelf = true) { + public static function rmdirr($dir, $deleteSelf = true) { if (is_dir($dir)) { $files = new RecursiveIteratorIterator( new RecursiveDirectoryIterator($dir, RecursiveDirectoryIterator::SKIP_DOTS), @@ -193,7 +193,7 @@ class OC_Helper { * @deprecated 18.0.0 * @return \OC\Files\Type\TemplateManager */ - static public function getFileTemplateManager() { + public static function getFileTemplateManager() { if (!self::$templateManager) { self::$templateManager = new \OC\Files\Type\TemplateManager(); } diff --git a/lib/private/legacy/OC_Hook.php b/lib/private/legacy/OC_Hook.php index fe08266fe5b..980eb609259 100644 --- a/lib/private/legacy/OC_Hook.php +++ b/lib/private/legacy/OC_Hook.php @@ -36,7 +36,7 @@ class OC_Hook { public static $thrownExceptions = []; - static private $registered = []; + private static $registered = []; /** * connects a function to a hook @@ -51,7 +51,7 @@ class OC_Hook { * * TODO: write example */ - static public function connect($signalClass, $signalName, $slotClass, $slotName) { + public static 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)) { @@ -91,7 +91,7 @@ class OC_Hook { * * TODO: write example */ - static public function emit($signalClass, $signalName, $params = []) { + public static function emit($signalClass, $signalName, $params = []) { // Return false if no hook handlers are listening to this // emitting class @@ -129,7 +129,7 @@ class OC_Hook { * @param string $signalClass * @param string $signalName */ - static public function clear($signalClass='', $signalName='') { + public static function clear($signalClass='', $signalName='') { if ($signalClass) { if ($signalName) { self::$registered[$signalClass][$signalName]=[]; @@ -145,7 +145,7 @@ class OC_Hook { * DO NOT USE! * For unit tests ONLY! */ - static public function getHooks() { + public static function getHooks() { return self::$registered; } } diff --git a/lib/private/legacy/OC_Image.php b/lib/private/legacy/OC_Image.php index b8d3d162cc8..9ef77e3d4c6 100644 --- a/lib/private/legacy/OC_Image.php +++ b/lib/private/legacy/OC_Image.php @@ -1128,7 +1128,6 @@ class OC_Image implements \OCP\IImage { * @return bool */ public function copyResize($maxSize): IImage { - } /** diff --git a/lib/private/legacy/OC_Response.php b/lib/private/legacy/OC_Response.php index bbeb6258109..89f0ee5247b 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') { + public static function setContentDispositionHeader($filename, $type = 'attachment') { if (\OC::$server->getRequest()->isUserAgent( [ \OC\AppFramework\Http\Request::USER_AGENT_IE, @@ -51,7 +51,7 @@ class OC_Response { * Sets the content length header (with possible workarounds) * @param string|int|float $length Length to be sent */ - static public function setContentLengthHeader($length) { + public static function setContentLengthHeader($length) { if (PHP_INT_SIZE === 4) { if ($length > PHP_INT_MAX && stripos(PHP_SAPI, 'apache') === 0) { // Apache PHP SAPI casts Content-Length headers to PHP integers. |