You are here

protected function ExtraPackage::fixRelativePaths in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/wikimedia/composer-merge-plugin/src/Merge/ExtraPackage.php \Wikimedia\Composer\Merge\ExtraPackage::fixRelativePaths()

Fix a collection of paths that are relative to this package to be relative to the base package.

Parameters

array $paths:

Return value

array

1 call to ExtraPackage::fixRelativePaths()
ExtraPackage::mergeAutoload in vendor/wikimedia/composer-merge-plugin/src/Merge/ExtraPackage.php
Merge autoload or autoload-dev into a RootPackageInterface

File

vendor/wikimedia/composer-merge-plugin/src/Merge/ExtraPackage.php, line 303

Class

ExtraPackage
Processing for a composer.json file that will be merged into a RootPackageInterface

Namespace

Wikimedia\Composer\Merge

Code

protected function fixRelativePaths(array $paths) {
  $base = dirname($this->path);
  $base = $base === '.' ? '' : "{$base}/";
  array_walk_recursive($paths, function (&$path) use ($base) {
    $path = "{$base}{$path}";
  });
  return $paths;
}