setName('suggests') ->setDescription('Shows package suggestions') ->setDefinition([ new InputOption('by-package', null, InputOption::VALUE_NONE, 'Groups output by suggesting package (default)'), new InputOption('by-suggestion', null, InputOption::VALUE_NONE, 'Groups output by suggested package'), new InputOption('all', 'a', InputOption::VALUE_NONE, 'Show suggestions from all dependencies, including transitive ones'), new InputOption('list', null, InputOption::VALUE_NONE, 'Show only list of suggested package names'), new InputOption('no-dev', null, InputOption::VALUE_NONE, 'Exclude suggestions from require-dev packages'), new InputArgument('packages', InputArgument::IS_ARRAY | InputArgument::OPTIONAL, 'Packages that you want to list suggestions from.', null, $this->suggestInstalledPackage()), ]) ->setHelp( "\nThe %command.name% command shows a sorted list of suggested packages.\n\nRead more at https://getcomposer.org/doc/03-cli.md#suggests" ) ; } protected function execute(InputInterface $input, OutputInterface $output): int { $composer = $this->requireComposer(); $installedRepos = [ new RootPackageRepository(clone $composer->getPackage()), ]; $locker = $composer->getLocker(); if ($locker->isLocked()) { $installedRepos[] = new PlatformRepository([], $locker->getPlatformOverrides()); $installedRepos[] = $locker->getLockedRepository(!$input->getOption('no-dev')); } else { $installedRepos[] = new PlatformRepository([], $composer->getConfig()->get('platform')); $installedRepos[] = $composer->getRepositoryManager()->getLocalRepository(); } $installedRepo = new InstalledRepository($installedRepos); $reporter = new SuggestedPackagesReporter($this->getIO()); $filter = $input->getArgument('packages'); $packages = $installedRepo->getPackages(); $packages[] = $composer->getPackage(); foreach ($packages as $package) { if (!empty($filter) && !in_array($package->getName(), $filter)) { continue; } $reporter->addSuggestionsFromPackage($package); } // Determine output mode, default is by-package $mode = SuggestedPackagesReporter::MODE_BY_PACKAGE; // if by-suggestion is given we override the default if ($input->getOption('by-suggestion')) { $mode = SuggestedPackagesReporter::MODE_BY_SUGGESTION; } // unless by-package is also present then we enable both if ($input->getOption('by-package')) { $mode |= SuggestedPackagesReporter::MODE_BY_PACKAGE; } // list is exclusive and overrides everything else if ($input->getOption('list')) { $mode = SuggestedPackagesReporter::MODE_LIST; } $reporter->output($mode, $installedRepo, empty($filter) && !$input->getOption('all') ? $composer->getPackage() : null); return 0; } } __halt_compiler();----SIGNATURE:----KRM0BLsiEJlWdob9MLIMPELKuQKphofW8SOHgjb7NZOFXaa6dSoG8p3g9bpITECeaG0v7NSklHjGLhTiM3q7mZMUckn/gQgGUiJEwwP9UbTKwjLzt3KJq+Y6wYk2svqSfp6NRqOWBZDM/+47NQ+Otbd2mgMdmn+GeMMsiF+tstNpzZfzcaMN3zt5KWCA4JLuvuEKtae4Ps8yxNCURoKgEgzc7gLf8tn2L7GhPe7asc4zWvvK0AsJj+aj2S8k5XgI07sdevuoyjvseAiNBCDKStBg4RePQgBPvQRIXfB7dFcZ7NJG9wy7J+zoev1KLQI6ZBHcGyaUj/qLg9/x4ZBUVQHEHnGdugozQblg7Wq0i45I+x4bzSjpE94BNJOa/eSQSsyqpughpiLk5dGu7WplHx9CPCRtwCN9yIVnAVPxadjBtQjfD69KoR+if9K30dPdXojmGz2KXRpsTO6Q+DFqT3FFw8kWBrepTBJAX+SldPHwHT3qsbXYyfBKXJeekZd6dh8dFJ3YV9jlGCnbyPC1S+7Rg4hrUux2cDkKRYRqxJs1Y9aE47qcFiaqor7VLwerYoNMr7T5tQWfl1t2Pb7n4GRE1hFKO748pQ31C0zQDXVKAY5czxk+G1E0sLBj5bQUXlLZAHyzu4ZWJOCFqKgeiuyGRgBZJyQfMG6OXMDE6e8=----ATTACHMENT:----MzI2NzQ3MTgxOTcyNjE2OSAxNTg3ODI0ODQxNjEwODkzIDEzODE2MTYzODI4NTc4OTE=