/** * @param array $options * @param bool $append */ public static function setDefaultOptions(array $options, $append = false) { if ($append) { foreach ($options as $option => $value) { static::$defaultOptions[$option] = $value; } } else { static::$defaultOptions = $options; } }
public function __construct() { static::$defaultOptions = static::$overrideOptions + static::$defaultOptions; parent::__construct(); }
/** * Set default options * * If an array is given on $option parameter it should be assigned * to the static $defaultOptions property. * * For other values only the key provided in $option parameter should * be overridden. * * @param array|string|int $option * * @param mixed $value */ public static function setDefaultOptions($option, $value = null) { if (is_array($option) && null == $value) { static::$defaultOptions = $option; } if (is_scalar($option)) { static::$defaultOptions[$option] = $value; } }