public function getResourceByUri($uri)
    {
        // get rid of everything after the ?
        $uri = \strtok($uri, '?');

        $resources = $this->getResourcesAsArray($this->resources);
        foreach ($resources as $resource) {
            \assert($resource instanceof Resource);
            if ($resource->matchesUri($uri)) {
                return $resource;
            }
        }

        throw new ResourceNotFoundException($uri);
    }
public function getResourceByUri($uri)
    {
        // get rid of everything after the ?
        $uri = \strtok($uri, '?');

        $resources = $this->getResourcesAsArray($this->resources);
        foreach ($resources as $resource) {
            \assert($resource instanceof Resource);
            if ($resource->matchesUri($uri)) {
                return $resource;
            }
        }

        throw new ResourceNotFoundException($uri);
    }
public function getResourceByUri ( $ uri ) { // get rid of everything after the ? $ uri = \ strtok ( $ uri , '?' ) ; $ resources = $ this -> getResourcesAsArray ( $ this -> resources ) ; foreach ( $ resources as $ resource ) { \ assert ( $ resource instanceof Resource ) ; if ( $ resource -> matchesUri ( $ uri ) ) { return $ resource ; } } throw new ResourceNotFoundException ( $ uri ) ; }
Get a resource by a uri

@param string $uri
@return resource

@throws ResourceNotFoundException
Get a resource by a uri