protected function PHPUnit_Framework_Constraint_ClassHasStaticAttribute::matches in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/phpunit/phpunit/src/Framework/Constraint/ClassHasStaticAttribute.php \PHPUnit_Framework_Constraint_ClassHasStaticAttribute::matches()
Evaluates the constraint for parameter $other. Returns true if the constraint is met, false otherwise.
Parameters
mixed $other Value or object to evaluate.:
Return value
bool
Overrides PHPUnit_Framework_Constraint_ClassHasAttribute::matches
File
- vendor/
phpunit/ phpunit/ src/ Framework/ Constraint/ ClassHasStaticAttribute.php, line 28
Class
- PHPUnit_Framework_Constraint_ClassHasStaticAttribute
- Constraint that asserts that the class it is evaluated for has a given static attribute.
Code
protected function matches($other) {
$class = new ReflectionClass($other);
if ($class
->hasProperty($this->attributeName)) {
$attribute = $class
->getProperty($this->attributeName);
return $attribute
->isStatic();
}
else {
return false;
}
}