예제 #1
0
 public function testDelete()
 {
     DotArray::set($this->storage, 'foo.bar', 'baz');
     DotArray::set($this->storage, 'foo.baz', 'qux');
     DotArray::set($this->storage, 'foo.tuq', 'nux');
     $this->assertEquals($this->storage['foo']['bar'], 'baz');
     DotArray::delete($this->storage, 'foo.bar');
     $this->assertTrue(!isset($this->storage['foo']['bar']));
     $this->assertEquals($this->storage['foo']['baz'], 'qux');
     DotArray::delete($this->storage, 'foo');
     $this->assertTrue(!DotArray::has($this->storage, 'foo.tuq.nux'));
 }
예제 #2
0
 /**
  * Destroy session, or only the given key.
  * @param string key
  * @return \Exedra\Session\Session
  */
 public function destroy($key = null)
 {
     \Exedra\Support\DotArray::delete($this->storage, $key);
     return $this;
 }
예제 #3
0
파일: Config.php 프로젝트: rosengate/exedra
 /**
  * Unset config through array offset
  * @param string $key
  */
 public function offsetUnset($key)
 {
     \Exedra\Support\DotArray::delete($this->storage, $key);
 }