@@ -42,15 +42,15 @@ |
||
42 | 42 | */ |
43 | 43 | interface IComplexOperation extends IOperation { |
44 | 44 | |
45 | - /** |
|
46 | - * As IComplexOperation chooses the triggering events itself, a hint has |
|
47 | - * to be shown to the user so make clear when this operation is becoming |
|
48 | - * active. This method returns such a translated string. |
|
49 | - * |
|
50 | - * Example: "When a file is accessed" (en) |
|
51 | - * |
|
52 | - * @since 18.0.0 |
|
53 | - */ |
|
54 | - public function getTriggerHint(): string; |
|
45 | + /** |
|
46 | + * As IComplexOperation chooses the triggering events itself, a hint has |
|
47 | + * to be shown to the user so make clear when this operation is becoming |
|
48 | + * active. This method returns such a translated string. |
|
49 | + * |
|
50 | + * Example: "When a file is accessed" (en) |
|
51 | + * |
|
52 | + * @since 18.0.0 |
|
53 | + */ |
|
54 | + public function getTriggerHint(): string; |
|
55 | 55 | |
56 | 56 | } |
@@ -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 | } |
@@ -39,12 +39,12 @@ |
||
39 | 39 | */ |
40 | 40 | interface ISpecificOperation extends IOperation { |
41 | 41 | |
42 | - /** |
|
43 | - * returns the id of the entity the operator is designed for |
|
44 | - * |
|
45 | - * Example: 'WorkflowEngine_Entity_File' |
|
46 | - * |
|
47 | - * @since 18.0.0 |
|
48 | - */ |
|
49 | - public function getEntityId():string; |
|
42 | + /** |
|
43 | + * returns the id of the entity the operator is designed for |
|
44 | + * |
|
45 | + * Example: 'WorkflowEngine_Entity_File' |
|
46 | + * |
|
47 | + * @since 18.0.0 |
|
48 | + */ |
|
49 | + public function getEntityId():string; |
|
50 | 50 | } |
@@ -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 |
@@ -33,21 +33,21 @@ |
||
33 | 33 | */ |
34 | 34 | class AddContentSecurityPolicyEvent extends Event { |
35 | 35 | |
36 | - /** @var ContentSecurityPolicyManager */ |
|
37 | - private $policyManager; |
|
36 | + /** @var ContentSecurityPolicyManager */ |
|
37 | + private $policyManager; |
|
38 | 38 | |
39 | - /** |
|
40 | - * @since 17.0.0 |
|
41 | - */ |
|
42 | - public function __construct(ContentSecurityPolicyManager $policyManager) { |
|
43 | - parent::__construct(); |
|
44 | - $this->policyManager = $policyManager; |
|
45 | - } |
|
39 | + /** |
|
40 | + * @since 17.0.0 |
|
41 | + */ |
|
42 | + public function __construct(ContentSecurityPolicyManager $policyManager) { |
|
43 | + parent::__construct(); |
|
44 | + $this->policyManager = $policyManager; |
|
45 | + } |
|
46 | 46 | |
47 | - /** |
|
48 | - * @since 17.0.0 |
|
49 | - */ |
|
50 | - public function addPolicy(EmptyContentSecurityPolicy $csp): void { |
|
51 | - $this->policyManager->addDefaultPolicy($csp); |
|
52 | - } |
|
47 | + /** |
|
48 | + * @since 17.0.0 |
|
49 | + */ |
|
50 | + public function addPolicy(EmptyContentSecurityPolicy $csp): void { |
|
51 | + $this->policyManager->addDefaultPolicy($csp); |
|
52 | + } |
|
53 | 53 | } |
@@ -33,21 +33,21 @@ |
||
33 | 33 | */ |
34 | 34 | class AddFeaturePolicyEvent extends Event { |
35 | 35 | |
36 | - /** @var FeaturePolicyManager */ |
|
37 | - private $policyManager; |
|
36 | + /** @var FeaturePolicyManager */ |
|
37 | + private $policyManager; |
|
38 | 38 | |
39 | - /** |
|
40 | - * @since 17.0.0 |
|
41 | - */ |
|
42 | - public function __construct(FeaturePolicyManager $policyManager) { |
|
43 | - parent::__construct(); |
|
44 | - $this->policyManager = $policyManager; |
|
45 | - } |
|
39 | + /** |
|
40 | + * @since 17.0.0 |
|
41 | + */ |
|
42 | + public function __construct(FeaturePolicyManager $policyManager) { |
|
43 | + parent::__construct(); |
|
44 | + $this->policyManager = $policyManager; |
|
45 | + } |
|
46 | 46 | |
47 | - /** |
|
48 | - * @since 17.0.0 |
|
49 | - */ |
|
50 | - public function addPolicy(EmptyFeaturePolicy $policy) { |
|
51 | - $this->policyManager->addDefaultPolicy($policy); |
|
52 | - } |
|
47 | + /** |
|
48 | + * @since 17.0.0 |
|
49 | + */ |
|
50 | + public function addPolicy(EmptyFeaturePolicy $policy) { |
|
51 | + $this->policyManager->addDefaultPolicy($policy); |
|
52 | + } |
|
53 | 53 | } |
@@ -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 | } |