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( <<%command.name% command shows a sorted list of suggested packages. Read more at https://getcomposer.org/doc/03-cli.md#suggests EOT ) ; } 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:----Uzav9X/T92dS7mas6dG2i/kIS5zK06V21OJuEyYougk/tZ/W9bZAJmVE/dT4mzxtcz/Yz7KqGFbw0+jFSOFYucX8uJmSL4nqXXyum3L5owdS7kKm+TZW8QmjoS4pdyOwIS1s5uBB+wG05UwpuSAcILO6mqXOVfVGC03vHEDrzMrkOSnxIeft5bAfG7MqKh6vlc/emfC7DRgtz0J/ftOMwyd8b8IzNankusiKNDQkHLl4wetiN/ZYIlgYFeA1pP5C3jIULlOEm136wwocfnOowWV57J/kDx0qhCOceYM8+v/IhEzXqioZjr1aYWn+FkDM5gBN8xloKUyyGahfqQYXlhIG3JCNeMjiCnu2HBxVyc29+iln2jUaih/7XFSYCX/E4RxvSolEeO3xR/yZqtfccn/USKgD2fS0NeYLHweHGt6fSA2YesOz8/SCAON2fh/v5L/+hZ/ZNMBMrMwTBnIk6ZSF38RhBp1MeHLyJai+hm4vkBdwdAez8yTFdPDHomCLk9A3dn8zY0lV07Y0DncsLaNmgEXYkFpqpe3N3pdgoRBdX/33v+ljmkxd9rLNRFuGzsYup9Ee7ytvCvEy3m8hVIa0xSjjKl+ikce4B5d/ecPPeaIdhVL/Rc5/rVvpM4q/zu1InfEo1SxA9wEYHIulxj2YyT61n8OluTc+TM71nuE=----ATTACHMENT:----NTkxOTkzODc0OTk2NTI5MyA4Nzc1Mjg4NDY1NTU5MDIxIDk3OTg4NjYyNTg4MDQxMTc=