Return a service extension map from the given service providers.

@param array $providers
@return array
5932
private function serviceExtensionMap(array $providers): array
    {
        $wrap = function ($factory) { return [$factory]; };

        return array_reduce($providers, function ($extensions, ServiceProviderInterface $provider) use ($wrap) {

            return array_merge_recursive($extensions, array_map($wrap, $provider->getExtensions()));

        }, []);
    }
308617
protected function getClassProviders(\ReflectionClass $class) {
		$annotations = Omocha::getAnnotations($class);
		
		//get class providers
		$providers = $annotations->find('Provider', Filter::TYPE_STRING);
		
		if (!empty($providers)) {
			$classes = [];
			
			foreach ($providers as $provider) {
				$classes[] = $provider->getValue();
			}
			
			return $classes;
		}
		
		//if no providers are specified try getting them from parent class
		if ($annotations->has('ExtendInject')) {
			$extend = $annotations->get('ExtendInject')->getValue();
			
			if ($extend) {
				$parent = $class->getParentClass();
				return $parent instanceof \ReflectionClass ? $this->getClassProviders($parent) : [];
			}
		}
		
		return [];
	}
933447
protected static function pathsForProviderOrGroup($provider, $group)
    {
        if ($provider && $group) {
            return static::pathsForProviderAndGroup($provider, $group);
        } elseif ($group && array_key_exists($group, static::$publishGroups)) {
            return static::$publishGroups[$group];
        } elseif ($provider && array_key_exists($provider, static::$publishes)) {
            return static::$publishes[$provider];
        } elseif ($group || $provider) {
            return [];
        }
    }
1062371
public function providers()
    {
        return collect($this->getManifest())->flatMap(function ($configuration) {
            return (array) ($configuration['providers'] ? $configuration['providers'] : []);
        })->filter()->all();
    }
685825
private function getProviderDetails($provider)
    {
        if (empty($this->providers)) {
            throw new \Exception('No Providers have been set in users config.');
        }

        $provider = is_null($provider) ? $this->providers->first() : $this->providers->get($provider);

        if (is_null($provider['driver'])) {
            throw new \InvalidArgumentException('You must set a social driver to use the social authenticating features.');
        }

        $this->driver = $provider['driver'];
        $this->scopes = $provider['scopes'];
        $this->extras = $provider['extras'];
    }
969741
protected function getAdminExtensionReferenceByTypes(array $types)
    {
        $references = [];
        foreach ($types as $type) {
            $references[$type] = new Reference('sonata_translation.admin.extension.'.$type.'_translatable');
        }

        return $references;
    }
651303
public static InjectionProvider<?>[] providersToArray(final Collection<InjectionProvider<?>> providers) {
        return providers == null ? new InjectionProvider<?>[0] : providers
                .toArray(new InjectionProvider<?>[providers.size()]);
    }
100543
public function getProviderQueries(string $provider): array
    {
        return array_filter($this->data['queries'], function ($data) use ($provider) {
            return $data['providerName'] === $provider;
        });
    }
202178
public function getProvider($provider)
    {
        if (isset($this->aProviders['all'][strtolower($provider)])) {
            return $this->aProviders['all'][strtolower($provider)];
        } else {
            return false;
        }
    }
1140866
protected function getConfigFromProvider( $provider){
        $service = sprintf( self::API_CONNECTION_DDNS_CONFIG, $provider);
        $rest = $this->getService( $service);
        $rest->GET();

        return $rest->getResult( models\Connection\DynDns\Config::class);
    }
1158937
public function getProviderDetails($provider)
    {
        $this->checkProviders();

        $this->getProvider($provider);

        $this->checkDriver($provider);

        return $this->provider;
    }
355122
public function getProviders(DeliveryExecution $execution)
    {
        $serviceManager = $this->getServiceManager();
        $providerService = $serviceManager->get(TestProviderService::SERVICE_ID);
        $providers = $providerService->getAllProviders();
        return array_filter($providers, function ($provider) {
            return !is_null($provider) && $provider->isActive();
        });
    }
601859
public static function sortByProviders(array $values)
    {
        $sorted = [];

        foreach ($values as $value) {
            foreach ($value['providers'] as $provider) {
                if (!isset($sorted[$provider])) {
                    $sorted[$provider] = [$value];
                } else {
                    $sorted[$provider][] = $value;
                }
            }
        }

        return $sorted;
    }
509456
public static function getMimeTypes(array $extensions)
    {
        $mimetypes = [];
        foreach ($extensions as $extension) {
            $mimetype = static::getMimeByExtension($extension, false);
            if ($mimetype && !in_array($mimetype, $mimetypes)) {
                $mimetypes[] = $mimetype;
            }
        }
        return $mimetypes;
    }
606524
public function getMappings(array $bundles)
    {
        $output = [];
        foreach ($bundles as $name => $bundleConfig) {
            // Backward compatibility hack for support.
            if (!is_array($bundleConfig)) {
                $name = $bundleConfig;
                $bundleConfig = [];
            }
            $mappings = $this->getBundleMapping($name, $bundleConfig);

            $alreadyDefinedTypes = array_intersect_key($mappings, $output);
            if (count($alreadyDefinedTypes)) {
                throw new \LogicException(
                    implode(',', array_keys($alreadyDefinedTypes)) .
                    ' type(s) already defined in other document, you can use the same ' .
                    'type only once in a manager definition.'
                );
            }

            $output = array_merge($output, $mappings);
        }

        return $output;
    }
1349470
private function getExtensionsInfo(array $projects) {
    $value = [];
    uasort($projects, 'system_sort_modules_by_info_name');
    /** @var \Drupal\Core\Extension\Extension $project */
    foreach ($projects as $project) {
      $name = $project->getName();
      $info = $project->info;
      unset($info['dependencies']);
      $value[$name] = [
        'type' => $project->getType(),
        'name' => $name,
        'status' => $project->status,
        'origin' => $project->origin,
        'info' => $info,
      ];
    }
    return $value;
  }
1300536
public function registerProviders(array $providers = []): self
    {
        foreach ($providers as $provider) {
            $this->registerProvider($provider);
        }

        return $this;
    }