Skip to content

Commit d73fa17

Browse files
cb-freddysartclaude
andcommitted
fix(php-8.4): make implicit-nullable parameters explicit
PHP 8.4 deprecates 'Type $x = null' in favor of '?Type $x = null'. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent db4072c commit d73fa17

6 files changed

Lines changed: 10 additions & 10 deletions

File tree

src/Cache/MemoryManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
class MemoryManager extends CacheManager
2626
{
2727

28-
public function __construct(AbstractAdapter $adapter = null)
28+
public function __construct(?AbstractAdapter $adapter = null)
2929
{
3030
if(null === $adapter) {
3131
$adapter = new MemoryAdapter();

src/Client.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,10 @@ class Client
8181
public function __construct(
8282
string $token,
8383
string $organizationUrl,
84-
HttpClient $httpClient = null,
84+
?HttpClient $httpClient = null,
8585
string $integrationUserAgent = null,
86-
CacheManager $cacheManager = null,
87-
AuthorizationMode $authorizationMode = null
86+
?CacheManager $cacheManager = null,
87+
?AuthorizationMode $authorizationMode = null
8888
) {
8989
$this->token = $token;
9090
$this->organizationUrl = $organizationUrl;

src/DataStore/DefaultDataStore.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ class DefaultDataStore
8989
* @param HttpClient|NULL $httpClient
9090
* @param AuthorizationMode|NULL $authorizationMode
9191
*/
92-
public function __construct(string $token, string $organizationUrl, HttpClient $httpClient = null, AuthorizationMode $authorizationMode = null)
92+
public function __construct(string $token, string $organizationUrl, ?HttpClient $httpClient = null, ?AuthorizationMode $authorizationMode = null)
9393
{
9494
$this->token = $token;
9595
$this->organizationUrl = $organizationUrl;
@@ -121,7 +121,7 @@ public function __construct(string $token, string $organizationUrl, HttpClient $
121121
* @param array $options Any options you want to set.
122122
* @return object
123123
*/
124-
public function instantiate(string $class, \stdClass $properties = null, array $options = [])
124+
public function instantiate(string $class, ?\stdClass $properties = null, array $options = [])
125125
{
126126
$propertiesArr = array($properties, $options);
127127

src/Exceptions/ResourceException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class ResourceException extends GeneralException
2323
{
2424
private $error;
2525

26-
public function __construct(Error $error, Throwable $previous = null)
26+
public function __construct(Error $error, ?Throwable $previous = null)
2727
{
2828
$this->error = $error;
2929
$message = $error->getErrorSummary() ?: '';

src/Okta.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class Okta
3030

3131
const VERSION = '1.3.0';
3232

33-
public function __construct(Client $client = null, DefaultDataStore $dataStore = null)
33+
public function __construct(?Client $client = null, ?DefaultDataStore $dataStore = null)
3434
{
3535
$this->client = $client ?: Client::getInstance();
3636
$this->dataStore = $dataStore ?: $this->client->getDataStore();

src/Resource/AbstractResource.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ abstract class AbstractResource
6565
* @param \stdClass|NULL $properties Properties for the resource.
6666
* @param array $options Options to use on the resource.
6767
*/
68-
public function __construct(DefaultDataStore $dataStore = null, \stdClass $properties = null, array $options = [])
68+
public function __construct(?DefaultDataStore $dataStore = null, ?\stdClass $properties = null, array $options = [])
6969
{
7070
$this->dataStore = $dataStore ?: Client::getInstance()->getDataStore();
7171
$this->setProperties($properties);
@@ -90,7 +90,7 @@ public function getHref()
9090
* @param \stdClass|NULL $properties the properties to set.
9191
* @return self
9292
*/
93-
public function setProperties(\stdClass $properties = null): self
93+
public function setProperties(?\stdClass $properties = null): self
9494
{
9595
$this->dirty = false;
9696

0 commit comments

Comments
 (0)