Constructor.
string $class The class the getter is defined on:
string $property The property which the getter returns:
Overrides MemberMetadata::__construct
public function __construct($class, $property) {
$getMethod = 'get' . ucfirst($property);
$isMethod = 'is' . ucfirst($property);
if (method_exists($class, $getMethod)) {
$method = $getMethod;
}
elseif (method_exists($class, $isMethod)) {
$method = $isMethod;
}
else {
throw new ValidatorException(sprintf('Neither method %s nor %s exists in class %s', $getMethod, $isMethod, $class));
}
parent::__construct($class, $method, $property);
}