public function isValid(array $codes = null)
    {
        if ($codes === null) {
            return $this->statusCode === 200;
        }

        return in_array($this->statusCode, $codes);
    }
public function isValid(array $codes = null)
    {
        if ($codes === null) {
            return $this->statusCode === 200;
        }

        return in_array($this->statusCode, $codes);
    }
public function isValid ( array $ codes = null ) { if ( $ codes === null ) { return $ this -> statusCode === 200 ; } return in_array ( $ this -> statusCode , $ codes ) ; }
Check if the response is valid or not.

@param array $codes

@return bool
Check if the response is valid or not .