PluginProbe
User Access Manager / 2.3.4
User Access Manager v2.3.4
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 +7 -6 2.3.182.3.4 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
@@ -30,9 +31,9 @@
30 31 */
31 32 private function setUserGroups(
32 33 array $filteredUserGroups,
33 34 string $objectType,
34 - int|string|null $objectId,
35 + int|string $objectId,
35 36 array $addUserGroups,
36 37 array $removeUserGroups
37 38 ): void {
38 39 /** @var UserGroup $userGroup */
@@ -57,9 +58,9 @@
57 58 /**
58 59 * @throws UserGroupAssignmentException
59 60 * @throws UserGroupTypeException
60 61 */
61 - private function setDynamicGroups(string $objectType, int|string|null $objectId, array $addDynamicUserGroups): void
62 + private function setDynamicGroups(string $objectType, int|string $objectId, array $addDynamicUserGroups): void
62 63 {
63 64 foreach ($addDynamicUserGroups as $dynamicUserGroupKey => $addDynamicUserGroup) {
64 65 $dynamicUserGroupData = explode('|', $dynamicUserGroupKey);
65 66
@@ -84,9 +85,9 @@
84 85 /**
85 86 * @throws UserGroupTypeException
86 87 * @throws Exception
87 88 */
88 - private function setDefaultGroups(array $filteredUserGroups, string $objectType, int|string|null $objectId): void
89 + private function setDefaultGroups(array $filteredUserGroups, string $objectType, int|string $objectId): void
89 90 {
90 91 /**
91 92 * @var UserGroup[] $userGroupsToCheck
92 93 */
@@ -110,9 +111,9 @@
110 111 * @throws Exception
111 112 */
112 113 public function assignObjectToUserGroups(
113 114 string $objectType,
114 - int|string|null $objectId,
115 + int|string $objectId,
115 116 array $addUserGroups,
116 117 array $removeUserGroups,
117 118 array $addDynamicUserGroups
118 119 ): void {