Ejemplo n.º 1
0
 public static function setParameter($namespace, $key, $value)
 {
     if (!is_string($namespace) && !is_null($namespace)) {
         throw new InvalidArgumentException('`$namespace` must be a string');
     }
     if (!is_string($key)) {
         throw new InvalidArgumentException('`$key` must be a string');
     }
     if (is_null($namespace)) {
         if (is_null(self::$configuration)) {
             self::$configuration = array();
         }
         self::$configuration[$key] = $value;
     } else {
         if (is_null(self::$configuration)) {
             self::$configuration = array();
             self::$configuration[$namespace] = array();
         } else {
             if (!array_key_exists($namespace, self::$configuration)) {
                 self::$configuration[$namespace] = array();
             }
         }
         self::$configuration[$namespace][$key] = $value;
     }
 }