for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace BenTools\SimpleDBAL\Model;
trait ConfigurableTrait
{
protected $options;
/**
* @param $key
* @return mixed
*/
public function getOption($key)
if (null === $this->options) {
$this->options = $this->getDefaultOptions();
}
return $this->options[$key] ?? null;
* @return bool
public function hasOption($key): bool
return array_key_exists($key, $this->options);
* @return array
public function getOptions(): array
return $this->options;
* @param $value
public function setOption($key, $value)
$this->options[$key] = $value;
public function unsetOption($key)
unset($this->options[$key]);
public function getDefaultOptions(): array
return [];