platform/api/symfony/Component/AssetMapper/AssetMapperRepository.yaml
2024-09-02 10:44:11 -07:00

87 lines
2.7 KiB
YAML

name: AssetMapperRepository
class_comment: '# * Finds assets in the asset mapper.
# *
# * @author Ryan Weaver <ryan@symfonycasts.com>
# *
# * @final'
dependencies:
- name: Filesystem
type: class
source: Symfony\Component\Filesystem\Filesystem
- name: RecursiveDirectoryIterator
type: class
source: Symfony\Component\Finder\Iterator\RecursiveDirectoryIterator
properties: []
methods:
- name: __construct
visibility: public
parameters:
- name: paths
- name: projectRootDir
- name: excludedPathPatterns
default: '[]'
- name: excludeDotFiles
default: 'true'
- name: debug
default: 'true'
comment: "# * Finds assets in the asset mapper.\n# *\n# * @author Ryan Weaver <ryan@symfonycasts.com>\n\
# *\n# * @final\n# */\n# class AssetMapperRepository\n# {\n# private ?array $absolutePaths\
\ = null;\n# \n# /**\n# * @param string[] $paths Array of assets paths: key is\
\ the path, value is the namespace\n# * (empty string for\
\ no namespace)"
- name: find
visibility: public
parameters:
- name: logicalPath
comment: '# * Given the logical path - styles/app.css - returns the absolute path
to the file.'
- name: findLogicalPath
visibility: public
parameters:
- name: filesystemPath
comment: null
- name: all
visibility: public
parameters: []
comment: '# * Returns an array of all files in the asset_mapper.
# *
# * Key is the logical path, value is the absolute path.
# *
# * @return string[]'
- name: allDirectories
visibility: public
parameters: []
comment: "# @var \\SplFileInfo $file */\n# if (!$file->isFile()) {\n# continue;\n\
# }\n# \n# if ($this->isExcluded($file->getPathname())) {\n# continue;\n# }\n\
# \n# // avoid potentially exposing PHP files\n# if ('php' === $file->getExtension())\
\ {\n# continue;\n# }\n# \n# /** @var RecursiveDirectoryIterator $innerIterator\
\ */\n# $innerIterator = $iterator->getInnerIterator();\n# $logicalPath = ($namespace\
\ ? rtrim($namespace, '/').'/' : '').$innerIterator->getSubPathName();\n# $logicalPath\
\ = $this->normalizeLogicalPath($logicalPath);\n# $paths[$logicalPath] = $file->getPathname();\n\
# }\n# }\n# \n# return $paths;\n# }\n# \n# /**\n# * @internal"
- name: getDirectories
visibility: private
parameters: []
comment: null
- name: normalizeLogicalPath
visibility: private
parameters:
- name: logicalPath
comment: '# * Normalize slashes to / for logical paths.'
- name: isExcluded
visibility: private
parameters:
- name: filesystemPath
comment: null
traits:
- Symfony\Component\Filesystem\Filesystem
- Symfony\Component\Finder\Iterator\RecursiveDirectoryIterator
interfaces: []