private function validate()
    {
        if (null === $this->provider) {
            throw new MissingProviderException('A provider must be set for converting a currency');
        }

        if (null === $this->from || null === $this->to) {
            throw new \RuntimeException('from and to parameters must be provided');
        }
    }
private function validate()
    {
        if (null === $this->provider) {
            throw new MissingProviderException('A provider must be set for converting a currency');
        }

        if (null === $this->from || null === $this->to) {
            throw new \RuntimeException('from and to parameters must be provided');
        }
    }
private function validate ( ) { if ( null === $ this -> provider ) { throw new MissingProviderException ( 'A provider must be set for converting a currency' ) ; } if ( null === $ this -> from || null === $ this -> to ) { throw new \ RuntimeException ( 'from and to parameters must be provided' ) ; } }
Verify if the conversation can be done.

@throws MissingProviderException thrown if the provider is missing
@throws \RuntimeException thrown if to or from parameters are missing
Verify if the conversation can be done .