dynamic branding options (#1205)

This commit is contained in:
Kevin Papst
2019-10-30 14:22:34 +01:00
committed by GitHub
parent 48aefb1862
commit f4fcfeba9d
11 changed files with 135 additions and 7 deletions

View File

@@ -26,9 +26,6 @@ trait StringAccessibleConfigTrait
*/
protected $initialized = false;
/**
* @param array $settings
*/
public function __construct(ConfigLoaderInterface $repository, array $settings)
{
$this->repository = $repository;
@@ -120,4 +117,45 @@ trait StringAccessibleConfigTrait
return $config[$search];
}
/**
* @return bool
*/
public function offsetExists($offset)
{
try {
$this->find($offset);
} catch (\Exception $ex) {
return false;
}
return true;
}
/**
* @return mixed
*/
public function offsetGet($offset)
{
return $this->find($offset);
}
/**
* @param mixed $offset
* @param mixed $value
* @throws \BadMethodCallException
*/
public function offsetSet($offset, $value)
{
throw new \BadMethodCallException('SystemBundleConfiguration does not support offsetSet()');
}
/**
* @param mixed $offset
* @throws \BadMethodCallException
*/
public function offsetUnset($offset)
{
throw new \BadMethodCallException('SystemBundleConfiguration does not support offsetUnset()');
}
}

View File

@@ -9,7 +9,7 @@
namespace App\Configuration;
class ThemeConfiguration implements SystemBundleConfiguration
class ThemeConfiguration implements SystemBundleConfiguration, \ArrayAccess
{
use StringAccessibleConfigTrait;