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:----a3hnVPwkqvOz5uaB65XoHme7GfkguVu1dtbYFOLaqHIa2zNKEpF1OwUmaF4SoY/+RkGR0Ok4Zyphbd33eAg3Te7feYf/IfKTU94XBF37ATXEpBJoX9b2Lmcpjss1JCZqJYfhFnBbIXw+pl0pzz2Pu2rqcTW/eOvbIqP1nY6GuZLjR6mYm2j0uwzPDRMk3RPzGXy6yqr92ospmBuJCK0pEuOFFk4n1Yz/0Ypk9c0/S9gAyczpwrCnkAZqeGqq8C2nCSFtHKJQH/RgrMG+aTVReJS8MNWVZVQY9RCz2vcaElmXW8gvKhhwDunBwzD4LB4NS2WGOp58RGf/e78G46F8IkON8wWAV1huEjGpTzzexsEjgwM2SrcOAvw4qaWXa7WQxB0czYgIErJUI+AtAUnDg7bijY/hB3Ql/cZYPDNvvGbR9wkE39tKQD2uPs0PLnua+1+XzhR9/pP9iyGuv/N0SZfA40603z3Q8h62SJEQBEYMRJtwROV+DJtb7s+m9IfO1UY3GhQdXiYDDXf86VJfiTfqePpPmN2OiaBk3E9LCluaPyldoYQPfarCOPOS8Neoli6UVaFajnQltAujgj+99B0OCr9+zIk2srViLL/FpPPjV9KKP9e+v6M/cCubsWDdw3CBPzpGgJndVra0t+EkYeTssxt0D2f50RAjxwq0v5M=----ATTACHMENT:----MTEzNzIzMTMwMTgyOTY2MiAxMjM4NTkxNTQyOTA0MzU5IDQ2NTk1MTQ5Mjg4MDM2NzM=