public function getReferenceFromUrl($uri): Reference
    {
        try {
            $uri = uri_for($uri);
        } catch (\InvalidArgumentException $e) {
            // Wrap exception so that everything stays inside the Firebase namespace
            throw new InvalidArgumentException($e->getMessage(), $e->getCode());
        }

        if (($givenHost = $uri->getHost()) !== ($dbHost = $this->uri->getHost())) {
            throw new InvalidArgumentException(sprintf(
                'The given URI\'s host "%s" is not covered by the database for the host "%s".',
                $givenHost, $dbHost
            ));
        }

        return $this->getReference($uri->getPath());
    }
public function getReferenceFromUrl($uri): Reference
    {
        try {
            $uri = uri_for($uri);
        } catch (\InvalidArgumentException $e) {
            // Wrap exception so that everything stays inside the Firebase namespace
            throw new InvalidArgumentException($e->getMessage(), $e->getCode());
        }

        if (($givenHost = $uri->getHost()) !== ($dbHost = $this->uri->getHost())) {
            throw new InvalidArgumentException(sprintf(
                'The given URI\'s host "%s" is not covered by the database for the host "%s".',
                $givenHost, $dbHost
            ));
        }

        return $this->getReference($uri->getPath());
    }
public function getReferenceFromUrl ( $ uri ) : Reference { try { $ uri = uri_for ( $ uri ) ; } catch ( \ InvalidArgumentException $ e ) { // Wrap exception so that everything stays inside the Firebase namespace throw new InvalidArgumentException ( $ e -> getMessage ( ) , $ e -> getCode ( ) ) ; } if ( ( $ givenHost = $ uri -> getHost ( ) ) !== ( $ dbHost = $ this -> uri -> getHost ( ) ) ) { throw new InvalidArgumentException ( sprintf ( 'The given URI\'s host "%s" is not covered by the database for the host "%s".' , $ givenHost , $ dbHost ) ) ; } return $ this -> getReference ( $ uri -> getPath ( ) ) ; }
Returns a reference to the root or the path specified in url.

@see https://firebase.google.com/docs/reference/js/firebase.database.Database#refFromURL

@param string|UriInterface $uri

@throws InvalidArgumentException If the URL is invalid
@throws OutOfRangeException If the URL is not in the same domain as the current database

@return Reference
Returns a reference to the root or the path specified in url .