/** * @return mixed */ public function getWrappedObject() { if ($this->subject) { return $this->subject; } return $this->subject = $this->caller->getWrappedObject(); }
/** * @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]); }
/** * @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'); }