You are here

public static function ScaffoldFilePath::destinationPath in Drupal 8

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

Converts the relative destination path into an absolute path.

Any placeholders in the destination path, e.g. '[web-root]', will be replaced using the provided location replacements interpolator.

Parameters

string $package_name: The name of the package defining the destination path.

string $destination: The relative path to the destination file being scaffolded.

\Drupal\Composer\Plugin\Scaffold\Interpolator $location_replacements: Interpolator that includes the [web-root] and any other available placeholder replacements.

Return value

self Object wrapping the relative and absolute path to the destination file.

2 calls to ScaffoldFilePath::destinationPath()
Fixtures::destinationPath in core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Fixtures.php
Gets a destination path in a tmp dir.
ScaffoldFileCollection::__construct in composer/Plugin/Scaffold/Operations/ScaffoldFileCollection.php
ScaffoldFileCollection constructor.

File

composer/Plugin/Scaffold/ScaffoldFilePath.php, line 160

Class

ScaffoldFilePath
Manage the path to a file to scaffold.

Namespace

Drupal\Composer\Plugin\Scaffold

Code

public static function destinationPath($package_name, $destination, Interpolator $location_replacements) {
  $dest_full_path = $location_replacements
    ->interpolate($destination);
  return new self('dest', $package_name, $destination, $dest_full_path);
}