@@ -32,6 +32,6 @@ |
||
32 | 32 | */ |
33 | 33 | class AudioProvider extends PushProvider { |
34 | 34 | |
35 | - /** @var string */ |
|
36 | - public const NOTIFICATION_TYPE = 'AUDIO'; |
|
35 | + /** @var string */ |
|
36 | + public const NOTIFICATION_TYPE = 'AUDIO'; |
|
37 | 37 | } |
@@ -31,91 +31,91 @@ |
||
31 | 31 | |
32 | 32 | class FileSize implements ICheck { |
33 | 33 | |
34 | - /** @var int */ |
|
35 | - protected $size; |
|
36 | - |
|
37 | - /** @var IL10N */ |
|
38 | - protected $l; |
|
39 | - |
|
40 | - /** @var IRequest */ |
|
41 | - protected $request; |
|
42 | - |
|
43 | - /** |
|
44 | - * @param IL10N $l |
|
45 | - * @param IRequest $request |
|
46 | - */ |
|
47 | - public function __construct(IL10N $l, IRequest $request) { |
|
48 | - $this->l = $l; |
|
49 | - $this->request = $request; |
|
50 | - } |
|
51 | - |
|
52 | - /** |
|
53 | - * @param string $operator |
|
54 | - * @param string $value |
|
55 | - * @return bool |
|
56 | - */ |
|
57 | - public function executeCheck($operator, $value) { |
|
58 | - $size = $this->getFileSizeFromHeader(); |
|
59 | - |
|
60 | - $value = Util::computerFileSize($value); |
|
61 | - if ($size !== false) { |
|
62 | - switch ($operator) { |
|
63 | - case 'less': |
|
64 | - return $size < $value; |
|
65 | - case '!less': |
|
66 | - return $size >= $value; |
|
67 | - case 'greater': |
|
68 | - return $size > $value; |
|
69 | - case '!greater': |
|
70 | - return $size <= $value; |
|
71 | - } |
|
72 | - } |
|
73 | - return false; |
|
74 | - } |
|
75 | - |
|
76 | - /** |
|
77 | - * @param string $operator |
|
78 | - * @param string $value |
|
79 | - * @throws \UnexpectedValueException |
|
80 | - */ |
|
81 | - public function validateCheck($operator, $value) { |
|
82 | - if (!in_array($operator, ['less', '!less', 'greater', '!greater'])) { |
|
83 | - throw new \UnexpectedValueException($this->l->t('The given operator is invalid'), 1); |
|
84 | - } |
|
85 | - |
|
86 | - if (!preg_match('/^[0-9]+[ ]?[kmgt]?b$/i', $value)) { |
|
87 | - throw new \UnexpectedValueException($this->l->t('The given file size is invalid'), 2); |
|
88 | - } |
|
89 | - } |
|
90 | - |
|
91 | - /** |
|
92 | - * @return string |
|
93 | - */ |
|
94 | - protected function getFileSizeFromHeader() { |
|
95 | - if ($this->size !== null) { |
|
96 | - return $this->size; |
|
97 | - } |
|
98 | - |
|
99 | - $size = $this->request->getHeader('OC-Total-Length'); |
|
100 | - if ($size === '') { |
|
101 | - if (in_array($this->request->getMethod(), ['POST', 'PUT'])) { |
|
102 | - $size = $this->request->getHeader('Content-Length'); |
|
103 | - } |
|
104 | - } |
|
105 | - |
|
106 | - if ($size === '') { |
|
107 | - $size = false; |
|
108 | - } |
|
109 | - |
|
110 | - $this->size = $size; |
|
111 | - return $this->size; |
|
112 | - } |
|
113 | - |
|
114 | - public function supportedEntities(): array { |
|
115 | - return [ File::class ]; |
|
116 | - } |
|
117 | - |
|
118 | - public function isAvailableForScope(int $scope): bool { |
|
119 | - return true; |
|
120 | - } |
|
34 | + /** @var int */ |
|
35 | + protected $size; |
|
36 | + |
|
37 | + /** @var IL10N */ |
|
38 | + protected $l; |
|
39 | + |
|
40 | + /** @var IRequest */ |
|
41 | + protected $request; |
|
42 | + |
|
43 | + /** |
|
44 | + * @param IL10N $l |
|
45 | + * @param IRequest $request |
|
46 | + */ |
|
47 | + public function __construct(IL10N $l, IRequest $request) { |
|
48 | + $this->l = $l; |
|
49 | + $this->request = $request; |
|
50 | + } |
|
51 | + |
|
52 | + /** |
|
53 | + * @param string $operator |
|
54 | + * @param string $value |
|
55 | + * @return bool |
|
56 | + */ |
|
57 | + public function executeCheck($operator, $value) { |
|
58 | + $size = $this->getFileSizeFromHeader(); |
|
59 | + |
|
60 | + $value = Util::computerFileSize($value); |
|
61 | + if ($size !== false) { |
|
62 | + switch ($operator) { |
|
63 | + case 'less': |
|
64 | + return $size < $value; |
|
65 | + case '!less': |
|
66 | + return $size >= $value; |
|
67 | + case 'greater': |
|
68 | + return $size > $value; |
|
69 | + case '!greater': |
|
70 | + return $size <= $value; |
|
71 | + } |
|
72 | + } |
|
73 | + return false; |
|
74 | + } |
|
75 | + |
|
76 | + /** |
|
77 | + * @param string $operator |
|
78 | + * @param string $value |
|
79 | + * @throws \UnexpectedValueException |
|
80 | + */ |
|
81 | + public function validateCheck($operator, $value) { |
|
82 | + if (!in_array($operator, ['less', '!less', 'greater', '!greater'])) { |
|
83 | + throw new \UnexpectedValueException($this->l->t('The given operator is invalid'), 1); |
|
84 | + } |
|
85 | + |
|
86 | + if (!preg_match('/^[0-9]+[ ]?[kmgt]?b$/i', $value)) { |
|
87 | + throw new \UnexpectedValueException($this->l->t('The given file size is invalid'), 2); |
|
88 | + } |
|
89 | + } |
|
90 | + |
|
91 | + /** |
|
92 | + * @return string |
|
93 | + */ |
|
94 | + protected function getFileSizeFromHeader() { |
|
95 | + if ($this->size !== null) { |
|
96 | + return $this->size; |
|
97 | + } |
|
98 | + |
|
99 | + $size = $this->request->getHeader('OC-Total-Length'); |
|
100 | + if ($size === '') { |
|
101 | + if (in_array($this->request->getMethod(), ['POST', 'PUT'])) { |
|
102 | + $size = $this->request->getHeader('Content-Length'); |
|
103 | + } |
|
104 | + } |
|
105 | + |
|
106 | + if ($size === '') { |
|
107 | + $size = false; |
|
108 | + } |
|
109 | + |
|
110 | + $this->size = $size; |
|
111 | + return $this->size; |
|
112 | + } |
|
113 | + |
|
114 | + public function supportedEntities(): array { |
|
115 | + return [ File::class ]; |
|
116 | + } |
|
117 | + |
|
118 | + public function isAvailableForScope(int $scope): bool { |
|
119 | + return true; |
|
120 | + } |
|
121 | 121 | } |
@@ -31,86 +31,86 @@ |
||
31 | 31 | |
32 | 32 | class UserGroupMembership implements ICheck { |
33 | 33 | |
34 | - /** @var string */ |
|
35 | - protected $cachedUser; |
|
36 | - |
|
37 | - /** @var string[] */ |
|
38 | - protected $cachedGroupMemberships; |
|
39 | - |
|
40 | - /** @var IUserSession */ |
|
41 | - protected $userSession; |
|
42 | - |
|
43 | - /** @var IGroupManager */ |
|
44 | - protected $groupManager; |
|
45 | - |
|
46 | - /** @var IL10N */ |
|
47 | - protected $l; |
|
48 | - |
|
49 | - /** |
|
50 | - * @param IUserSession $userSession |
|
51 | - * @param IGroupManager $groupManager |
|
52 | - * @param IL10N $l |
|
53 | - */ |
|
54 | - public function __construct(IUserSession $userSession, IGroupManager $groupManager, IL10N $l) { |
|
55 | - $this->userSession = $userSession; |
|
56 | - $this->groupManager = $groupManager; |
|
57 | - $this->l = $l; |
|
58 | - } |
|
59 | - |
|
60 | - /** |
|
61 | - * @param string $operator |
|
62 | - * @param string $value |
|
63 | - * @return bool |
|
64 | - */ |
|
65 | - public function executeCheck($operator, $value) { |
|
66 | - $user = $this->userSession->getUser(); |
|
67 | - |
|
68 | - if ($user instanceof IUser) { |
|
69 | - $groupIds = $this->getUserGroups($user); |
|
70 | - return ($operator === 'is') === in_array($value, $groupIds); |
|
71 | - } else { |
|
72 | - return $operator !== 'is'; |
|
73 | - } |
|
74 | - } |
|
75 | - |
|
76 | - |
|
77 | - /** |
|
78 | - * @param string $operator |
|
79 | - * @param string $value |
|
80 | - * @throws \UnexpectedValueException |
|
81 | - */ |
|
82 | - public function validateCheck($operator, $value) { |
|
83 | - if (!in_array($operator, ['is', '!is'])) { |
|
84 | - throw new \UnexpectedValueException($this->l->t('The given operator is invalid'), 1); |
|
85 | - } |
|
86 | - |
|
87 | - if (!$this->groupManager->groupExists($value)) { |
|
88 | - throw new \UnexpectedValueException($this->l->t('The given group does not exist'), 2); |
|
89 | - } |
|
90 | - } |
|
91 | - |
|
92 | - /** |
|
93 | - * @param IUser $user |
|
94 | - * @return string[] |
|
95 | - */ |
|
96 | - protected function getUserGroups(IUser $user) { |
|
97 | - $uid = $user->getUID(); |
|
98 | - |
|
99 | - if ($this->cachedUser !== $uid) { |
|
100 | - $this->cachedUser = $uid; |
|
101 | - $this->cachedGroupMemberships = $this->groupManager->getUserGroupIds($user); |
|
102 | - } |
|
103 | - |
|
104 | - return $this->cachedGroupMemberships; |
|
105 | - } |
|
106 | - |
|
107 | - public function supportedEntities(): array { |
|
108 | - // universal by default |
|
109 | - return []; |
|
110 | - } |
|
111 | - |
|
112 | - public function isAvailableForScope(int $scope): bool { |
|
113 | - // admin only by default |
|
114 | - return $scope === IManager::SCOPE_ADMIN; |
|
115 | - } |
|
34 | + /** @var string */ |
|
35 | + protected $cachedUser; |
|
36 | + |
|
37 | + /** @var string[] */ |
|
38 | + protected $cachedGroupMemberships; |
|
39 | + |
|
40 | + /** @var IUserSession */ |
|
41 | + protected $userSession; |
|
42 | + |
|
43 | + /** @var IGroupManager */ |
|
44 | + protected $groupManager; |
|
45 | + |
|
46 | + /** @var IL10N */ |
|
47 | + protected $l; |
|
48 | + |
|
49 | + /** |
|
50 | + * @param IUserSession $userSession |
|
51 | + * @param IGroupManager $groupManager |
|
52 | + * @param IL10N $l |
|
53 | + */ |
|
54 | + public function __construct(IUserSession $userSession, IGroupManager $groupManager, IL10N $l) { |
|
55 | + $this->userSession = $userSession; |
|
56 | + $this->groupManager = $groupManager; |
|
57 | + $this->l = $l; |
|
58 | + } |
|
59 | + |
|
60 | + /** |
|
61 | + * @param string $operator |
|
62 | + * @param string $value |
|
63 | + * @return bool |
|
64 | + */ |
|
65 | + public function executeCheck($operator, $value) { |
|
66 | + $user = $this->userSession->getUser(); |
|
67 | + |
|
68 | + if ($user instanceof IUser) { |
|
69 | + $groupIds = $this->getUserGroups($user); |
|
70 | + return ($operator === 'is') === in_array($value, $groupIds); |
|
71 | + } else { |
|
72 | + return $operator !== 'is'; |
|
73 | + } |
|
74 | + } |
|
75 | + |
|
76 | + |
|
77 | + /** |
|
78 | + * @param string $operator |
|
79 | + * @param string $value |
|
80 | + * @throws \UnexpectedValueException |
|
81 | + */ |
|
82 | + public function validateCheck($operator, $value) { |
|
83 | + if (!in_array($operator, ['is', '!is'])) { |
|
84 | + throw new \UnexpectedValueException($this->l->t('The given operator is invalid'), 1); |
|
85 | + } |
|
86 | + |
|
87 | + if (!$this->groupManager->groupExists($value)) { |
|
88 | + throw new \UnexpectedValueException($this->l->t('The given group does not exist'), 2); |
|
89 | + } |
|
90 | + } |
|
91 | + |
|
92 | + /** |
|
93 | + * @param IUser $user |
|
94 | + * @return string[] |
|
95 | + */ |
|
96 | + protected function getUserGroups(IUser $user) { |
|
97 | + $uid = $user->getUID(); |
|
98 | + |
|
99 | + if ($this->cachedUser !== $uid) { |
|
100 | + $this->cachedUser = $uid; |
|
101 | + $this->cachedGroupMemberships = $this->groupManager->getUserGroupIds($user); |
|
102 | + } |
|
103 | + |
|
104 | + return $this->cachedGroupMemberships; |
|
105 | + } |
|
106 | + |
|
107 | + public function supportedEntities(): array { |
|
108 | + // universal by default |
|
109 | + return []; |
|
110 | + } |
|
111 | + |
|
112 | + public function isAvailableForScope(int $scope): bool { |
|
113 | + // admin only by default |
|
114 | + return $scope === IManager::SCOPE_ADMIN; |
|
115 | + } |
|
116 | 116 | } |
@@ -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 | } |