function Installer::getLocationPattern
Get the second part of the regular expression to check for support of a package type
1 call to Installer::getLocationPattern()
- Installer::supports in vendor/
composer/ installers/ src/ Composer/ Installers/ Installer.php
File
-
vendor/
composer/ installers/ src/ Composer/ Installers/ Installer.php, line 225
Class
Namespace
Composer\InstallersCode
protected function getLocationPattern(string $frameworkType) : string {
$pattern = null;
if (!empty($this->supportedTypes[$frameworkType])) {
$frameworkClass = 'Composer\\Installers\\' . $this->supportedTypes[$frameworkType];
/** @var BaseInstaller $framework */
$framework = new $frameworkClass(new Package('dummy/pkg', '1.0.0.0', '1.0.0'), $this->composer, $this->getIO());
$locations = array_keys($framework->getLocations($frameworkType));
if ($locations) {
$pattern = '(' . implode('|', $locations) . ')';
}
}
return $pattern ?: '(\\w+)';
}