src/Robo/BltTasks.php
protected function executeCommandAgainstFilesets(array $filesets, $command, $parallel = FALSE) {
    $passed = TRUE;
    $failed_filesets = [];
    foreach ($filesets as $fileset_id => $fileset) {
      if (!is_null($fileset) && iterator_count($fileset)) {
        $this->say("Iterating over fileset $fileset_id...");
        $files = iterator_to_array($fileset);
        $result = $this->executeCommandAgainstFiles($files, $command, $parallel);
        if (!$result->wasSuccessful()) {
          // We iterate over all filesets before throwing an exception. This
          // will, for instance, allow a user to see all PHPCS violations in
          // output before the command exits.
          $passed = FALSE;
          $failed_filesets[] = $fileset_id;
        }
      }
      else {
        $this->logger->info("No files were found in fileset $fileset_id. Skipped.");
      }
    }

    if (!$passed) {
      throw new BltException("Executing `$command` against fileset(s) " . implode(', ', $failed_filesets) . " returned a non-zero exit code.`");
    }
  }
protected function executeCommandAgainstFilesets(array $filesets, $command, $parallel = FALSE) {
    $passed = TRUE;
    $failed_filesets = [];
    foreach ($filesets as $fileset_id => $fileset) {
      if (!is_null($fileset) && iterator_count($fileset)) {
        $this->say("Iterating over fileset $fileset_id...");
        $files = iterator_to_array($fileset);
        $result = $this->executeCommandAgainstFiles($files, $command, $parallel);
        if (!$result->wasSuccessful()) {
          // We iterate over all filesets before throwing an exception. This
          // will, for instance, allow a user to see all PHPCS violations in
          // output before the command exits.
          $passed = FALSE;
          $failed_filesets[] = $fileset_id;
        }
      }
      else {
        $this->logger->info("No files were found in fileset $fileset_id. Skipped.");
      }
    }

    if (!$passed) {
      throw new BltException("Executing `$command` against fileset(s) " . implode(', ', $failed_filesets) . " returned a non-zero exit code.`");
    }
  }
protected function executeCommandAgainstFilesets ( array $ filesets , $ command , $ parallel = FALSE ) { $ passed = TRUE ; $ failed_filesets = [ ] ; foreach ( $ filesets as $ fileset_id => $ fileset ) { if ( ! is_null ( $ fileset ) && iterator_count ( $ fileset ) ) { $ this -> say ( "Iterating over fileset $fileset_id..." ) ; $ files = iterator_to_array ( $ fileset ) ; $ result = $ this -> executeCommandAgainstFiles ( $ files , $ command , $ parallel ) ; if ( ! $ result -> wasSuccessful ( ) ) { // We iterate over all filesets before throwing an exception. This // will, for instance, allow a user to see all PHPCS violations in // output before the command exits. $ passed = FALSE ; $ failed_filesets [ ] = $ fileset_id ; } } else { $ this -> logger -> info ( "No files were found in fileset $fileset_id. Skipped." ) ; } } if ( ! $ passed ) { throw new BltException ( "Executing `$command` against fileset(s) " . implode ( ', ' , $ failed_filesets ) . " returned a non-zero exit code.`" ) ; } }
Executes a given command against multiple filesets.

@param \Symfony\Component\Finder\Finder[] $filesets

@param string $command
The command to execute. The command should contain '%s', which will be
replaced with the file path of each file in the filesets.
@param bool $parallel
Indicates whether commands should be run in parallel or sequentially.
Defaults to FALSE.

@throws \Acquia\Blt\Robo\Exceptions\BltException
Executes a given command against multiple filesets .