summaryrefslogtreecommitdiffstats
path: root/vendor/fguillot/picofeed/lib/PicoFeed/Config/Config.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/fguillot/picofeed/lib/PicoFeed/Config/Config.php')
-rw-r--r--vendor/fguillot/picofeed/lib/PicoFeed/Config/Config.php22
1 files changed, 10 insertions, 12 deletions
diff --git a/vendor/fguillot/picofeed/lib/PicoFeed/Config/Config.php b/vendor/fguillot/picofeed/lib/PicoFeed/Config/Config.php
index 1eaaeef9e..127968c04 100644
--- a/vendor/fguillot/picofeed/lib/PicoFeed/Config/Config.php
+++ b/vendor/fguillot/picofeed/lib/PicoFeed/Config/Config.php
@@ -3,10 +3,9 @@
namespace PicoFeed\Config;
/**
- * Config class
+ * Config class.
*
* @author Frederic Guillot
- * @package picofeed
*
* @method \PicoFeed\Config\Config setClientTimeout(integer $value)
* @method \PicoFeed\Config\Config setClientUserAgent(string $value)
@@ -34,7 +33,6 @@ namespace PicoFeed\Config;
* @method \PicoFeed\Config\Config setFilterImageProxyUrl($value)
* @method \PicoFeed\Config\Config setFilterImageProxyCallback($closure)
* @method \PicoFeed\Config\Config setFilterImageProxyProtocol($value)
- *
* @method integer getClientTimeout()
* @method string getClientUserAgent()
* @method integer getMaxRedirections()
@@ -65,22 +63,21 @@ namespace PicoFeed\Config;
class Config
{
/**
- * Contains all parameters
+ * Contains all parameters.
*
- * @access private
* @var array
*/
private $container = array();
/**
- * Magic method to have any kind of setters or getters
+ * Magic method to have any kind of setters or getters.
+ *
+ * @param string $name Getter/Setter name
+ * @param array $arguments Method arguments
*
- * @access public
- * @param string $name Getter/Setter name
- * @param array $arguments Method arguments
* @return mixed
*/
- public function __call($name , array $arguments)
+ public function __call($name, array $arguments)
{
$name = strtolower($name);
$prefix = substr($name, 0, 3);
@@ -88,10 +85,11 @@ class Config
if ($prefix === 'set' && isset($arguments[0])) {
$this->container[$parameter] = $arguments[0];
+
return $this;
- }
- else if ($prefix === 'get') {
+ } elseif ($prefix === 'get') {
$default_value = isset($arguments[0]) ? $arguments[0] : null;
+
return isset($this->container[$parameter]) ? $this->container[$parameter] : $default_value;
}
}