*/ abstract class Token { /** * Check whether the stream passed in contains a valid token of this * type. * * @param string $stream * @return bool */ abstract public static function isToken(string $stream): bool; /** * Consume a token from the stream. * * Only valid if isToken is true. * * @param string $stream * @return Token */ abstract public static function getToken(string &$stream): Token; }