lib/Configuration.php
public function isValid()
  {
    if (!is_string($this->accessToken))
    {
      $msg = 'Provided access token is invalid as it is not a string';
      throw new Errors\ConfigurationError($msg);
    }

    if (preg_match('/\s/', $this->accessToken))
    {
      $msg = 'Provided access token is invalid '
        . 'as it contains disallowed characters. '
        . 'Please double-check your access token.';
      throw new Errors\ConfigurationError($msg);
    }

    if (strlen($this->accessToken) != 64)
    {
      $msg = 'Provided access token is invalid '
        . 'as it contains disallowed characters. '
        . 'Please double-check your access token.';
      throw new Errors\ConfigurationError($msg);
    }

    if (!is_string($this->baseUrl) || !preg_match(Configuration::URL_REGEXP, $this->baseUrl))
    {
      $msg = 'Provided base url is invalid '
        . 'as it is not a valid URI. '
        . 'Please make sure it includes the schema part, both http and https are accepted, '
        . 'and the hierarchical part.';
      throw new Errors\ConfigurationError($msg);
    }

    return true;
  }
public function isValid()
  {
    if (!is_string($this->accessToken))
    {
      $msg = 'Provided access token is invalid as it is not a string';
      throw new Errors\ConfigurationError($msg);
    }

    if (preg_match('/\s/', $this->accessToken))
    {
      $msg = 'Provided access token is invalid '
        . 'as it contains disallowed characters. '
        . 'Please double-check your access token.';
      throw new Errors\ConfigurationError($msg);
    }

    if (strlen($this->accessToken) != 64)
    {
      $msg = 'Provided access token is invalid '
        . 'as it contains disallowed characters. '
        . 'Please double-check your access token.';
      throw new Errors\ConfigurationError($msg);
    }

    if (!is_string($this->baseUrl) || !preg_match(Configuration::URL_REGEXP, $this->baseUrl))
    {
      $msg = 'Provided base url is invalid '
        . 'as it is not a valid URI. '
        . 'Please make sure it includes the schema part, both http and https are accepted, '
        . 'and the hierarchical part.';
      throw new Errors\ConfigurationError($msg);
    }

    return true;
  }
public function isValid ( ) { if ( ! is_string ( $ this -> accessToken ) ) { $ msg = 'Provided access token is invalid as it is not a string' ; throw new Errors \ ConfigurationError ( $ msg ) ; } if ( preg_match ( '/\s/' , $ this -> accessToken ) ) { $ msg = 'Provided access token is invalid ' . 'as it contains disallowed characters. ' . 'Please double-check your access token.' ; throw new Errors \ ConfigurationError ( $ msg ) ; } if ( strlen ( $ this -> accessToken ) != 64 ) { $ msg = 'Provided access token is invalid ' . 'as it contains disallowed characters. ' . 'Please double-check your access token.' ; throw new Errors \ ConfigurationError ( $ msg ) ; } if ( ! is_string ( $ this -> baseUrl ) || ! preg_match ( Configuration :: URL_REGEXP , $ this -> baseUrl ) ) { $ msg = 'Provided base url is invalid ' . 'as it is not a valid URI. ' . 'Please make sure it includes the schema part, both http and https are accepted, ' . 'and the hierarchical part.' ; throw new Errors \ ConfigurationError ( $ msg ) ; } return true ; }
Checks if provided configuration is valid.

@throws \BaseCRM\Errors\ConfigurationError if provided access token is invalid - contains disallowed characters
@throws \BaseCRM\Errors\ConfigurationError if provided access token is invalid - has invalid length
@throws \BaseCRM\Errors\ConfigurationError if provided base url is invalid

@return boolean
Checks if provided configuration is valid .