Exemplo n.º 1
0
 /**
  * Parses the config array by passing the values through each method to check
  * validity against if the option exists.
  *
  * @access public
  * @param  array $config
  * @throws \Khill\Lavacharts\Exceptions\InvalidConfigValue
  * @throws \Khill\Lavacharts\Exceptions\InvalidConfigProperty
  */
 public function setOptions($config)
 {
     if (is_array($config) === false) {
         throw new InvalidConfigValue(static::TYPE . '->' . __FUNCTION__, 'array');
     }
     foreach ($config as $option => $value) {
         if ($this->options->hasOption($option) === false) {
             throw new InvalidConfigProperty(static::TYPE, __FUNCTION__, $option, $this->options->getDefaults());
         }
         call_user_func([$this, $option], $value);
     }
 }