Little fixes

This commit is contained in:
Alex Bilbie 2014-01-10 17:30:18 +00:00
parent ca3b7d51df
commit 69571bc8ef
4 changed files with 15 additions and 30 deletions

View File

@ -14,8 +14,7 @@ namespace League\OAuth2\Server\Entities;
use League\OAuth2\Server\Storage\SessionStorageInterface; use League\OAuth2\Server\Storage\SessionStorageInterface;
use League\OAuth2\Server\Util\SecureKey; use League\OAuth2\Server\Util\SecureKey;
use League\OAuth2\Server\Exception\ServerException; use League\OAuth2\Server\Exception\ServerException;
use League\OAuth2\Server\Authorization; use League\OAuth2\Server\AbstractServer;
use League\OAuth2\Server\Resource;
use Symfony\Component\HttpFoundation\ParameterBag; use Symfony\Component\HttpFoundation\ParameterBag;
/** /**
@ -55,15 +54,11 @@ abstract class AbstractToken
/** /**
* __construct * __construct
* @param \League\OAuth2\Server\Authorization|\League\OAuth2\Server\Resource $server * @param \League\OAuth2\Server\AbstractServer $server
* @return self * @return self
*/ */
public function __construct($server) public function __construct(AbstractServer $server)
{ {
if (! $server instanceof Authorization && ! $server instanceof Resource) {
throw new ServerException('No instance of Authorization or Resource server injected');
}
$this->server = $server; $this->server = $server;
return $this; return $this;
} }

View File

@ -12,8 +12,7 @@
namespace League\OAuth2\Server\Entities; namespace League\OAuth2\Server\Entities;
use League\OAuth2\Server\Exception\ServerException; use League\OAuth2\Server\Exception\ServerException;
use League\OAuth2\Server\Authorization; use League\OAuth2\Server\AbstractServer;
use League\OAuth2\Server\Resource;
/** /**
* Client entity class * Client entity class
@ -52,14 +51,13 @@ class Client
/** /**
* __construct * __construct
* @param \League\OAuth2\Server\Authorization|\League\OAuth2\Server\Resource $server * @param \League\OAuth2\Server\AbstractServer $server
* @return self * @return self
*/ */
public function __construct($server) public function __construct(AbstractServer $server)
{ {
if (! $server instanceof Authorization && ! $server instanceof Resource) { $this->server = $server;
throw new ServerException('No instance of Authorization or Resource server injected'); return $this;
}
} }
/** /**

View File

@ -12,8 +12,7 @@
namespace League\OAuth2\Server\Entities; namespace League\OAuth2\Server\Entities;
use League\OAuth2\Server\Exception\ServerException; use League\OAuth2\Server\Exception\ServerException;
use League\OAuth2\Server\Authorization; use League\OAuth2\Server\AbstractServer;
use League\OAuth2\Server\Resource;
/** /**
* Scope entity class * Scope entity class
@ -40,14 +39,12 @@ class Scope
/** /**
* __construct * __construct
* @param \League\OAuth2\Server\Authorization|\League\OAuth2\Server\Resource $server * @param \League\OAuth2\Server\AbstractServer $server
* @return self * @return self
*/ */
public function __construct($server) public function __construct(AbstractServer $server)
{ {
if (! $server instanceof Authorization && ! $server instanceof Resource) { $this->server = $server;
throw new ServerException('No instance of Authorization or Resource server injected');
}
return $this; return $this;
} }

View File

@ -14,8 +14,7 @@ namespace League\OAuth2\Server\Entities;
use League\OAuth2\Server\Exception\OAuth2Exception; use League\OAuth2\Server\Exception\OAuth2Exception;
use League\OAuth2\Server\Storage\SessionInterface; use League\OAuth2\Server\Storage\SessionInterface;
use League\OAuth2\Server\Exception\ServerException; use League\OAuth2\Server\Exception\ServerException;
use League\OAuth2\Server\Authorization; use League\OAuth2\Server\AbstractServer;
use League\OAuth2\Server\Resource;
use Symfony\Component\HttpFoundation\ParameterBag; use Symfony\Component\HttpFoundation\ParameterBag;
/** /**
@ -79,15 +78,11 @@ class Session
/** /**
* __construct * __construct
* @param \League\OAuth2\Server\Authorization|\League\OAuth2\Server\Resource $server * @param \League\OAuth2\Server\AbstractServer $server
* @return self * @return self
*/ */
public function __construct($server) public function __construct(AbstractServer $server)
{ {
if (! $server instanceof Authorization && ! $server instanceof Resource) {
throw new ServerException('No instance of Authorization or Resource server injected');
}
$this->server = $server; $this->server = $server;
return $this; return $this;
} }