MDL-50887 antivirus: Add config getter to base class.

Improving architecture to make it testable.
This commit is contained in:
Ruslan Kabalin
2016-02-29 09:31:29 +00:00
parent 5b6a0f2c15
commit 17d7ee0eea
+15
View File
@@ -51,6 +51,21 @@ abstract class scanner {
$this->config = get_config($ref->getNamespaceName());
}
/**
* Config get method.
*
* @param string $property config property to get.
*
* @return mixed
* @throws \coding_exception
*/
public function get_config($property) {
if (property_exists($this->config, $property)) {
return $this->config->$property;
}
throw new \coding_exception('Config property "' . $property . '" doesn\'t exist');
}
/**
* Are the antivirus settings configured?
*