public function validateExcludedModules(array $excluded_modules) {
    $components = $this->componentDiscovery->getAll();

    // Can't exclude Lightning Core.
    unset($components['lightning_core']);

    // Can't exclude anything that isn't a Lightning component or sub-component.
    $invalid = array_diff($excluded_modules, array_keys($components));

    if ($invalid) {
      $error = sprintf(
        $this->trans('commands.lightning.subprofile.errors.invalid-exclusions'),
        Element::oxford($invalid)
      );

      throw new \InvalidArgumentException($error);
    }
  }
public function validateExcludedModules(array $excluded_modules) {
    $components = $this->componentDiscovery->getAll();

    // Can't exclude Lightning Core.
    unset($components['lightning_core']);

    // Can't exclude anything that isn't a Lightning component or sub-component.
    $invalid = array_diff($excluded_modules, array_keys($components));

    if ($invalid) {
      $error = sprintf(
        $this->trans('commands.lightning.subprofile.errors.invalid-exclusions'),
        Element::oxford($invalid)
      );

      throw new \InvalidArgumentException($error);
    }
  }
public function validateExcludedModules ( array $ excluded_modules ) { $ components = $ this -> componentDiscovery -> getAll ( ) ; // Can't exclude Lightning Core. unset ( $ components [ 'lightning_core' ] ) ; // Can't exclude anything that isn't a Lightning component or sub-component. $ invalid = array_diff ( $ excluded_modules , array_keys ( $ components ) ) ; if ( $ invalid ) { $ error = sprintf ( $ this -> trans ( 'commands.lightning.subprofile.errors.invalid-exclusions' ) , Element :: oxford ( $ invalid ) ) ; throw new \ InvalidArgumentException ( $ error ) ; } }
Validates excluded modules.

@param string[] $excluded_modules
The modules to be excluded.

@throws \InvalidArgumentException
If $excluded_modules contains anything that's not a Lightning component
or sub-component.
Validates excluded modules .