['cck'], 'description' => 'Lists the packages requested in composer.json and the matching locked version.', 'arguments' => [ 'composer.lock' => 'The path to the lock file. Defaults to the one in drupal root.', ], 'options' => [ 'all' => [ 'description' => 'List all locked packages, even those not requested', 'required' => FALSE, ], 'yaml' => 'Produce YAML output instead of a table', ], ]; return $cmds; } /** * Command callback for composer-check. * * @param null|string $path * Optional. The path to a directory holding a composer.[json|lock] file pair. */ function drush_composer_check($path = DRUPAL_ROOT) { $all = (bool) drush_get_option('all', FALSE); $useYaml = (bool) drush_get_option('yaml', FALSE); $factory = new LoaderFactory($path, $all); $requirementsLoader = $factory->createLoader('requirements'); $lockLoader = $factory->createLoader('lock'); $merger = new MergeBox($requirementsLoader, $lockLoader, $all); $reporter = $useYaml ? new YamlReporter() : new DrushReporter(); $reporter->report($merger); }