src/Token.php
public function validate()
    {
        if (time() > $this->getExpiration()) {
            throw new exceptions\TokenExpiredException('Token is expired.');
        }
        if ($this->getHash() != $this->generateHash()) {
            throw new exceptions\InvalidHashException('Invalid token hash.');
        }
    }
public function validate()
    {
        if (time() > $this->getExpiration()) {
            throw new exceptions\TokenExpiredException('Token is expired.');
        }
        if ($this->getHash() != $this->generateHash()) {
            throw new exceptions\InvalidHashException('Invalid token hash.');
        }
    }
public function validate ( ) { if ( time ( ) > $ this -> getExpiration ( ) ) { throw new exceptions \ TokenExpiredException ( 'Token is expired.' ) ; } if ( $ this -> getHash ( ) != $ this -> generateHash ( ) ) { throw new exceptions \ InvalidHashException ( 'Invalid token hash.' ) ; } }
Validate token, usually used only when token is loaded from
string representation.
Validate token usually used only when token is loaded from string representation .