code: private static function getFilteredPackages(ProjectConfigInterface $projectConfig, ConfigInterface $config): array
      {
          $requiredPackages = array_filter($config->getRequires(), function (string $package) {
              return (false !== strpos($package, '/'));
          });
  
          $nonComposerPackages = array_filter($requiredPackages, function (string $package) {
              return (false === strpos($package, 'composer/'));
          });
  
          return array_filter($nonComposerPackages, function (string $package) use ($projectConfig) {
              return ! in_array($package, $projectConfig->getExcludes(), true);
          });
      }
docs: @param ProjectConfigInterface $projectConfig
  @param ConfigInterface        $config
  
  @return string[]