diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 38080af1..627ad8b3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,7 +20,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - php: ['7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3'] + php: ['7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4'] steps: - name: Checkout diff --git a/README.md b/README.md index 904b83ec..a4eb592d 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ the OpenID Connect protocol to set up authentication. A special thanks goes to Justin Richer and Amanda Anganes for their help and support of the protocol. # Requirements # - 1. PHP 7.0 or greater + 1. PHP 7.1 or greater 2. CURL extension 3. JSON extension diff --git a/composer.json b/composer.json index 64825884..dc24d01b 100644 --- a/composer.json +++ b/composer.json @@ -3,7 +3,7 @@ "description": "Bare-bones OpenID Connect client", "license": "Apache-2.0", "require": { - "php": ">=7.0", + "php": ">=7.1", "ext-json": "*", "ext-curl": "*", "phpseclib/phpseclib": "^3.0.7" diff --git a/src/OpenIDConnectClient.php b/src/OpenIDConnectClient.php index 07c00540..f7808402 100644 --- a/src/OpenIDConnectClient.php +++ b/src/OpenIDConnectClient.php @@ -259,7 +259,7 @@ class OpenIDConnectClient * @param string|null $client_secret optional * @param string|null $issuer */ - public function __construct(string $provider_url = null, string $client_id = null, string $client_secret = null, string $issuer = null) { + public function __construct(?string $provider_url = null, ?string $client_id = null, ?string $client_secret = null, ?string $issuer = null) { $this->setProviderURL($provider_url); if ($issuer === null) { $this->setIssuer($provider_url); @@ -1189,7 +1189,7 @@ protected function validateIssuer(string $iss): bool * @return bool * @throws OpenIDConnectClientException */ - protected function verifyJWTClaims($claims, string $accessToken = null): bool + protected function verifyJWTClaims($claims, ?string $accessToken = null): bool { if(isset($claims->at_hash, $accessToken)) { if(isset($this->getIdTokenHeader()->alg) && $this->getIdTokenHeader()->alg !== 'none') { @@ -1258,7 +1258,7 @@ protected function decodeJWT(string $jwt, int $section = 0) { * * @throws OpenIDConnectClientException */ - public function requestUserInfo(string $attribute = null) { + public function requestUserInfo(?string $attribute = null) { $user_info_endpoint = $this->getProviderConfigValue('userinfo_endpoint'); $schema = 'openid'; @@ -1335,7 +1335,7 @@ public function requestUserInfo(string $attribute = null) { * @return mixed * */ - public function getVerifiedClaims(string $attribute = null) { + public function getVerifiedClaims(?string $attribute = null) { if($attribute === null) { return $this->verifiedClaims; @@ -1355,7 +1355,7 @@ public function getVerifiedClaims(string $attribute = null) { * @return bool|string * @throws OpenIDConnectClientException */ - protected function fetchURL(string $url, string $post_body = null, array $headers = []) { + protected function fetchURL(string $url, ?string $post_body = null, array $headers = []) { // OK cool - then let's create a new cURL resource handle $ch = curl_init(); @@ -1629,7 +1629,7 @@ public function register() { * @throws OpenIDConnectClientException * @throws Exception */ - public function introspectToken(string $token, string $token_type_hint = '', string $clientId = null, string $clientSecret = null) { + public function introspectToken(string $token, string $token_type_hint = '', ?string $clientId = null, ?string $clientSecret = null) { $introspection_endpoint = $this->getProviderConfigValue('introspection_endpoint'); $token_endpoint_auth_methods_supported = $this->getProviderConfigValue('token_endpoint_auth_methods_supported', ['client_secret_basic']); @@ -1670,7 +1670,7 @@ public function introspectToken(string $token, string $token_type_hint = '', str * @return mixed * @throws OpenIDConnectClientException */ - public function revokeToken(string $token, string $token_type_hint = '', string $clientId = null, string $clientSecret = null) { + public function revokeToken(string $token, string $token_type_hint = '', ?string $clientId = null, ?string $clientSecret = null) { $revocation_endpoint = $this->getProviderConfigValue('revocation_endpoint'); $post_data = ['token' => $token];