You are here

public function ManageOptions::getLocationReplacements in Drupal 8

Same name and namespace in other branches
  1. 9 composer/Plugin/Scaffold/ManageOptions.php \Drupal\Composer\Plugin\Scaffold\ManageOptions::getLocationReplacements()

Creates an interpolator for the 'locations' element.

The interpolator returned will replace a path string with the tokens defined in the 'locations' element.

Note that only the root package may define locations.

Return value

\Drupal\Composer\Plugin\Scaffold\Interpolator Interpolator that will do replacements in a string using tokens in 'locations' element.

File

composer/Plugin/Scaffold/ManageOptions.php, line 72

Class

ManageOptions
Per-project options from the 'extras' section of the composer.json file.

Namespace

Drupal\Composer\Plugin\Scaffold

Code

public function getLocationReplacements() {
  return (new Interpolator())
    ->setData($this
    ->ensureLocations());
}