for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace steevanb\SymfonyFormOptionsBuilder\Behavior;
trait OptionTrait
{
/** @var array */
protected $options = array();
/**
* @param string $name
* @param mixed $value
* @return $this
*/
public function setOption($name, $value)
if ($value === Option::DEFAULT_VALUE) {
$this->removeOption($name);
} else {
$this->options[$name] = $value;
}
return $this;
* @return mixed
public function getOption($name)
return (array_key_exists($name, $this->options)) ? $this->options[$name] : Option::DEFAULT_VALUE;
public function removeOption($name)
if (array_key_exists($name, $this->options)) {
unset($this->options[$name]);