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:----X9x/XYSRhxkOaGGJPbOMRPmLzPqOSjrIpB6/6UNFRjlqIGLfyJn6lxS8rrAJkdr+S+Rs8/0FdjSHy4GVs4NA6XcHw3k3ON6aoXN3MsIRdfNaOyKNQRWCU1U6raxIWbsOJkaJ3XeKEkP9uGp7fhpPrLfaMDv4w8EMSADuu3KfTzCBVwFieXrkfyCz6HxRi4VA8gpjq9Xzpe2jBhMMED+WxvCDIrgDGdnKBpiSZp26CcYXs3h4DRvNNiK0P8tirp/zPN/qHMeoLRZoG5KvXl8hhD7iVHxVpXfslhKi1jQwoqaUwkOvQNKNa6QRfqYc27PN1M8bzbfb7hcTTQFOhGnG6m+Ve0j/d+Cv5VxuTqLzabUtNxFrNgkqSjA6BM1gXtmOgBJCAdUJG2zTnVENzmZyjrnqk+Atpf4scXcRpD+2zCdHQvk6EhkNPGCmRDYFbf9qF/ae/9VO5MVOEzkDIjeitgbqoV5UiGqXEHUXzXJ9QrPD9piuLwP+b274Z5eUwM1N7Z4XMi63sa6hDxxwvcOlm9hhzNS88BTL9Fi+dSOk/cZhwoQ073PrhtaXmKOVYOtbVJBhUV4YmD1zPxU3TwuK/05Ey0ORZgqVzSLJYauFNgRW/QxEmze5UcQTAw1TTEeSlxAdi7uCbT/pt6wynRMjWNwbl2OC0UyneDuDSleJBp8=----ATTACHMENT:----MTU1NjM3NzEzNzQ4MzEyNCA4OTM4ODgxMTk3NzM0MDMxIDYxNTUwNjE4MjU4NDA1Njc=