src/Core/Manifest/ModuleResourceLoader.php
public function resolveResource($resource)
    {
        // String of the form vendor/package:resource. Excludes "http://bla" as that's an absolute URL
        if (!preg_match('#^ *(?<module>[^/: ]+/[^/: ]+) *: *(?<resource>[^ ]*)$#', $resource, $matches)) {
            return $resource;
        }
        $module = $matches['module'];
        $resource = $matches['resource'];
        $moduleObj = ModuleLoader::getModule($module);
        if (!$moduleObj) {
            throw new InvalidArgumentException("Can't find module '$module', the composer.json file may be missing from the modules installation directory");
        }
        $resourceObj = $moduleObj->getResource($resource);

        return $resourceObj;
    }
public function resolveResource($resource)
    {
        // String of the form vendor/package:resource. Excludes "http://bla" as that's an absolute URL
        if (!preg_match('#^ *(?<module>[^/: ]+/[^/: ]+) *: *(?<resource>[^ ]*)$#', $resource, $matches)) {
            return $resource;
        }
        $module = $matches['module'];
        $resource = $matches['resource'];
        $moduleObj = ModuleLoader::getModule($module);
        if (!$moduleObj) {
            throw new InvalidArgumentException("Can't find module '$module', the composer.json file may be missing from the modules installation directory");
        }
        $resourceObj = $moduleObj->getResource($resource);

        return $resourceObj;
    }
public function resolveResource ( $ resource ) { // String of the form vendor/package:resource. Excludes "http://bla" as that's an absolute URL if ( ! preg_match ( '#^ *(?<module>[^/: ]+/[^/: ]+) *: *(?<resource>[^ ]*)$#' , $ resource , $ matches ) ) { return $ resource ; } $ module = $ matches [ 'module' ] ; $ resource = $ matches [ 'resource' ] ; $ moduleObj = ModuleLoader :: getModule ( $ module ) ; if ( ! $ moduleObj ) { throw new InvalidArgumentException ( "Can't find module '$module', the composer.json file may be missing from the modules installation directory" ) ; } $ resourceObj = $ moduleObj -> getResource ( $ resource ) ; return $ resourceObj ; }
Return module resource for the given path, if specified as one.
Returns the original resource otherwise.

@param string $resource
@return ModuleResource|string The resource, or input string if not a module resource
Return module resource for the given path if specified as one . Returns the original resource otherwise .