public function validateOriginUri($origin)
    {
        $origin = (string)$origin;
        if (!$origin) {
            throw new InvalidArgumentException('Invalid URI');
        }

        $scheme = parse_url($origin, PHP_URL_SCHEME);
        if (!$scheme) {
            throw new InvalidArgumentException('Invalid scheme');
        }

        $host = parse_url($origin, PHP_URL_HOST);
        if (!$host) {
            throw new InvalidArgumentException("Invalid host");
        }

        return $origin;
    }
public function validateOriginUri($origin)
    {
        $origin = (string)$origin;
        if (!$origin) {
            throw new InvalidArgumentException('Invalid URI');
        }

        $scheme = parse_url($origin, PHP_URL_SCHEME);
        if (!$scheme) {
            throw new InvalidArgumentException('Invalid scheme');
        }

        $host = parse_url($origin, PHP_URL_HOST);
        if (!$host) {
            throw new InvalidArgumentException("Invalid host");
        }

        return $origin;
    }
public function validateOriginUri ( $ origin ) { $ origin = ( string ) $ origin ; if ( ! $ origin ) { throw new InvalidArgumentException ( 'Invalid URI' ) ; } $ scheme = parse_url ( $ origin , PHP_URL_SCHEME ) ; if ( ! $ scheme ) { throw new InvalidArgumentException ( 'Invalid scheme' ) ; } $ host = parse_url ( $ origin , PHP_URL_HOST ) ; if ( ! $ host ) { throw new InvalidArgumentException ( "Invalid host" ) ; } return $ origin ; }
Validates an origin URI

@param string $origin
@throws InvalidArgumentException
@return string
Validates an origin URI