src/Leevel/Option/Load.php
protected function loadDeferredProviderData(array &$providers): array
    {
        $deferredProviders = $deferredAlias = [];

        foreach ($providers as $k => $provider) {
            if (!class_exists($provider)) {
                unset($providers[$k]);

                continue;
            }

            if ($provider::isDeferred()) {
                $providerAlias = $provider::providers();

                foreach ($providerAlias as $key => $alias) {
                    if (is_int($key)) {
                        $key = $alias;
                    }

                    $deferredProviders[$key] = $provider;
                }

                $deferredAlias[$provider] = $providerAlias;

                unset($providers[$k]);
            }
        }

        $providers = array_values($providers);

        return [
            $deferredProviders,
            $deferredAlias,
        ];
    }
protected function loadDeferredProviderData(array &$providers): array
    {
        $deferredProviders = $deferredAlias = [];

        foreach ($providers as $k => $provider) {
            if (!class_exists($provider)) {
                unset($providers[$k]);

                continue;
            }

            if ($provider::isDeferred()) {
                $providerAlias = $provider::providers();

                foreach ($providerAlias as $key => $alias) {
                    if (is_int($key)) {
                        $key = $alias;
                    }

                    $deferredProviders[$key] = $provider;
                }

                $deferredAlias[$provider] = $providerAlias;

                unset($providers[$k]);
            }
        }

        $providers = array_values($providers);

        return [
            $deferredProviders,
            $deferredAlias,
        ];
    }
分析延迟加载服务提供者.

@param array $providers

@return array