From cbacdc2a4d86fdeac184dc179d97780794c239b6 Mon Sep 17 00:00:00 2001 From: Mark Clements Date: Fri, 24 Apr 2026 22:47:55 +0100 Subject: [PATCH 1/2] Use of "self" in callables is deprecated in PHP 8.1 There were a number of places in the DynamoDB class that use 'self::isNotEmpty' as a callback function. However, relative callables (e.g. using `self`, `parent`, etc.) have been deprecated in PHP 8.1 and will result in a deprecation notice being triggered. I have updated these to use `__CLASS__` instead. Reference: https://www.php.net/manual/en/migration82.deprecated.php#migration82.deprecated.core.relative-callables --- src/OAuth2/Storage/DynamoDB.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/OAuth2/Storage/DynamoDB.php b/src/OAuth2/Storage/DynamoDB.php index 713189d2..46191d07 100644 --- a/src/OAuth2/Storage/DynamoDB.php +++ b/src/OAuth2/Storage/DynamoDB.php @@ -124,7 +124,7 @@ public function getClientDetails($client_id) public function setClientDetails($client_id, $client_secret = null, $redirect_uri = null, $grant_types = null, $scope = null, $user_id = null) { $clientData = compact('client_id', 'client_secret', 'redirect_uri', 'grant_types', 'scope', 'user_id'); - $clientData = array_filter($clientData, 'self::isNotEmpty'); + $clientData = array_filter($clientData, array(__CLASS__, 'isNotEmpty')); $result = $this->client->putItem(array( 'TableName' => $this->config['client_table'], @@ -171,7 +171,7 @@ public function setAccessToken($access_token, $client_id, $user_id, $expires, $s $expires = date('Y-m-d H:i:s', $expires); $clientData = compact('access_token', 'client_id', 'user_id', 'expires', 'scope'); - $clientData = array_filter($clientData, 'self::isNotEmpty'); + $clientData = array_filter($clientData, array(__CLASS__, 'isNotEmpty')); $result = $this->client->putItem(array( 'TableName' => $this->config['access_token_table'], @@ -219,7 +219,7 @@ public function setAuthorizationCode($authorization_code, $client_id, $user_id, $expires = date('Y-m-d H:i:s', $expires); $clientData = compact('authorization_code', 'client_id', 'user_id', 'redirect_uri', 'expires', 'scope', 'id_token', 'code_challenge', 'code_challenge_method'); - $clientData = array_filter($clientData, 'self::isNotEmpty'); + $clientData = array_filter($clientData, array(__CLASS__, 'isNotEmpty')); $result = $this->client->putItem(array( 'TableName' => $this->config['code_table'], @@ -320,7 +320,7 @@ public function setRefreshToken($refresh_token, $client_id, $user_id, $expires, $expires = date('Y-m-d H:i:s', $expires); $clientData = compact('refresh_token', 'client_id', 'user_id', 'expires', 'scope'); - $clientData = array_filter($clientData, 'self::isNotEmpty'); + $clientData = array_filter($clientData, array(__CLASS__, 'isNotEmpty')); $result = $this->client->putItem(array( 'TableName' => $this->config['refresh_token_table'], @@ -373,7 +373,7 @@ public function setUser($username, $password, $first_name = null, $last_name = n $password = $this->hashPassword($password); $clientData = compact('username', 'password', 'first_name', 'last_name'); - $clientData = array_filter($clientData, 'self::isNotEmpty'); + $clientData = array_filter($clientData, array(__CLASS__, 'isNotEmpty')); $result = $this->client->putItem(array( 'TableName' => $this->config['user_table'], @@ -537,4 +537,4 @@ private static function isNotEmpty($value) { return null !== $value && '' !== $value; } -} \ No newline at end of file +} From 1301eb9cd16b8de8008e11d9274c380da101cfe1 Mon Sep 17 00:00:00 2001 From: Mark Clements Date: Fri, 24 Apr 2026 22:49:34 +0100 Subject: [PATCH 2/2] Remove trailing newline inserted by Github editor. Apologies for the noise.