class StringContainsToken in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/phpspec/prophecy/src/Prophecy/Argument/Token/StringContainsToken.php \Prophecy\Argument\Token\StringContainsToken
String contains token.
@author Peter Mitchell <pete@peterjmit.com>
Hierarchy
- class \Prophecy\Argument\Token\StringContainsToken implements TokenInterface
Expanded class hierarchy of StringContainsToken
File
- vendor/
phpspec/ prophecy/ src/ Prophecy/ Argument/ Token/ StringContainsToken.php, line 19
Namespace
Prophecy\Argument\TokenView source
class StringContainsToken implements TokenInterface {
private $value;
/**
* Initializes token.
*
* @param string $value
*/
public function __construct($value) {
$this->value = $value;
}
public function scoreArgument($argument) {
return strpos($argument, $this->value) !== false ? 6 : false;
}
/**
* Returns preset value against which token checks arguments.
*
* @return mixed
*/
public function getValue() {
return $this->value;
}
/**
* Returns false.
*
* @return bool
*/
public function isLast() {
return false;
}
/**
* Returns string representation for token.
*
* @return string
*/
public function __toString() {
return sprintf('contains("%s")', $this->value);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
StringContainsToken:: |
private | property | ||
StringContainsToken:: |
public | function | Returns preset value against which token checks arguments. | |
StringContainsToken:: |
public | function |
Returns false. Overrides TokenInterface:: |
|
StringContainsToken:: |
public | function |
Calculates token match score for provided argument. Overrides TokenInterface:: |
|
StringContainsToken:: |
public | function | Initializes token. | |
StringContainsToken:: |
public | function |
Returns string representation for token. Overrides TokenInterface:: |