From 9b83074cc9ffd4e091c741c0d3c0053d8635963c Mon Sep 17 00:00:00 2001 From: Marius Hein Date: Thu, 28 Aug 2014 11:08:57 +0200 Subject: [PATCH] Class doc for ResourceFactory refs #5514 --- library/Icinga/Data/ResourceFactory.php | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/library/Icinga/Data/ResourceFactory.php b/library/Icinga/Data/ResourceFactory.php index 202e1005e..7f166f066 100644 --- a/library/Icinga/Data/ResourceFactory.php +++ b/library/Icinga/Data/ResourceFactory.php @@ -14,13 +14,23 @@ use Icinga\Protocol\Statusdat\Reader as StatusdatReader; use Icinga\Protocol\Ldap\Connection as LdapConnection; use Icinga\Protocol\File\Reader as FileReader; +/** + * Create resources from names or resource configuration + */ class ResourceFactory implements ConfigAwareFactory { /** + * Resource configuration + * * @var Zend_Config */ private static $resources; + /** + * Set resource configurations + * + * @param Zend_Config $config + */ public static function setConfig($config) { self::$resources = $config; @@ -29,10 +39,11 @@ class ResourceFactory implements ConfigAwareFactory /** * Get the configuration for a specific resource * - * @param $resourceName String The resource's name + * @param $resourceName String The resource's name * - * @return Zend_Config The configuration of the resource - * @throws \Icinga\Exception\ConfigurationError + * @return Zend_Config The configuration of the resource + * + * @throws ConfigurationError */ public static function getResourceConfig($resourceName) { @@ -72,7 +83,7 @@ class ResourceFactory implements ConfigAwareFactory /** * Check if the existing resources are set. If not, throw an error. * - * @throws \Icinga\Exception\ProgrammingError + * @throws ProgrammingError */ private static function assertResourcesExist() { @@ -93,7 +104,7 @@ class ResourceFactory implements ConfigAwareFactory * * @return DbConnection|LdapConnection|LivestatusConnection|StatusdatReader An objects that can be used to access * the given resource. The returned class depends on the configuration property 'type'. - * @throws \Icinga\Exception\ConfigurationError When an unsupported type is given + * @throws ConfigurationError When an unsupported type is given */ public static function createResource(Zend_Config $config) {