summaryrefslogtreecommitdiff
path: root/src/Config
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2018-08-20 20:58:51 +0200
committerIgor Scheller <igor.scheller@igorshp.de>2018-08-20 21:07:57 +0200
commitd6c8f1a61475fefa9594141aaf12a28d220bdaf8 (patch)
tree905051fdb1307f947c3a3a7be240609f8bc00e59 /src/Config
parentbf6efe532c8f2de84e95b090911280a9b1b61ce8 (diff)
parent2f41b9e4418def9b69cf237312bc592364585025 (diff)
Merge branch 'master' to 'rebuild-database'
Diffstat (limited to 'src/Config')
-rw-r--r--src/Config/Config.php51
1 files changed, 9 insertions, 42 deletions
diff --git a/src/Config/Config.php b/src/Config/Config.php
index 34c21a78..b1a93324 100644
--- a/src/Config/Config.php
+++ b/src/Config/Config.php
@@ -2,14 +2,16 @@
namespace Engelsystem\Config;
-class Config
+use Illuminate\Support\Fluent;
+
+class Config extends Fluent
{
/**
* The config values
*
* @var array
*/
- protected $data = [];
+ protected $attributes = [];
/**
* @param string|null $key
@@ -19,11 +21,11 @@ class Config
public function get($key, $default = null)
{
if (is_null($key)) {
- return $this->data;
+ return $this->attributes;
}
if ($this->has($key)) {
- return $this->data[$key];
+ return $this->attributes[$key];
}
return $default;
@@ -43,7 +45,7 @@ class Config
return;
}
- $this->data[$key] = $value;
+ $this->attributes[$key] = $value;
}
/**
@@ -52,7 +54,7 @@ class Config
*/
public function has($key)
{
- return isset($this->data[$key]);
+ return $this->offsetExists($key);
}
/**
@@ -60,41 +62,6 @@ class Config
*/
public function remove($key)
{
- unset($this->data[$key]);
- }
-
- /**
- * @param string $key
- * @return mixed
- */
- public function __get($key)
- {
- return $this->get($key);
- }
-
- /**
- * @param string $key
- * @param mixed $value
- */
- public function __set($key, $value)
- {
- $this->set($key, $value);
- }
-
- /**
- * @param string $key
- * @return bool
- */
- public function __isset($key)
- {
- return $this->has($key);
- }
-
- /**
- * @param string $key
- */
- public function __unset($key)
- {
- $this->remove($key);
+ $this->offsetUnset($key);
}
}