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;
15 * String contains token.
17 * @author Peter Mitchell <pete@peterjmit.com>
19 class StringContainsToken implements TokenInterface
26 * @param string $value
28 public function __construct($value)
30 $this->value = $value;
33 public function scoreArgument($argument)
35 return is_string($argument) && strpos($argument, $this->value) !== false ? 6 : false;
39 * Returns preset value against which token checks arguments.
43 public function getValue()
53 public function isLast()
59 * Returns string representation for token.
63 public function __toString()
65 return sprintf('contains("%s")', $this->value);