src/TrustApi.php
/**
     * [checkUrl check if the passed url is correct and exists on Trustpiolet]
     * @return [boolean]
     */
[checkUrl check if the passed url is correct and exists on Trustpiolet]
@return [boolean]
[ checkUrl check if the passed url is correct and exists on Trustpiolet ] @return [ boolean ]
private function checkUrl()
    {
        if (!$this->url_exist($this->url)) {
            throw new Exception("Website not available on Trustpilot, Please check by opening following url in new tab [" . $this->url . "]", 1);
        }
        $pattern = "/\b(trustpilot.com\/review\/)\b/";
        if (!preg_match($pattern, $this->url)) {
            throw new InvalidArgumentException('Please provide a valid URL to get reviews! like "https://www.trustpilot.com/review/example.com"');
        }
        return true;
    }
private function checkUrl ( ) { if ( ! $ this -> url_exist ( $ this -> url ) ) { throw new Exception ( " Website not available on Trustpilot, Please check by opening following url in new tab [ " . $ this -> url . " ] " , 1 ) ; } $ pattern = " /\b(trustpilot.com\/review\/)\b/ " ; if ( ! preg_match ( $ pattern , $ this -> url ) ) { throw new InvalidArgumentException ( 'Please provide a valid URL to get reviews! like "https://www.trustpilot.com/review/example.com"' ) ; } return true ; }
[checkUrl check if the passed url is correct and exists on Trustpiolet]
 @return [boolean]
[ checkUrl check if the passed url is correct and exists on Trustpiolet ] @return [ boolean ]