public function validatePresenceOr($key1, $key2)
    {
        if ($this->exists($key1))
        {
            // Throw an exception if both parameters exist
            if ($this->exists($key2))
            {
                throw new \InvalidArgumentException("Either parameter '$key1' or '$key2' must be supplied, but not both.");
            }

            return true;
        }
        else if ($this->exists($key2))
        {
            return true;
        }

        throw new \InvalidArgumentException("Either the parameter '$key1' or '$key2' must be supplied.");
    }
public function validatePresenceOr($key1, $key2)
    {
        if ($this->exists($key1))
        {
            // Throw an exception if both parameters exist
            if ($this->exists($key2))
            {
                throw new \InvalidArgumentException("Either parameter '$key1' or '$key2' must be supplied, but not both.");
            }

            return true;
        }
        else if ($this->exists($key2))
        {
            return true;
        }

        throw new \InvalidArgumentException("Either the parameter '$key1' or '$key2' must be supplied.");
    }
public function validatePresenceOr ( $ key1 , $ key2 ) { if ( $ this -> exists ( $ key1 ) ) { // Throw an exception if both parameters exist if ( $ this -> exists ( $ key2 ) ) { throw new \ InvalidArgumentException ( "Either parameter '$key1' or '$key2' must be supplied, but not both." ) ; } return true ; } else if ( $ this -> exists ( $ key2 ) ) { return true ; } throw new \ InvalidArgumentException ( "Either the parameter '$key1' or '$key2' must be supplied." ) ; }
Verifies if one of the parameters was supplied
@param  string $key1 The first parameter name (array key)
@param  string $key1 The second parameter name (array key)
@return boolean
@throws InvalidArgumentException
Verifies if one of the parameters was supplied