class IdenticalValueToken in Zircon Profile 8.0
Same name and namespace in other branches
- 8 vendor/phpspec/prophecy/src/Prophecy/Argument/Token/IdenticalValueToken.php \Prophecy\Argument\Token\IdenticalValueToken
Identical value token.
@author Florian Voutzinos <florian@voutzinos.com>
Hierarchy
- class \Prophecy\Argument\Token\IdenticalValueToken implements TokenInterface
Expanded class hierarchy of IdenticalValueToken
File
- vendor/
phpspec/ prophecy/ src/ Prophecy/ Argument/ Token/ IdenticalValueToken.php, line 21
Namespace
Prophecy\Argument\TokenView source
class IdenticalValueToken implements TokenInterface {
private $value;
private $string;
private $util;
/**
* Initializes token.
*
* @param mixed $value
* @param StringUtil $util
*/
public function __construct($value, StringUtil $util = null) {
$this->value = $value;
$this->util = $util ?: new StringUtil();
}
/**
* Scores 11 if argument matches preset value.
*
* @param $argument
*
* @return bool|int
*/
public function scoreArgument($argument) {
return $argument === $this->value ? 11 : false;
}
/**
* Returns false.
*
* @return bool
*/
public function isLast() {
return false;
}
/**
* Returns string representation for token.
*
* @return string
*/
public function __toString() {
if (null === $this->string) {
$this->string = sprintf('identical(%s)', $this->util
->stringify($this->value));
}
return $this->string;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
IdenticalValueToken:: |
private | property | ||
IdenticalValueToken:: |
private | property | ||
IdenticalValueToken:: |
private | property | ||
IdenticalValueToken:: |
public | function |
Returns false. Overrides TokenInterface:: |
|
IdenticalValueToken:: |
public | function |
Scores 11 if argument matches preset value. Overrides TokenInterface:: |
|
IdenticalValueToken:: |
public | function | Initializes token. | |
IdenticalValueToken:: |
public | function |
Returns string representation for token. Overrides TokenInterface:: |