function ScaffoldFileInfo::interpolate

Same name in other branches
  1. 9 composer/Plugin/Scaffold/ScaffoldFileInfo.php \Drupal\Composer\Plugin\Scaffold\ScaffoldFileInfo::interpolate()
  2. 8.9.x composer/Plugin/Scaffold/ScaffoldFileInfo.php \Drupal\Composer\Plugin\Scaffold\ScaffoldFileInfo::interpolate()
  3. 11.x composer/Plugin/Scaffold/ScaffoldFileInfo.php \Drupal\Composer\Plugin\Scaffold\ScaffoldFileInfo::interpolate()

Replaces placeholders in a message.

Parameters

string $message: Message with placeholders to fill in.

array $extra: Additional data to merge with the interpolator.

mixed $default: Default value to use for missing placeholders, or FALSE to keep them.

Return value

string Interpolated string with placeholders replaced.

File

composer/Plugin/Scaffold/ScaffoldFileInfo.php, line 105

Class

ScaffoldFileInfo
Data object that keeps track of one scaffold file.

Namespace

Drupal\Composer\Plugin\Scaffold

Code

public function interpolate($message, array $extra = [], $default = FALSE) {
    $interpolator = $this->destination
        ->getInterpolator();
    return $interpolator->interpolate($message, $extra, $default);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.