Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
14 changes: 7 additions & 7 deletions src/OpenIDConnectClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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') {
Expand Down Expand Up @@ -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';
Expand Down Expand Up @@ -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;
Expand All @@ -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();
Expand Down Expand Up @@ -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']);

Expand Down Expand Up @@ -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];
Expand Down