From 09f98a5cbb1a0bf26b92001466daa6b859223b2c Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Thu, 5 Oct 2017 12:25:30 +1030 Subject: [PATCH] Use a constant instead of a property --- .../core/src/Http/Middleware/AuthenticateWithHeader.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/framework/core/src/Http/Middleware/AuthenticateWithHeader.php b/framework/core/src/Http/Middleware/AuthenticateWithHeader.php index 9b34b11dc..1bf1fd51b 100644 --- a/framework/core/src/Http/Middleware/AuthenticateWithHeader.php +++ b/framework/core/src/Http/Middleware/AuthenticateWithHeader.php @@ -20,10 +20,7 @@ use Zend\Stratigility\MiddlewareInterface; class AuthenticateWithHeader implements MiddlewareInterface { - /** - * @var string - */ - protected $prefix = 'Token '; + const TOKEN_PREFIX = 'Token '; /** * {@inheritdoc} @@ -34,8 +31,8 @@ class AuthenticateWithHeader implements MiddlewareInterface $parts = explode(';', $headerLine); - if (isset($parts[0]) && starts_with($parts[0], $this->prefix)) { - $id = substr($parts[0], strlen($this->prefix)); + if (isset($parts[0]) && starts_with($parts[0], self::TOKEN_PREFIX)) { + $id = substr($parts[0], strlen(self::TOKEN_PREFIX)); if (isset($parts[1])) { if (ApiKey::find($id)) {