get() публичный Метод

Get the specified configuration value.
public get ( string $key, mixed $default = null ) : mixed
$key string key
$default mixed default value
Результат mixed
Пример #1
0
 public function testAdd()
 {
     $container = new Container('\\Illuminate\\Support\\Arr');
     $key = 'uiobject/xpressengine@select';
     $container->add($key, 'My\\Class\\Select');
     $this->assertEquals('My\\Class\\Select', $container->get($key));
 }
Пример #2
0
 /**
  * get registered proxy
  *
  * @param string $name proxy name
  * @return ProxyInterface
  * @throws Exceptions\NotExistsProxyException
  */
 public function getProxy($name)
 {
     $proxy = $this->container->get(self::REGISTER_KEY, $name);
     if ($proxy == null) {
         throw new Exceptions\NotExistsProxyException();
     }
     return $proxy;
 }
Пример #3
0
 /**
  * 휴지통 반환
  *
  * @return WasteInterface[]
  */
 public function gets()
 {
     return $this->register->get(self::REGISTER_KEY);
 }
Пример #4
0
 /**
  * getRegisteredMenus
  *
  * @return array
  * @throws \Exception
  */
 private function getRegisteredMenus()
 {
     $menus = $this->container->get('settings/menu');
     $menuObjects = [];
     foreach ($menus as $id => $menuInfo) {
         if (!isset($menuInfo['id'])) {
             if (!is_string($id)) {
                 throw new \Exception();
             } else {
                 $menuInfo['id'] = $id;
             }
         }
         $menuObjects[$menuInfo['id']] = new SettingsMenu($menuInfo);
     }
     return $menuObjects;
 }
Пример #5
0
 /**
  * get Registrable class name
  *
  * @param string $id component's id
  *
  * @return mixed
  */
 public function get($id)
 {
     return $this->register->get($id);
 }