Ejemplo n.º 1
0
 /**
  * Instance of TokenInterface has 'isValid()'
  * method to checking validation. Instead of
  * returning false, throws an exception.
  *
  * @param \ComicAPI\Tokens\TokenInterface $token Instance of Token.
  *
  * @throws \ComicAPI\Exceptions\ComicApiException
  */
 protected function isValidSingle(TokenInterface $token)
 {
     if ($token->isValid() === false) {
         throw new ComicApiException(sprintf("The token %s is invalid.", $token->getType()));
     }
 }