You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix PHP 8.4 deprecation: Add explicit nullable type hints (#309)
* Fix PHP 8.4 deprecation: Add explicit nullable type hints
Resolves#296
PHP 8.4 deprecates implicitly nullable parameters (e.g., `string $param = null`).
This change adds explicit nullable type hints (`?string $param = null`) across
the SDK to eliminate deprecation warnings while maintaining backward compatibility
with PHP 7.3+.
Changes:
- Added explicit nullable type hints to all nullable parameters in:
- UserManagement, AuditLogs, Organizations, SSO, MFA, Portal, DirectorySync
- Client, CurlRequestClient, WebhookResponse
- Exception classes (GenericException, BaseRequestException)
- Updated RequestClientInterface to match implementation signature
- Added tests to verify null parameter handling and backward compatibility
- Fixed test expectations to match actual implementation behavior
All 167 tests pass. No breaking changes - only type hints added.
* Resolved conflicts due to missing changes upstream.
Take particular note of the changes to $roleSlugs. There was a mismatch between the phpdoc, tests, and api docs. This commit went with the array due to both the test and api doc specifying the array type. The php doc was updated to reflect the array change.
Copy file name to clipboardExpand all lines: lib/DirectorySync.php
+16-16Lines changed: 16 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -27,13 +27,13 @@ class DirectorySync
27
27
* @return array{?string, ?string, Resource\Directory[]} An array containing the Directory ID to use as before and after cursor, and an array of Directory instances
28
28
*/
29
29
publicfunctionlistDirectories(
30
-
$domain = null,
31
-
$search = null,
30
+
?string$domain = null,
31
+
?string$search = null,
32
32
$limit = self::DEFAULT_PAGE_SIZE,
33
-
$before = null,
34
-
$after = null,
35
-
$organizationId = null,
36
-
$order = null
33
+
?string$before = null,
34
+
?string$after = null,
35
+
?string$organizationId = null,
36
+
?string$order = null
37
37
) {
38
38
$directoriesPath = "directories";
39
39
$params = [
@@ -78,12 +78,12 @@ public function listDirectories(
78
78
* @return array{?string, ?string, Resource\DirectoryGroup[]} An array containing the Directory Group ID to use as before and after cursor, and an array of Directory Group instances
79
79
*/
80
80
publicfunctionlistGroups(
81
-
$directory = null,
82
-
$user = null,
81
+
?string$directory = null,
82
+
?string$user = null,
83
83
$limit = self::DEFAULT_PAGE_SIZE,
84
-
$before = null,
85
-
$after = null,
86
-
$order = null
84
+
?string$before = null,
85
+
?string$after = null,
86
+
?string$order = null
87
87
) {
88
88
$groupsPath = "directory_groups";
89
89
@@ -156,12 +156,12 @@ public function getGroup($directoryGroup)
0 commit comments