示例#1
0
 /**
  * @param null $path
  * @param null $default
  * @return Config|null
  */
 public function getConfig($path = null, $default = null)
 {
     if (!$this->config instanceof Config) {
         return is_array($default) ? new Config([]) : $default;
     }
     if ($path) {
         return $this->config->get($path, $default);
     }
     return $this->config;
 }
示例#2
0
 public function getConfig($path = null, $default = null)
 {
     if (is_null($path)) {
         if (is_null($this->config)) {
             return new Config([]);
         }
         return $this->config;
     } else {
         return !is_null($this->config) ? $this->config->get($path, $default) : $default;
     }
 }
示例#3
0
 /**
  * @param null $path
  * @param null $default
  * @return Config
  */
 public function getConfig($path = null, $default = null)
 {
     if (is_null($this->config)) {
         $this->config = $this->getConfigLoader()->getConfig();
     }
     return $this->config->get($path, $default);
 }