Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ScaffoldFileCollection.php

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

1 call to ScaffoldFileCollection::checkListHasItemWithContent()
ScaffoldFileCollection::filterFiles in composer/Plugin/Scaffold/Operations/ScaffoldFileCollection.php
Removes any item that has a path matching any path in the provided list.

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;
}
RSS feed
Powered by Drupal