Skip to content

Commit

Permalink
Merge pull request #47 from babeuloula/patch-1
Browse files Browse the repository at this point in the history
Fix Warning: Undefined array key on PHP8
  • Loading branch information
mstefan21 authored Aug 10, 2022
2 parents ad4cf7f + fdbbd5f commit 74a12bd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Provider/KeycloakResourceOwner.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function __construct(array $response = array())
*/
public function getId()
{
return $this->response['sub'] ?: null;
return \array_key_exists('sub', $this->response) ? $this->response['sub'] : null;
}

/**
Expand All @@ -40,7 +40,7 @@ public function getId()
*/
public function getEmail()
{
return $this->response['email'] ?: null;
return \array_key_exists('email', $this->response) ? $this->response['email'] : null;
}

/**
Expand All @@ -50,7 +50,7 @@ public function getEmail()
*/
public function getName()
{
return $this->response['name'] ?: null;
return \array_key_exists('name', $this->response) ? $this->response['name'] : null;
}

/**
Expand Down

0 comments on commit 74a12bd

Please sign in to comment.