public function themePath(string $resource): string
    {
        if (null === $this->theme) {
            return $resource;
        }

        if (file_exists($this->sourceDirectory.'/'.$resource)) {
            return $resource;
        }

        $themeResource = $this->findThemeResource($this->theme, $resource);
        if (null !== $themeResource) {
            return $themeResource;
        }

        if (isset($this->theme['parent'])) {
            $themeResource = $this->findThemeResource($this->theme['parent'], $resource);
            if (null !== $themeResource) {
                return $themeResource;
            }
        }

        return $resource;
    }
public function themePath(string $resource): string
    {
        if (null === $this->theme) {
            return $resource;
        }

        if (file_exists($this->sourceDirectory.'/'.$resource)) {
            return $resource;
        }

        $themeResource = $this->findThemeResource($this->theme, $resource);
        if (null !== $themeResource) {
            return $themeResource;
        }

        if (isset($this->theme['parent'])) {
            $themeResource = $this->findThemeResource($this->theme['parent'], $resource);
            if (null !== $themeResource) {
                return $themeResource;
            }
        }

        return $resource;
    }
public function themePath ( string $ resource ) : string { if ( null === $ this -> theme ) { return $ resource ; } if ( file_exists ( $ this -> sourceDirectory . '/' . $ resource ) ) { return $ resource ; } $ themeResource = $ this -> findThemeResource ( $ this -> theme , $ resource ) ; if ( null !== $ themeResource ) { return $ themeResource ; } if ( isset ( $ this -> theme [ 'parent' ] ) ) { $ themeResource = $ this -> findThemeResource ( $ this -> theme [ 'parent' ] , $ resource ) ; if ( null !== $ themeResource ) { return $ themeResource ; } } return $ resource ; }
Generate a URL for a Theme's resource

Will always return a value. Default return value is the input unless the
file actually exists at a theme location.
Generate a URL for a Theme s resource