PhpSpec\Wrapper\Subject\SubjectWithArrayAccess::offsetGet PHP 메소드

offsetGet() 공개 메소드

public offsetGet ( string | integer $key ) : mixed
$key string | integer
리턴 mixed
    public function offsetGet($key)
    {
        $unwrapper = new Unwrapper();
        $subject = $this->caller->getWrappedObject();
        $key = $unwrapper->unwrapOne($key);
        $this->checkIfSubjectImplementsArrayAccess($subject);
        return $subject[$key];
    }

Usage Example

예제 #1
0
 /**
  * @param string|integer $key
  *
  * @return Subject
  */
 public function offsetGet($key)
 {
     return $this->wrap($this->arrayAccess->offsetGet($key));
 }