Code Duplication    Length = 4-4 lines in 3 locations

src/Grant/RefreshTokenGrant.php 1 location

@@ 62-65 (lines=4) @@
59
            $this->getIdentifier()
60
        );
61
62
        if (($client instanceof ClientEntity) === false) {
63
            $this->server->getEventEmitter()->emit(new Event\ClientAuthenticationFailedEvent($this->server->getRequest()));
64
            throw new Exception\InvalidClientException();
65
        }
66
67
        // Gets the active refresh token for the current session.
68
        $oldRefreshTokenParam = $this->server->getRequest()->request->get('refresh_token', null);

src/Grant/SSOGrant.php 1 location

@@ 159-162 (lines=4) @@
156
            $this->getIdentifier()
157
        );
158
159
        if (($client instanceof ClientEntity) === false) {
160
            $this->server->getEventEmitter()->emit(new Event\ClientAuthenticationFailedEvent($this->server->getRequest()));
161
            throw new Exception\InvalidClientException();
162
        }
163
164
        $credentials = [
165
            self::SSO_IDENTITY_FIELD => $identity,

src/Grant/TokenGrant.php 1 location

@@ 128-131 (lines=4) @@
125
            $this->getIdentifier()
126
        );
127
128
        if (($client instanceof ClientEntity) === false) {
129
            $this->server->getEventEmitter()->emit(new Event\ClientAuthenticationFailedEvent($this->server->getRequest()));
130
            throw new Exception\InvalidClientException();
131
        }
132
133
        $access_token = $this->server->getRequest()->headers->get('authorization',null);
134
        if ($access_token === null) {