4 * This file is part of the Prophecy.
5 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
6 * Marcello Duarte <marcello.duarte@gmail.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Prophecy\Argument\Token;
17 * @author Boris Mikhaylov <kaguxmail@gmail.com>
19 class LogicalNotToken implements TokenInterface
21 /** @var \Prophecy\Argument\Token\TokenInterface */
25 * @param mixed $value exact value or token
27 public function __construct($value)
29 $this->token = $value instanceof TokenInterface? $value : new ExactValueToken($value);
33 * Scores 4 when preset token does not match the argument.
39 public function scoreArgument($argument)
41 return false === $this->token->scoreArgument($argument) ? 4 : false;
45 * Returns true if preset token is last.
49 public function isLast()
51 return $this->token->isLast();
55 * Returns originating token.
57 * @return TokenInterface
59 public function getOriginatingToken()
65 * Returns string representation for token.
69 public function __toString()
71 return sprintf('not(%s)', $this->token);