public function sortProviders($providers)
    {
        foreach ($providers as $provider)
        {
            $providerName = get_class($provider);
            $this->reqs[$providerName] = $provider->getRequires();
            $this->pvds[$providerName] = $provider->getProvides();
            $this->instances[$providerName] = $provider;

            foreach ($provider->getProvides() as $resource)
            {
                $this->obtainableIn[$resource] = $providerName;
            }
        }

        $newOrder = [];

        foreach ($providers as $provider)
        {
            $orderedProviders = $this->orderProvider($provider);

            foreach ($orderedProviders as $orderedProvider)
            {
                $newOrder[] = $this->instances[$orderedProvider];
            }
        }

        return $newOrder;
    }