@@ -34,21 +34,21 @@ |
||
34 | 34 | * @since 18.0.0 |
35 | 35 | */ |
36 | 36 | interface IEntityCheck { |
37 | - /** |
|
38 | - * Equips the check with a subject fitting the Entity. For instance, an |
|
39 | - * entity of File will receive an instance of OCP\Files\Node, or a comment |
|
40 | - * entity might get an IComment. |
|
41 | - * |
|
42 | - * The implementing check must be aware of the incoming type. |
|
43 | - * |
|
44 | - * If an unsupported subject is passed the implementation MAY throw an |
|
45 | - * \UnexpectedValueException. |
|
46 | - * |
|
47 | - * @param IEntity $entity |
|
48 | - * @param mixed $subject |
|
49 | - * @throws \UnexpectedValueException |
|
50 | - * @since 18.0.0 |
|
51 | - */ |
|
52 | - public function setEntitySubject(IEntity $entity, $subject): void; |
|
37 | + /** |
|
38 | + * Equips the check with a subject fitting the Entity. For instance, an |
|
39 | + * entity of File will receive an instance of OCP\Files\Node, or a comment |
|
40 | + * entity might get an IComment. |
|
41 | + * |
|
42 | + * The implementing check must be aware of the incoming type. |
|
43 | + * |
|
44 | + * If an unsupported subject is passed the implementation MAY throw an |
|
45 | + * \UnexpectedValueException. |
|
46 | + * |
|
47 | + * @param IEntity $entity |
|
48 | + * @param mixed $subject |
|
49 | + * @throws \UnexpectedValueException |
|
50 | + * @since 18.0.0 |
|
51 | + */ |
|
52 | + public function setEntitySubject(IEntity $entity, $subject): void; |
|
53 | 53 | |
54 | 54 | } |
@@ -31,43 +31,43 @@ |
||
31 | 31 | * @since 9.1 |
32 | 32 | */ |
33 | 33 | interface ICheck { |
34 | - /** |
|
35 | - * @param string $operator |
|
36 | - * @param string $value |
|
37 | - * @return bool |
|
38 | - * @since 9.1 |
|
39 | - */ |
|
40 | - public function executeCheck($operator, $value); |
|
34 | + /** |
|
35 | + * @param string $operator |
|
36 | + * @param string $value |
|
37 | + * @return bool |
|
38 | + * @since 9.1 |
|
39 | + */ |
|
40 | + public function executeCheck($operator, $value); |
|
41 | 41 | |
42 | - /** |
|
43 | - * @param string $operator |
|
44 | - * @param string $value |
|
45 | - * @throws \UnexpectedValueException |
|
46 | - * @since 9.1 |
|
47 | - */ |
|
48 | - public function validateCheck($operator, $value); |
|
42 | + /** |
|
43 | + * @param string $operator |
|
44 | + * @param string $value |
|
45 | + * @throws \UnexpectedValueException |
|
46 | + * @since 9.1 |
|
47 | + */ |
|
48 | + public function validateCheck($operator, $value); |
|
49 | 49 | |
50 | - /** |
|
51 | - * returns a list of Entities the checker supports. The values must match |
|
52 | - * the class name of the entity. |
|
53 | - * |
|
54 | - * An empty result means the check is universally available. |
|
55 | - * |
|
56 | - * @since 18.0.0 |
|
57 | - */ |
|
58 | - public function supportedEntities(): array; |
|
50 | + /** |
|
51 | + * returns a list of Entities the checker supports. The values must match |
|
52 | + * the class name of the entity. |
|
53 | + * |
|
54 | + * An empty result means the check is universally available. |
|
55 | + * |
|
56 | + * @since 18.0.0 |
|
57 | + */ |
|
58 | + public function supportedEntities(): array; |
|
59 | 59 | |
60 | - /** |
|
61 | - * returns whether the operation can be used in the requested scope. |
|
62 | - * |
|
63 | - * Scope IDs are defined as constants in OCP\WorkflowEngine\IManager. At |
|
64 | - * time of writing these are SCOPE_ADMIN and SCOPE_USER. |
|
65 | - * |
|
66 | - * For possibly unknown future scopes the recommended behaviour is: if |
|
67 | - * user scope is permitted, the default behaviour should return `true`, |
|
68 | - * otherwise `false`. |
|
69 | - * |
|
70 | - * @since 18.0.0 |
|
71 | - */ |
|
72 | - public function isAvailableForScope(int $scope): bool; |
|
60 | + /** |
|
61 | + * returns whether the operation can be used in the requested scope. |
|
62 | + * |
|
63 | + * Scope IDs are defined as constants in OCP\WorkflowEngine\IManager. At |
|
64 | + * time of writing these are SCOPE_ADMIN and SCOPE_USER. |
|
65 | + * |
|
66 | + * For possibly unknown future scopes the recommended behaviour is: if |
|
67 | + * user scope is permitted, the default behaviour should return `true`, |
|
68 | + * otherwise `false`. |
|
69 | + * |
|
70 | + * @since 18.0.0 |
|
71 | + */ |
|
72 | + public function isAvailableForScope(int $scope): bool; |
|
73 | 73 | } |
@@ -34,21 +34,21 @@ |
||
34 | 34 | * @since 18.0.0 |
35 | 35 | */ |
36 | 36 | interface IEntityEvent { |
37 | - /** |
|
38 | - * returns a translated name to be presented in the web interface. |
|
39 | - * |
|
40 | - * Example: "created" (en), "kreita" (eo) |
|
41 | - * |
|
42 | - * @since 18.0.0 |
|
43 | - */ |
|
44 | - public function getDisplayName(): string; |
|
37 | + /** |
|
38 | + * returns a translated name to be presented in the web interface. |
|
39 | + * |
|
40 | + * Example: "created" (en), "kreita" (eo) |
|
41 | + * |
|
42 | + * @since 18.0.0 |
|
43 | + */ |
|
44 | + public function getDisplayName(): string; |
|
45 | 45 | |
46 | - /** |
|
47 | - * returns the event name that is emitted by the EventDispatcher, e.g.: |
|
48 | - * |
|
49 | - * Example: "OCA\MyApp\Factory\Cats::postCreated" |
|
50 | - * |
|
51 | - * @since 18.0.0 |
|
52 | - */ |
|
53 | - public function getEventName(): string; |
|
46 | + /** |
|
47 | + * returns the event name that is emitted by the EventDispatcher, e.g.: |
|
48 | + * |
|
49 | + * Example: "OCA\MyApp\Factory\Cats::postCreated" |
|
50 | + * |
|
51 | + * @since 18.0.0 |
|
52 | + */ |
|
53 | + public function getEventName(): string; |
|
54 | 54 | } |
@@ -21,12 +21,12 @@ |
||
21 | 21 | */ |
22 | 22 | // @codeCoverageIgnoreStart |
23 | 23 | return [ |
24 | - 'routes' => [ |
|
25 | - [ |
|
26 | - 'name' => 'settings#createCodes', |
|
27 | - 'url' => '/settings/create', |
|
28 | - 'verb' => 'POST' |
|
29 | - ], |
|
30 | - ] |
|
24 | + 'routes' => [ |
|
25 | + [ |
|
26 | + 'name' => 'settings#createCodes', |
|
27 | + 'url' => '/settings/create', |
|
28 | + 'verb' => 'POST' |
|
29 | + ], |
|
30 | + ] |
|
31 | 31 | ]; |
32 | 32 | // @codeCoverageIgnoreEnd |
@@ -32,25 +32,25 @@ |
||
32 | 32 | |
33 | 33 | class LegacyLoadAdditionalScriptsAdapter implements IEventListener { |
34 | 34 | |
35 | - /** @var SymfonyAdapter */ |
|
36 | - private $dispatcher; |
|
37 | - |
|
38 | - public function __construct(SymfonyAdapter $dispatcher) { |
|
39 | - $this->dispatcher = $dispatcher; |
|
40 | - } |
|
41 | - |
|
42 | - public function handle(Event $event): void { |
|
43 | - if (!($event instanceof LoadAdditionalScriptsEvent)) { |
|
44 | - return; |
|
45 | - } |
|
46 | - |
|
47 | - $legacyEvent = new GenericEvent(null, ['hiddenFields' => []]); |
|
48 | - $this->dispatcher->dispatch('OCA\Files::loadAdditionalScripts', $legacyEvent); |
|
49 | - |
|
50 | - $hiddenFields = $legacyEvent->getArgument('hiddenFields'); |
|
51 | - foreach ($hiddenFields as $name => $value) { |
|
52 | - $event->addHiddenField($name, $value); |
|
53 | - } |
|
54 | - } |
|
35 | + /** @var SymfonyAdapter */ |
|
36 | + private $dispatcher; |
|
37 | + |
|
38 | + public function __construct(SymfonyAdapter $dispatcher) { |
|
39 | + $this->dispatcher = $dispatcher; |
|
40 | + } |
|
41 | + |
|
42 | + public function handle(Event $event): void { |
|
43 | + if (!($event instanceof LoadAdditionalScriptsEvent)) { |
|
44 | + return; |
|
45 | + } |
|
46 | + |
|
47 | + $legacyEvent = new GenericEvent(null, ['hiddenFields' => []]); |
|
48 | + $this->dispatcher->dispatch('OCA\Files::loadAdditionalScripts', $legacyEvent); |
|
49 | + |
|
50 | + $hiddenFields = $legacyEvent->getArgument('hiddenFields'); |
|
51 | + foreach ($hiddenFields as $name => $value) { |
|
52 | + $event->addHiddenField($name, $value); |
|
53 | + } |
|
54 | + } |
|
55 | 55 | |
56 | 56 | } |
@@ -34,27 +34,27 @@ |
||
34 | 34 | |
35 | 35 | class TwoFactorSettingsController extends Controller { |
36 | 36 | |
37 | - /** @var MandatoryTwoFactor */ |
|
38 | - private $mandatoryTwoFactor; |
|
37 | + /** @var MandatoryTwoFactor */ |
|
38 | + private $mandatoryTwoFactor; |
|
39 | 39 | |
40 | - public function __construct(string $appName, |
|
41 | - IRequest $request, |
|
42 | - MandatoryTwoFactor $mandatoryTwoFactor) { |
|
43 | - parent::__construct($appName, $request); |
|
40 | + public function __construct(string $appName, |
|
41 | + IRequest $request, |
|
42 | + MandatoryTwoFactor $mandatoryTwoFactor) { |
|
43 | + parent::__construct($appName, $request); |
|
44 | 44 | |
45 | - $this->mandatoryTwoFactor = $mandatoryTwoFactor; |
|
46 | - } |
|
45 | + $this->mandatoryTwoFactor = $mandatoryTwoFactor; |
|
46 | + } |
|
47 | 47 | |
48 | - public function index(): JSONResponse { |
|
49 | - return new JSONResponse($this->mandatoryTwoFactor->getState()); |
|
50 | - } |
|
48 | + public function index(): JSONResponse { |
|
49 | + return new JSONResponse($this->mandatoryTwoFactor->getState()); |
|
50 | + } |
|
51 | 51 | |
52 | - public function update(bool $enforced, array $enforcedGroups = [], array $excludedGroups = []): JSONResponse { |
|
53 | - $this->mandatoryTwoFactor->setState( |
|
54 | - new EnforcementState($enforced, $enforcedGroups, $excludedGroups) |
|
55 | - ); |
|
52 | + public function update(bool $enforced, array $enforcedGroups = [], array $excludedGroups = []): JSONResponse { |
|
53 | + $this->mandatoryTwoFactor->setState( |
|
54 | + new EnforcementState($enforced, $enforcedGroups, $excludedGroups) |
|
55 | + ); |
|
56 | 56 | |
57 | - return new JSONResponse($this->mandatoryTwoFactor->getState()); |
|
58 | - } |
|
57 | + return new JSONResponse($this->mandatoryTwoFactor->getState()); |
|
58 | + } |
|
59 | 59 | |
60 | 60 | } |
@@ -26,71 +26,71 @@ |
||
26 | 26 | |
27 | 27 | class Setting implements ISetting { |
28 | 28 | |
29 | - /** @var IL10N */ |
|
30 | - protected $l; |
|
29 | + /** @var IL10N */ |
|
30 | + protected $l; |
|
31 | 31 | |
32 | - /** |
|
33 | - * @param IL10N $l10n |
|
34 | - */ |
|
35 | - public function __construct(IL10N $l10n) { |
|
36 | - $this->l = $l10n; |
|
37 | - } |
|
32 | + /** |
|
33 | + * @param IL10N $l10n |
|
34 | + */ |
|
35 | + public function __construct(IL10N $l10n) { |
|
36 | + $this->l = $l10n; |
|
37 | + } |
|
38 | 38 | |
39 | - /** |
|
40 | - * @return string Lowercase a-z and underscore only identifier |
|
41 | - * @since 11.0.0 |
|
42 | - */ |
|
43 | - public function getIdentifier() { |
|
44 | - return 'personal_settings'; |
|
45 | - } |
|
39 | + /** |
|
40 | + * @return string Lowercase a-z and underscore only identifier |
|
41 | + * @since 11.0.0 |
|
42 | + */ |
|
43 | + public function getIdentifier() { |
|
44 | + return 'personal_settings'; |
|
45 | + } |
|
46 | 46 | |
47 | - /** |
|
48 | - * @return string A translated string |
|
49 | - * @since 11.0.0 |
|
50 | - */ |
|
51 | - public function getName() { |
|
52 | - return $this->l->t('Your <strong>password</strong> or <strong>email</strong> was modified'); |
|
53 | - } |
|
47 | + /** |
|
48 | + * @return string A translated string |
|
49 | + * @since 11.0.0 |
|
50 | + */ |
|
51 | + public function getName() { |
|
52 | + return $this->l->t('Your <strong>password</strong> or <strong>email</strong> was modified'); |
|
53 | + } |
|
54 | 54 | |
55 | - /** |
|
56 | - * @return int whether the filter should be rather on the top or bottom of |
|
57 | - * the admin section. The filters are arranged in ascending order of the |
|
58 | - * priority values. It is required to return a value between 0 and 100. |
|
59 | - * @since 11.0.0 |
|
60 | - */ |
|
61 | - public function getPriority() { |
|
62 | - return 0; |
|
63 | - } |
|
55 | + /** |
|
56 | + * @return int whether the filter should be rather on the top or bottom of |
|
57 | + * the admin section. The filters are arranged in ascending order of the |
|
58 | + * priority values. It is required to return a value between 0 and 100. |
|
59 | + * @since 11.0.0 |
|
60 | + */ |
|
61 | + public function getPriority() { |
|
62 | + return 0; |
|
63 | + } |
|
64 | 64 | |
65 | - /** |
|
66 | - * @return bool True when the option can be changed for the stream |
|
67 | - * @since 11.0.0 |
|
68 | - */ |
|
69 | - public function canChangeStream() { |
|
70 | - return false; |
|
71 | - } |
|
65 | + /** |
|
66 | + * @return bool True when the option can be changed for the stream |
|
67 | + * @since 11.0.0 |
|
68 | + */ |
|
69 | + public function canChangeStream() { |
|
70 | + return false; |
|
71 | + } |
|
72 | 72 | |
73 | - /** |
|
74 | - * @return bool True when the option can be changed for the stream |
|
75 | - * @since 11.0.0 |
|
76 | - */ |
|
77 | - public function isDefaultEnabledStream() { |
|
78 | - return true; |
|
79 | - } |
|
73 | + /** |
|
74 | + * @return bool True when the option can be changed for the stream |
|
75 | + * @since 11.0.0 |
|
76 | + */ |
|
77 | + public function isDefaultEnabledStream() { |
|
78 | + return true; |
|
79 | + } |
|
80 | 80 | |
81 | - /** |
|
82 | - * @return bool True when the option can be changed for the mail |
|
83 | - * @since 11.0.0 |
|
84 | - */ |
|
85 | - public function canChangeMail() { |
|
86 | - return false; |
|
87 | - } |
|
81 | + /** |
|
82 | + * @return bool True when the option can be changed for the mail |
|
83 | + * @since 11.0.0 |
|
84 | + */ |
|
85 | + public function canChangeMail() { |
|
86 | + return false; |
|
87 | + } |
|
88 | 88 | |
89 | - /** |
|
90 | - * @return bool True when the option can be changed for the stream |
|
91 | - * @since 11.0.0 |
|
92 | - */ |
|
93 | - public function isDefaultEnabledMail() { |
|
94 | - return false; |
|
95 | - } |
|
89 | + /** |
|
90 | + * @return bool True when the option can be changed for the stream |
|
91 | + * @since 11.0.0 |
|
92 | + */ |
|
93 | + public function isDefaultEnabledMail() { |
|
94 | + return false; |
|
95 | + } |
|
96 | 96 | } |
@@ -28,39 +28,39 @@ |
||
28 | 28 | |
29 | 29 | class SecurityFilter implements IFilter { |
30 | 30 | |
31 | - /** @var IURLGenerator */ |
|
32 | - private $urlGenerator; |
|
31 | + /** @var IURLGenerator */ |
|
32 | + private $urlGenerator; |
|
33 | 33 | |
34 | - /** @var IL10N */ |
|
35 | - private $l10n; |
|
34 | + /** @var IL10N */ |
|
35 | + private $l10n; |
|
36 | 36 | |
37 | - public function __construct(IURLGenerator $urlGenerator, IL10N $l10n) { |
|
38 | - $this->urlGenerator = $urlGenerator; |
|
39 | - $this->l10n = $l10n; |
|
40 | - } |
|
37 | + public function __construct(IURLGenerator $urlGenerator, IL10N $l10n) { |
|
38 | + $this->urlGenerator = $urlGenerator; |
|
39 | + $this->l10n = $l10n; |
|
40 | + } |
|
41 | 41 | |
42 | - public function allowedApps() { |
|
43 | - return []; |
|
44 | - } |
|
42 | + public function allowedApps() { |
|
43 | + return []; |
|
44 | + } |
|
45 | 45 | |
46 | - public function filterTypes(array $types) { |
|
47 | - return array_intersect(['security'], $types); |
|
48 | - } |
|
46 | + public function filterTypes(array $types) { |
|
47 | + return array_intersect(['security'], $types); |
|
48 | + } |
|
49 | 49 | |
50 | - public function getIcon() { |
|
51 | - return $this->urlGenerator->getAbsoluteURL($this->urlGenerator->imagePath('core', 'actions/password.svg')); |
|
52 | - } |
|
50 | + public function getIcon() { |
|
51 | + return $this->urlGenerator->getAbsoluteURL($this->urlGenerator->imagePath('core', 'actions/password.svg')); |
|
52 | + } |
|
53 | 53 | |
54 | - public function getIdentifier() { |
|
55 | - return 'security'; |
|
56 | - } |
|
54 | + public function getIdentifier() { |
|
55 | + return 'security'; |
|
56 | + } |
|
57 | 57 | |
58 | - public function getName() { |
|
59 | - return $this->l10n->t('Security'); |
|
60 | - } |
|
58 | + public function getName() { |
|
59 | + return $this->l10n->t('Security'); |
|
60 | + } |
|
61 | 61 | |
62 | - public function getPriority() { |
|
63 | - return 30; |
|
64 | - } |
|
62 | + public function getPriority() { |
|
63 | + return 30; |
|
64 | + } |
|
65 | 65 | |
66 | 66 | } |
@@ -27,39 +27,39 @@ |
||
27 | 27 | |
28 | 28 | class SecuritySetting implements ISetting { |
29 | 29 | |
30 | - /** @var IL10N */ |
|
31 | - private $l10n; |
|
30 | + /** @var IL10N */ |
|
31 | + private $l10n; |
|
32 | 32 | |
33 | - public function __construct(IL10N $l10n) { |
|
34 | - $this->l10n = $l10n; |
|
35 | - } |
|
33 | + public function __construct(IL10N $l10n) { |
|
34 | + $this->l10n = $l10n; |
|
35 | + } |
|
36 | 36 | |
37 | - public function canChangeMail() { |
|
38 | - return false; |
|
39 | - } |
|
37 | + public function canChangeMail() { |
|
38 | + return false; |
|
39 | + } |
|
40 | 40 | |
41 | - public function canChangeStream() { |
|
42 | - return false; |
|
43 | - } |
|
41 | + public function canChangeStream() { |
|
42 | + return false; |
|
43 | + } |
|
44 | 44 | |
45 | - public function getIdentifier() { |
|
46 | - return 'security'; |
|
47 | - } |
|
45 | + public function getIdentifier() { |
|
46 | + return 'security'; |
|
47 | + } |
|
48 | 48 | |
49 | - public function getName() { |
|
50 | - return $this->l10n->t('Security'); |
|
51 | - } |
|
49 | + public function getName() { |
|
50 | + return $this->l10n->t('Security'); |
|
51 | + } |
|
52 | 52 | |
53 | - public function getPriority() { |
|
54 | - return 30; |
|
55 | - } |
|
53 | + public function getPriority() { |
|
54 | + return 30; |
|
55 | + } |
|
56 | 56 | |
57 | - public function isDefaultEnabledMail() { |
|
58 | - return true; |
|
59 | - } |
|
57 | + public function isDefaultEnabledMail() { |
|
58 | + return true; |
|
59 | + } |
|
60 | 60 | |
61 | - public function isDefaultEnabledStream() { |
|
62 | - return true; |
|
63 | - } |
|
61 | + public function isDefaultEnabledStream() { |
|
62 | + return true; |
|
63 | + } |
|
64 | 64 | |
65 | 65 | } |