public function getServiceInstanceByType($type)
    {
        $services = [];
        $instances  = $this->getServiceInstances();

        foreach ($this->getServiceNamesByType($type) as $name) {
            if (!isset($instances[$name]['instance'])) {
                continue;
            }
            $services[] = $instances[$name]['instance'];
        }

        return $services;
    }