You are here

public function ScaffoldFileInfo::interpolate in Drupal 10

Same name and namespace in other branches
  1. 8 composer/Plugin/Scaffold/ScaffoldFileInfo.php \Drupal\Composer\Plugin\Scaffold\ScaffoldFileInfo::interpolate()
  2. 9 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);
}