Classes/Helper.php
public function validateTokenHash($tokenHash)
    {
        $tokenData = $this->tokenCache->get($tokenHash);

        if ($tokenData === false) {
            $this->logger->log(sprintf('Validation of token hash %s failed', $tokenHash), LOG_INFO);

            return null;
        }

        $preset = $this->getPreset($tokenData['presetName']);
        if (!(isset($preset['preserveToken']) && $preset['preserveToken'])) {
            $this->tokenCache->remove($tokenHash);
        }

        $this->logger->log(sprintf('Validated token hash %s for identifier %s', $tokenHash, $tokenData['identifier']), LOG_INFO);

        return new Token($tokenHash, $tokenData['identifier'], $this->getPreset($tokenData['presetName']), $tokenData['meta']);
    }
public function validateTokenHash($tokenHash)
    {
        $tokenData = $this->tokenCache->get($tokenHash);

        if ($tokenData === false) {
            $this->logger->log(sprintf('Validation of token hash %s failed', $tokenHash), LOG_INFO);

            return null;
        }

        $preset = $this->getPreset($tokenData['presetName']);
        if (!(isset($preset['preserveToken']) && $preset['preserveToken'])) {
            $this->tokenCache->remove($tokenHash);
        }

        $this->logger->log(sprintf('Validated token hash %s for identifier %s', $tokenHash, $tokenData['identifier']), LOG_INFO);

        return new Token($tokenHash, $tokenData['identifier'], $this->getPreset($tokenData['presetName']), $tokenData['meta']);
    }
public function validateTokenHash ( $ tokenHash ) { $ tokenData = $ this -> tokenCache -> get ( $ tokenHash ) ; if ( $ tokenData === false ) { $ this -> logger -> log ( sprintf ( 'Validation of token hash %s failed' , $ tokenHash ) , LOG_INFO ) ; return null ; } $ preset = $ this -> getPreset ( $ tokenData [ 'presetName' ] ) ; if ( ! ( isset ( $ preset [ 'preserveToken' ] ) && $ preset [ 'preserveToken' ] ) ) { $ this -> tokenCache -> remove ( $ tokenHash ) ; } $ this -> logger -> log ( sprintf ( 'Validated token hash %s for identifier %s' , $ tokenHash , $ tokenData [ 'identifier' ] ) , LOG_INFO ) ; return new Token ( $ tokenHash , $ tokenData [ 'identifier' ] , $ this -> getPreset ( $ tokenData [ 'presetName' ] ) , $ tokenData [ 'meta' ] ) ; }
This checks if a given hash is known and still valid before returning the associated Token.

If no valid Token is found for the hash, NULL is returned.

@param $tokenHash
@return Token
@throws UnknownPresetException
This checks if a given hash is known and still valid before returning the associated Token .