You are here

protected function FeaturesGenerationWrite::success in Features 8.4

Same name and namespace in other branches
  1. 8.3 src/Plugin/FeaturesGeneration/FeaturesGenerationWrite.php \Drupal\features\Plugin\FeaturesGeneration\FeaturesGenerationWrite::success()

Registers a successful package or profile write operation.

Parameters

array &$return: The return value, passed by reference.

\Drupal\features\Package $package: The package or profile.

1 call to FeaturesGenerationWrite::success()
FeaturesGenerationWrite::generatePackage in src/Plugin/FeaturesGeneration/FeaturesGenerationWrite.php
Writes a package or profile's files to the file system.

File

src/Plugin/FeaturesGeneration/FeaturesGenerationWrite.php, line 170

Class

FeaturesGenerationWrite
Class for writing packages to the local file system.

Namespace

Drupal\features\Plugin\FeaturesGeneration

Code

protected function success(array &$return, Package $package) {
  $type = $package
    ->getType() == 'module' ? $this
    ->t('Package') : $this
    ->t('Profile');
  $return[] = [
    'success' => TRUE,
    'display' => TRUE,
    'message' => '@type @package written to @directory.',
    'variables' => [
      '@type' => $type,
      '@package' => $package
        ->getName(),
      '@directory' => $package
        ->getDirectory(),
    ],
  ];
}