function ScaffoldFileCollection::checkListHasItemWithContent

Scans through a list of scaffold files and determines if any has contents.

Parameters

\Drupal\Composer\Plugin\Scaffold\ScaffoldFileInfo[] $scaffold_files: List of scaffold files, path: ScaffoldFileInfo

Return value

bool TRUE if at least one item in the list has content

File

composer/Plugin/Scaffold/Operations/ScaffoldFileCollection.php, line 105

Class

ScaffoldFileCollection
Collection of scaffold files.

Namespace

Drupal\Composer\Plugin\Scaffold\Operations

Code

protected function checkListHasItemWithContent(array $scaffold_files) {
  foreach ($scaffold_files as $scaffold_file) {
    $contents = $scaffold_file->op()
      ->contents();
    if (!empty($contents)) {
      return TRUE;
    }
  }
  return FALSE;
}

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