/**
  * @param string|integer $key
  */
 public function offsetUnset($key)
 {
     $unwrapper = new Unwrapper();
     $subject = $this->caller->getWrappedObject();
     $key = $unwrapper->unwrapOne($key);
     $this->checkIfSubjectImplementsArrayAccess($subject);
     unset($subject[$key]);
 }
示例#2
0
 /**
  * @param string $property
  *
  * @return string|Subject
  */
 public function __get($property)
 {
     return $this->caller->get($property);
 }
示例#3
0
 /**
  * @param string $property
  * @param mixed $value
  *
  * @return mixed
  */
 public function __set($property, $value = null)
 {
     return $this->caller->set($property, $value);
 }
 /**
  * @return InterfaceNotImplementedException
  */
 private function interfaceNotImplemented()
 {
     return new InterfaceNotImplementedException(sprintf('%s does not implement %s interface, but should.', $this->presenter->presentValue($this->caller->getWrappedObject()), $this->presenter->presentString('ArrayAccess')), $this->caller->getWrappedObject(), 'ArrayAccess');
 }