push() public method

만약 주어진 키에 해당하는 array가 없다면 array를 생성후 추가한다. Push a value onto an array configuration value.
public push ( string $key, mixed $id, mixed $value = null ) : void
$key string key
$id mixed pushed data's id
$value mixed pushed data's value
return void
 public function testPushOnlyValue()
 {
     $container = new Container('\\Illuminate\\Support\\Arr');
     $container->push('module/board/skin', 'My\\Class\\Blue');
     $container->push('module/board/skin', 'My\\Class\\White');
     $repo = $this->getRepoProperty($container);
     $this->assertEquals(['module/board/skin' => ['My\\Class\\Blue', 'My\\Class\\White']], $repo);
     return $container;
 }
Example #2
0
 /**
  * 휴지통 등록
  *
  * @param string $className 휴지통 class 이름
  * @return void
  */
 public function register($className)
 {
     $this->register->push(self::REGISTER_KEY, $className);
 }
 /**
  * register proxy
  *
  * @param ProxyInterface $proxy proxy instance
  * @return void
  */
 public function register(ProxyInterface $proxy)
 {
     $this->container->push(self::REGISTER_KEY, $proxy);
 }