@@ -36,7 +36,7 @@ |
||
36 | 36 | * @package OC\AppFramework\Middleware\Security\Exceptions |
37 | 37 | */ |
38 | 38 | class NotAdminException extends SecurityException { |
39 | - public function __construct(string $message) { |
|
40 | - parent::__construct($message, Http::STATUS_FORBIDDEN); |
|
41 | - } |
|
39 | + public function __construct(string $message) { |
|
40 | + parent::__construct($message, Http::STATUS_FORBIDDEN); |
|
41 | + } |
|
42 | 42 | } |
@@ -32,23 +32,23 @@ |
||
32 | 32 | * @package OC\Security\CSRF |
33 | 33 | */ |
34 | 34 | class CsrfTokenGenerator { |
35 | - /** @var ISecureRandom */ |
|
36 | - private $random; |
|
35 | + /** @var ISecureRandom */ |
|
36 | + private $random; |
|
37 | 37 | |
38 | - /** |
|
39 | - * @param ISecureRandom $random |
|
40 | - */ |
|
41 | - public function __construct(ISecureRandom $random) { |
|
42 | - $this->random = $random; |
|
43 | - } |
|
38 | + /** |
|
39 | + * @param ISecureRandom $random |
|
40 | + */ |
|
41 | + public function __construct(ISecureRandom $random) { |
|
42 | + $this->random = $random; |
|
43 | + } |
|
44 | 44 | |
45 | - /** |
|
46 | - * Generate a new CSRF token. |
|
47 | - * |
|
48 | - * @param int $length Length of the token in characters. |
|
49 | - * @return string |
|
50 | - */ |
|
51 | - public function generateToken(int $length = 32): string { |
|
52 | - return $this->random->generate($length); |
|
53 | - } |
|
45 | + /** |
|
46 | + * Generate a new CSRF token. |
|
47 | + * |
|
48 | + * @param int $length Length of the token in characters. |
|
49 | + * @return string |
|
50 | + */ |
|
51 | + public function generateToken(int $length = 32): string { |
|
52 | + return $this->random->generate($length); |
|
53 | + } |
|
54 | 54 | } |
@@ -25,25 +25,25 @@ |
||
25 | 25 | namespace OC\Security\IdentityProof; |
26 | 26 | |
27 | 27 | class Key { |
28 | - /** @var string */ |
|
29 | - private $publicKey; |
|
30 | - /** @var string */ |
|
31 | - private $privateKey; |
|
28 | + /** @var string */ |
|
29 | + private $publicKey; |
|
30 | + /** @var string */ |
|
31 | + private $privateKey; |
|
32 | 32 | |
33 | - /** |
|
34 | - * @param string $publicKey |
|
35 | - * @param string $privateKey |
|
36 | - */ |
|
37 | - public function __construct(string $publicKey, string $privateKey) { |
|
38 | - $this->publicKey = $publicKey; |
|
39 | - $this->privateKey = $privateKey; |
|
40 | - } |
|
33 | + /** |
|
34 | + * @param string $publicKey |
|
35 | + * @param string $privateKey |
|
36 | + */ |
|
37 | + public function __construct(string $publicKey, string $privateKey) { |
|
38 | + $this->publicKey = $publicKey; |
|
39 | + $this->privateKey = $privateKey; |
|
40 | + } |
|
41 | 41 | |
42 | - public function getPrivate(): string { |
|
43 | - return $this->privateKey; |
|
44 | - } |
|
42 | + public function getPrivate(): string { |
|
43 | + return $this->privateKey; |
|
44 | + } |
|
45 | 45 | |
46 | - public function getPublic(): string { |
|
47 | - return $this->publicKey; |
|
48 | - } |
|
46 | + public function getPublic(): string { |
|
47 | + return $this->publicKey; |
|
48 | + } |
|
49 | 49 | } |
@@ -30,30 +30,30 @@ |
||
30 | 30 | * Delete the admin|personal sections and settings tables |
31 | 31 | */ |
32 | 32 | class Version14000Date20180129121024 extends SimpleMigrationStep { |
33 | - public function name(): string { |
|
34 | - return 'Drop obsolete settings tables'; |
|
35 | - } |
|
33 | + public function name(): string { |
|
34 | + return 'Drop obsolete settings tables'; |
|
35 | + } |
|
36 | 36 | |
37 | - public function description(): string { |
|
38 | - return 'Drops the following obsolete tables: "admin_sections", "admin_settings", "personal_sections" and "personal_settings"'; |
|
39 | - } |
|
37 | + public function description(): string { |
|
38 | + return 'Drops the following obsolete tables: "admin_sections", "admin_settings", "personal_sections" and "personal_settings"'; |
|
39 | + } |
|
40 | 40 | |
41 | - /** |
|
42 | - * @param IOutput $output |
|
43 | - * @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
44 | - * @param array $options |
|
45 | - * @return null|ISchemaWrapper |
|
46 | - * @since 13.0.0 |
|
47 | - */ |
|
48 | - public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) { |
|
49 | - /** @var ISchemaWrapper $schema */ |
|
50 | - $schema = $schemaClosure(); |
|
41 | + /** |
|
42 | + * @param IOutput $output |
|
43 | + * @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
44 | + * @param array $options |
|
45 | + * @return null|ISchemaWrapper |
|
46 | + * @since 13.0.0 |
|
47 | + */ |
|
48 | + public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) { |
|
49 | + /** @var ISchemaWrapper $schema */ |
|
50 | + $schema = $schemaClosure(); |
|
51 | 51 | |
52 | - $schema->dropTable('admin_sections'); |
|
53 | - $schema->dropTable('admin_settings'); |
|
54 | - $schema->dropTable('personal_sections'); |
|
55 | - $schema->dropTable('personal_settings'); |
|
52 | + $schema->dropTable('admin_sections'); |
|
53 | + $schema->dropTable('admin_settings'); |
|
54 | + $schema->dropTable('personal_sections'); |
|
55 | + $schema->dropTable('personal_settings'); |
|
56 | 56 | |
57 | - return $schema; |
|
58 | - } |
|
57 | + return $schema; |
|
58 | + } |
|
59 | 59 | } |
@@ -25,9 +25,9 @@ |
||
25 | 25 | namespace OCA\DAV\Direct; |
26 | 26 | |
27 | 27 | class Server extends \Sabre\DAV\Server { |
28 | - public function __construct($treeOrNode = null) { |
|
29 | - parent::__construct($treeOrNode); |
|
30 | - self::$exposeVersion = false; |
|
31 | - $this->enablePropfindDepthInfinityf = false; |
|
32 | - } |
|
28 | + public function __construct($treeOrNode = null) { |
|
29 | + parent::__construct($treeOrNode); |
|
30 | + self::$exposeVersion = false; |
|
31 | + $this->enablePropfindDepthInfinityf = false; |
|
32 | + } |
|
33 | 33 | } |
@@ -37,22 +37,22 @@ |
||
37 | 37 | * @method void setExpiration(int $expiration) |
38 | 38 | */ |
39 | 39 | class Direct extends Entity { |
40 | - /** @var string */ |
|
41 | - protected $userId; |
|
40 | + /** @var string */ |
|
41 | + protected $userId; |
|
42 | 42 | |
43 | - /** @var int */ |
|
44 | - protected $fileId; |
|
43 | + /** @var int */ |
|
44 | + protected $fileId; |
|
45 | 45 | |
46 | - /** @var string */ |
|
47 | - protected $token; |
|
46 | + /** @var string */ |
|
47 | + protected $token; |
|
48 | 48 | |
49 | - /** @var int */ |
|
50 | - protected $expiration; |
|
49 | + /** @var int */ |
|
50 | + protected $expiration; |
|
51 | 51 | |
52 | - public function __construct() { |
|
53 | - $this->addType('userId', 'string'); |
|
54 | - $this->addType('fileId', 'int'); |
|
55 | - $this->addType('token', 'string'); |
|
56 | - $this->addType('expiration', 'int'); |
|
57 | - } |
|
52 | + public function __construct() { |
|
53 | + $this->addType('userId', 'string'); |
|
54 | + $this->addType('fileId', 'int'); |
|
55 | + $this->addType('token', 'string'); |
|
56 | + $this->addType('expiration', 'int'); |
|
57 | + } |
|
58 | 58 | } |
@@ -36,39 +36,39 @@ |
||
36 | 36 | * Class that will watch filesystem activity and remove previews as needed. |
37 | 37 | */ |
38 | 38 | class Watcher { |
39 | - /** @var IAppData */ |
|
40 | - private $appData; |
|
39 | + /** @var IAppData */ |
|
40 | + private $appData; |
|
41 | 41 | |
42 | - /** |
|
43 | - * Watcher constructor. |
|
44 | - * |
|
45 | - * @param IAppData $appData |
|
46 | - */ |
|
47 | - public function __construct(IAppData $appData) { |
|
48 | - $this->appData = $appData; |
|
49 | - } |
|
42 | + /** |
|
43 | + * Watcher constructor. |
|
44 | + * |
|
45 | + * @param IAppData $appData |
|
46 | + */ |
|
47 | + public function __construct(IAppData $appData) { |
|
48 | + $this->appData = $appData; |
|
49 | + } |
|
50 | 50 | |
51 | - public function postWrite(Node $node) { |
|
52 | - $this->deleteNode($node); |
|
53 | - } |
|
51 | + public function postWrite(Node $node) { |
|
52 | + $this->deleteNode($node); |
|
53 | + } |
|
54 | 54 | |
55 | - protected function deleteNode(Node $node) { |
|
56 | - // We only handle files |
|
57 | - if ($node instanceof Folder) { |
|
58 | - return; |
|
59 | - } |
|
55 | + protected function deleteNode(Node $node) { |
|
56 | + // We only handle files |
|
57 | + if ($node instanceof Folder) { |
|
58 | + return; |
|
59 | + } |
|
60 | 60 | |
61 | - try { |
|
62 | - $folder = $this->appData->getFolder((string)$node->getId()); |
|
63 | - $folder->delete(); |
|
64 | - } catch (NotFoundException $e) { |
|
65 | - //Nothing to do |
|
66 | - } |
|
67 | - } |
|
61 | + try { |
|
62 | + $folder = $this->appData->getFolder((string)$node->getId()); |
|
63 | + $folder->delete(); |
|
64 | + } catch (NotFoundException $e) { |
|
65 | + //Nothing to do |
|
66 | + } |
|
67 | + } |
|
68 | 68 | |
69 | - public function versionRollback(array $data) { |
|
70 | - if (isset($data['node'])) { |
|
71 | - $this->deleteNode($data['node']); |
|
72 | - } |
|
73 | - } |
|
69 | + public function versionRollback(array $data) { |
|
70 | + if (isset($data['node'])) { |
|
71 | + $this->deleteNode($data['node']); |
|
72 | + } |
|
73 | + } |
|
74 | 74 | } |
@@ -25,10 +25,10 @@ |
||
25 | 25 | use OCP\IL10N; |
26 | 26 | |
27 | 27 | class KerberosAuth extends AuthMechanism { |
28 | - public function __construct(IL10N $l) { |
|
29 | - $this |
|
30 | - ->setIdentifier('smb::kerberos') |
|
31 | - ->setScheme(self::SCHEME_SMB) |
|
32 | - ->setText($l->t('Kerberos ticket')); |
|
33 | - } |
|
28 | + public function __construct(IL10N $l) { |
|
29 | + $this |
|
30 | + ->setIdentifier('smb::kerberos') |
|
31 | + ->setScheme(self::SCHEME_SMB) |
|
32 | + ->setText($l->t('Kerberos ticket')); |
|
33 | + } |
|
34 | 34 | } |
@@ -43,77 +43,77 @@ |
||
43 | 43 | * @since 6.0.0 |
44 | 44 | */ |
45 | 45 | interface IL10N { |
46 | - /** |
|
47 | - * Translating |
|
48 | - * @param string $text The text we need a translation for |
|
49 | - * @param array|string $parameters default:array() Parameters for sprintf |
|
50 | - * @return string Translation or the same text |
|
51 | - * |
|
52 | - * Returns the translation. If no translation is found, $text will be |
|
53 | - * returned. |
|
54 | - * @since 6.0.0 |
|
55 | - */ |
|
56 | - public function t(string $text, $parameters = []): string; |
|
46 | + /** |
|
47 | + * Translating |
|
48 | + * @param string $text The text we need a translation for |
|
49 | + * @param array|string $parameters default:array() Parameters for sprintf |
|
50 | + * @return string Translation or the same text |
|
51 | + * |
|
52 | + * Returns the translation. If no translation is found, $text will be |
|
53 | + * returned. |
|
54 | + * @since 6.0.0 |
|
55 | + */ |
|
56 | + public function t(string $text, $parameters = []): string; |
|
57 | 57 | |
58 | - /** |
|
59 | - * Translating |
|
60 | - * @param string $text_singular the string to translate for exactly one object |
|
61 | - * @param string $text_plural the string to translate for n objects |
|
62 | - * @param integer $count Number of objects |
|
63 | - * @param array $parameters default:array() Parameters for sprintf |
|
64 | - * @return string Translation or the same text |
|
65 | - * |
|
66 | - * Returns the translation. If no translation is found, $text will be |
|
67 | - * returned. %n will be replaced with the number of objects. |
|
68 | - * |
|
69 | - * The correct plural is determined by the plural_forms-function |
|
70 | - * provided by the po file. |
|
71 | - * @since 6.0.0 |
|
72 | - * |
|
73 | - */ |
|
74 | - public function n(string $text_singular, string $text_plural, int $count, array $parameters = []): string; |
|
58 | + /** |
|
59 | + * Translating |
|
60 | + * @param string $text_singular the string to translate for exactly one object |
|
61 | + * @param string $text_plural the string to translate for n objects |
|
62 | + * @param integer $count Number of objects |
|
63 | + * @param array $parameters default:array() Parameters for sprintf |
|
64 | + * @return string Translation or the same text |
|
65 | + * |
|
66 | + * Returns the translation. If no translation is found, $text will be |
|
67 | + * returned. %n will be replaced with the number of objects. |
|
68 | + * |
|
69 | + * The correct plural is determined by the plural_forms-function |
|
70 | + * provided by the po file. |
|
71 | + * @since 6.0.0 |
|
72 | + * |
|
73 | + */ |
|
74 | + public function n(string $text_singular, string $text_plural, int $count, array $parameters = []): string; |
|
75 | 75 | |
76 | - /** |
|
77 | - * Localization |
|
78 | - * @param string $type Type of localization |
|
79 | - * @param \DateTime|int|string $data parameters for this localization |
|
80 | - * @param array $options currently supports following options: |
|
81 | - * - 'width': handed into \Punic\Calendar::formatDate as second parameter |
|
82 | - * @return string|int|false |
|
83 | - * |
|
84 | - * Returns the localized data. |
|
85 | - * |
|
86 | - * Implemented types: |
|
87 | - * - date |
|
88 | - * - Creates a date |
|
89 | - * - l10n-field: date |
|
90 | - * - params: timestamp (int/string) |
|
91 | - * - datetime |
|
92 | - * - Creates date and time |
|
93 | - * - l10n-field: datetime |
|
94 | - * - params: timestamp (int/string) |
|
95 | - * - time |
|
96 | - * - Creates a time |
|
97 | - * - l10n-field: time |
|
98 | - * - params: timestamp (int/string) |
|
99 | - * @since 6.0.0 - parameter $options was added in 8.0.0 |
|
100 | - */ |
|
101 | - public function l(string $type, $data, array $options = []); |
|
76 | + /** |
|
77 | + * Localization |
|
78 | + * @param string $type Type of localization |
|
79 | + * @param \DateTime|int|string $data parameters for this localization |
|
80 | + * @param array $options currently supports following options: |
|
81 | + * - 'width': handed into \Punic\Calendar::formatDate as second parameter |
|
82 | + * @return string|int|false |
|
83 | + * |
|
84 | + * Returns the localized data. |
|
85 | + * |
|
86 | + * Implemented types: |
|
87 | + * - date |
|
88 | + * - Creates a date |
|
89 | + * - l10n-field: date |
|
90 | + * - params: timestamp (int/string) |
|
91 | + * - datetime |
|
92 | + * - Creates date and time |
|
93 | + * - l10n-field: datetime |
|
94 | + * - params: timestamp (int/string) |
|
95 | + * - time |
|
96 | + * - Creates a time |
|
97 | + * - l10n-field: time |
|
98 | + * - params: timestamp (int/string) |
|
99 | + * @since 6.0.0 - parameter $options was added in 8.0.0 |
|
100 | + */ |
|
101 | + public function l(string $type, $data, array $options = []); |
|
102 | 102 | |
103 | 103 | |
104 | - /** |
|
105 | - * The code (en, de, ...) of the language that is used for this IL10N object |
|
106 | - * |
|
107 | - * @return string language |
|
108 | - * @since 7.0.0 |
|
109 | - */ |
|
110 | - public function getLanguageCode(): string ; |
|
104 | + /** |
|
105 | + * The code (en, de, ...) of the language that is used for this IL10N object |
|
106 | + * |
|
107 | + * @return string language |
|
108 | + * @since 7.0.0 |
|
109 | + */ |
|
110 | + public function getLanguageCode(): string ; |
|
111 | 111 | |
112 | - /** |
|
113 | - * * The code (en_US, fr_CA, ...) of the locale that is used for this IL10N object |
|
114 | - * |
|
115 | - * @return string locale |
|
116 | - * @since 14.0.0 |
|
117 | - */ |
|
118 | - public function getLocaleCode(): string; |
|
112 | + /** |
|
113 | + * * The code (en_US, fr_CA, ...) of the locale that is used for this IL10N object |
|
114 | + * |
|
115 | + * @return string locale |
|
116 | + * @since 14.0.0 |
|
117 | + */ |
|
118 | + public function getLocaleCode(): string; |
|
119 | 119 | } |