Returns all modules matching the given expression.
public findModules ( Webmozart\Expression\Expression $expr ) : |
||
$expr | Webmozart\Expression\Expression | The search criteria. |
return | The modules matching the expression. |
/** * Returns the modules that should be displayed for the given console * arguments. * * @param Args $args The console arguments * * @return ModuleList The modules */ private function getSelectedModules(Args $args) { $states = $this->getSelectedStates($args); $expr = Expr::true(); $envs = array(); if ($states !== ModuleState::all()) { $expr = $expr->andMethod('getState', Expr::in($states)); } if ($args->isOptionSet('installer')) { $expr = $expr->andMethod('getInstallInfo', Expr::method('getInstallerName', Expr::same($args->getOption('installer')))); } if ($args->isOptionSet('prod')) { $envs[] = Environment::PROD; } if ($args->isOptionSet('dev')) { $envs[] = Environment::DEV; } if (count($envs) > 0) { $expr = $expr->andMethod('getInstallInfo', Expr::method('getEnvironment', Expr::in($envs))); } return $this->moduleManager->findModules($expr); }