PluginProbe
User Access Manager / 2.3.2
User Access Manager v2.3.2
2.3.20 2.3.19 2.3.18 2.3.17 2.3.16 2.3.15 2.3.14 2.3.13 trunk 0.6 0.6.1 0.6.2 0.7 0.7 Beta 0.7.0.1 0.8 0.8.0.1 0.8.0.2 0.9 0.9.1 0.9.1.1 0.9.1.2 0.9.1.3 0.9.1.4 1.0 All 136 releases
← All changes | src/UserGroup/UserGroupAssignmentHandler.php +11 -11 2.3.192.3.2 View file →
@@ -19,11 +19,12 @@
19 19 }
20 20
21 21 private function getDateParameter(array $data, string $name): ?string
22 22 {
23 - $value = (string) ($data[$name] ?? '');
23 + $isValid = isset($data[$name]['date']) === true && isset($data[$name]['time']) === true
24 + && (string) $data[$name]['date'] !== '' && (string) $data[$name]['time'] !== '';
24 25
25 - return ($value !== '') ? $value : null;
26 + return ($isValid === true) ? ((string) $data[$name]['date']) . 'T' . $data[$name]['time'] : null;
26 27 }
27 28
28 29 /**
29 30 * @throws Exception
@@ -28,15 +29,14 @@
28 29 /**
29 30 * @throws Exception
30 31 */
31 32 private function setUserGroups(
32 - array $filteredUserGroups,
33 - string $objectType,
34 - int|string|null $objectId,
35 - array $addUserGroups,
36 - array $removeUserGroups
33 + array $filteredUserGroups,
34 + string $objectType,
35 + int|string $objectId,
36 + array $addUserGroups,
37 + array $removeUserGroups
37 38 ): void {
38 - /** @var UserGroup $userGroup */
39 39 foreach ($filteredUserGroups as $groupId => $userGroup) {
40 40 if (isset($removeUserGroups[$groupId]) === true) {
41 41 $userGroup->removeObject($objectType, $objectId);
42 42 }
@@ -57,9 +57,9 @@
57 57 /**
58 58 * @throws UserGroupAssignmentException
59 59 * @throws UserGroupTypeException
60 60 */
61 - private function setDynamicGroups(string $objectType, int|string|null $objectId, array $addDynamicUserGroups): void
61 + private function setDynamicGroups(string $objectType, int|string $objectId, array $addDynamicUserGroups): void
62 62 {
63 63 foreach ($addDynamicUserGroups as $dynamicUserGroupKey => $addDynamicUserGroup) {
64 64 $dynamicUserGroupData = explode('|', $dynamicUserGroupKey);
65 65
@@ -84,9 +84,9 @@
84 84 /**
85 85 * @throws UserGroupTypeException
86 86 * @throws Exception
87 87 */
88 - private function setDefaultGroups(array $filteredUserGroups, string $objectType, int|string|null $objectId): void
88 + private function setDefaultGroups(array $filteredUserGroups, string $objectType, int|string $objectId): void
89 89 {
90 90 /**
91 91 * @var UserGroup[] $userGroupsToCheck
92 92 */
@@ -110,9 +110,9 @@
110 110 * @throws Exception
111 111 */
112 112 public function assignObjectToUserGroups(
113 113 string $objectType,
114 - int|string|null $objectId,
114 + int|string $objectId,
115 115 array $addUserGroups,
116 116 array $removeUserGroups,
117 117 array $addDynamicUserGroups
118 118 ): void {