PhpSpec\Wrapper\Subject\SubjectWithArrayAccess::offsetExists PHP Method

offsetExists() public method

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

Usage Example

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