MonitoredObject: Remove deprecated methods `matches()` and `fromParams()`
This commit is contained in:
parent
60756afa34
commit
be1ff03dd3
|
@ -234,30 +234,6 @@ abstract class MonitoredObject implements Filterable
|
|||
// Left out on purpose. Interface is deprecated.
|
||||
}
|
||||
|
||||
/**
|
||||
* Return whether this object matches the given filter
|
||||
*
|
||||
* @param Filter $filter
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
* @throws ProgrammingError In case the object cannot be found
|
||||
*
|
||||
* @deprecated Use $filter->matches($object) instead
|
||||
*/
|
||||
public function matches(Filter $filter)
|
||||
{
|
||||
if ($this->properties === null && $this->fetch() === false) {
|
||||
throw new ProgrammingError(
|
||||
'Unable to apply filter. Object %s of type %s not found.',
|
||||
$this->getName(),
|
||||
$this->getType()
|
||||
);
|
||||
}
|
||||
|
||||
return $filter->matches($this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Require the object's type to be one of the given types
|
||||
*
|
||||
|
@ -951,17 +927,4 @@ abstract class MonitoredObject implements Filterable
|
|||
|
||||
throw new InvalidPropertyException('Can\'t access property \'%s\'. Property does not exist.', $name);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
public static function fromParams(UrlParams $params)
|
||||
{
|
||||
if ($params->has('service') && $params->has('host')) {
|
||||
return new Service(MonitoringBackend::instance(), $params->get('host'), $params->get('service'));
|
||||
} elseif ($params->has('host')) {
|
||||
return new Host(MonitoringBackend::instance(), $params->get('host'));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue