/** * Constructor * * @author Art <*****@*****.**> * * @param array $cfg Your custom configuration parameters */ public function __construct(array $cfg = []) { parent::__construct(self::$default); foreach ($cfg as $k => $v) { //Perform all the checks while adding $this->set($k, $v); } }
/** * Constructor * * @author Art <*****@*****.**> * * @param array $defaults The default config of extending classes * @param array $cfg Default configuration overrides */ public function __construct(array $defaults = [], array $cfg = []) { self::setDefaults(); parent::__construct(array_merge(self::$defaults, $defaults), $cfg); }
/** * Constructor * * @author Art <*****@*****.**> * * @param array $cfg Your custom config overrides */ public function __construct(array $cfg = []) { self::setDefaultConfig(); parent::__construct(self::$defaults, $cfg); }