From 3d03d7318e92209d5687242d2e40f96b111364cf Mon Sep 17 00:00:00 2001 From: Creomant Date: Mon, 21 Aug 2017 14:53:22 +0100 Subject: [PATCH] SUB-868 - changing private to protected in order to extend functionality in children classes --- src/JwtGuard/JwtTokenAuthenticator.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/JwtGuard/JwtTokenAuthenticator.php b/src/JwtGuard/JwtTokenAuthenticator.php index 3baccd1..778bd53 100644 --- a/src/JwtGuard/JwtTokenAuthenticator.php +++ b/src/JwtGuard/JwtTokenAuthenticator.php @@ -24,17 +24,17 @@ class JwtTokenAuthenticator implements RequestAuthoriser, IdentityProvider /** * @var AlgorithmInterface */ - private $algorithm; + protected $algorithm; /** * @var Token */ - private $token; + protected $token; /** * @var AppIdProvider */ - private $appIdProvider; + protected $appIdProvider; /** * @param Jwt $jwt @@ -54,7 +54,7 @@ public function __construct( Jwt $jwt, AlgorithmInterface $algorithm, AppIdProvi * @param string $claim the name of the claim * @return mixed */ - private function getClaimOrNull( $claim ) + protected function getClaimOrNull( $claim ) { $claim = $this->token->getPayload()->findClaimByName( $claim ); return $claim ? $claim->getValue() : null; @@ -64,7 +64,7 @@ private function getClaimOrNull( $claim ) * Is this token expired * @return bool */ - private function isExpired() + protected function isExpired() { $exp = \DateTime::createFromFormat( 'U', $this->getClaimOrNull( self::EXPIRY ) ); return !$exp || $exp <= ( new DateTime ); @@ -74,7 +74,7 @@ private function isExpired() * Does this token have a user id * @return bool */ - private function hasUserId() + protected function hasUserId() { return (bool)$this->getClaimOrNull( self::USER_ID ); } @@ -83,7 +83,7 @@ private function hasUserId() * Is this token for labs * @return bool */ - private function isAllowedAppId() + protected function isAllowedAppId() { return in_array( $this->getClaimOrNull( self::APP_ID ), $this->appIdProvider->getAppIds() ); } @@ -156,7 +156,7 @@ public function getSegments() return is_array( $segments ) ? $segments : [ ]; } - private function extractJwtFromHeader( $header ) + protected function extractJwtFromHeader( $header ) { if( strpos( $header, self::BEARER ) === 0 ){ return substr( $header, strlen( self::BEARER ) );