minor improvements and documentation fixes

This commit is contained in:
Julián Gutiérrez
2016-01-20 10:36:16 +01:00
parent 1e1043c04f
commit 3e5889e93b
17 changed files with 37 additions and 54 deletions

View File

@@ -11,7 +11,7 @@
namespace League\OAuth2\Server\Grant;
use League\Event\EmitterInterface;
use League\Event\EmitterAwareTrait;
use League\Event\Event;
use League\OAuth2\Server\Entities\AccessTokenEntity;
use League\OAuth2\Server\Entities\Interfaces\ClientEntityInterface;
@@ -29,6 +29,8 @@ use Psr\Http\Message\ServerRequestInterface;
*/
abstract class AbstractGrant implements GrantTypeInterface
{
use EmitterAwareTrait;
const SCOPE_DELIMITER_STRING = ' ';
/**
@@ -60,11 +62,6 @@ abstract class AbstractGrant implements GrantTypeInterface
*/
protected $accessTokenRepository;
/**
* @var \League\Event\Emitter
*/
protected $emitter;
/**
* @var ScopeRepositoryInterface
*/
@@ -120,14 +117,6 @@ abstract class AbstractGrant implements GrantTypeInterface
$this->pathToPublicKey = $pathToPublicKey;
}
/**
* @inheritdoc
*/
public function setEmitter(EmitterInterface $emitter)
{
$this->emitter = $emitter;
}
/**
* {@inheritdoc}
*/
@@ -179,7 +168,7 @@ abstract class AbstractGrant implements GrantTypeInterface
);
if (!$client instanceof ClientEntityInterface) {
$this->emitter->emit(new Event('client.authentication.failed', $request));
$this->getEmitter()->emit(new Event('client.authentication.failed', $request));
throw OAuthServerException::invalidClient();
}