/var/www/cobraambalaj/vendor/phpspec/prophecy/src/Prophecy/Argument/Token
NameSizeModeActions
AnyValuesToken.php9860644editdlrm
AnyValueToken.php9390644editdlrm
ApproximateValueToken.php11660644editdlrm
ArrayCountToken.php17610644editdlrm
ArrayEntryToken.php37320644editdlrm
ArrayEveryEntryToken.php16820644editdlrm
CallbackToken.php15800644editdlrm
ExactValueToken.php30080644editdlrm
IdenticalValueToken.php15100644editdlrm
InArrayToken.php14890644editdlrm
LogicalAndToken.php17840644editdlrm
LogicalNotToken.php15510644editdlrm
NotInArrayToken.php14980644editdlrm
ObjectStateToken.php26170644editdlrm
StringContainsToken.php13000644editdlrm
TokenInterface.php9120644editdlrm
TypeToken.php17010644editdlrm
Edit: /var/www/cobraambalaj/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/CallbackToken.php (1580B)
* Marcello Duarte * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Prophecy\Argument\Token; use Prophecy\Exception\InvalidArgumentException; /** * Callback-verified token. * * @author Konstantin Kudryashov */ class CallbackToken implements TokenInterface { private $callback; /** * Initializes token. * * @param callable $callback * * @throws \Prophecy\Exception\InvalidArgumentException */ public function __construct($callback) { if (!is_callable($callback)) { throw new InvalidArgumentException(sprintf( 'Callable expected as an argument to CallbackToken, but got %s.', gettype($callback) )); } $this->callback = $callback; } /** * Scores 7 if callback returns true, false otherwise. * * @param $argument * * @return bool|int */ public function scoreArgument($argument) { return call_user_func($this->callback, $argument) ? 7 : false; } /** * Returns false. * * @return bool */ public function isLast() { return false; } /** * Returns string representation for token. * * @return string */ public function __toString() { return 'callback()'; } }