Get Service Map
Maybe not so good realization of auto-discover via doc blocks
@return array
168953
private function getServiceMap()
    {
        $result = [
            'transport' => 'POST',
            'envelope' => 'JSON-RPC-2.0',
            'SMDVersion' => '2.0',
            'contentType' => 'application/json',
            'target' => !empty($_SERVER['REQUEST_URI']) ?
                substr($_SERVER['REQUEST_URI'], 0, strpos($_SERVER['REQUEST_URI'], '?')) : '',
            'services' => [],
            'description' => '',
        ];

        foreach ($this->instances as $namespace => $instance) {
            $rc = new \ReflectionClass($instance);

            // Get Class Description
            if ($rcDocComment = $this->getDocDescription($rc->getDocComment())) {
                $result['description'] .= $rcDocComment . PHP_EOL;
            }

            foreach ($rc->getMethods() as $method) {
                /** @var \ReflectionMethod $method */
                if (!$method->isPublic() || in_array(strtolower($method->getName()), $this->hiddenMethods)) {
                    continue;
                }

                $methodName = ($namespace ? $namespace . '.' : '') . $method->getName();
                $docComment = $method->getDocComment();

                $result['services'][$methodName] = ['parameters' => []];

                // set description
                if ($rmDocComment = $this->getDocDescription($docComment)) {
                    $result['services'][$methodName]['description'] = $rmDocComment;
                }

                // @param\s+([^\s]*)\s+([^\s]*)\s*([^\s\*]*)
                $parsedParams = [];
                if (preg_match_all('/@param\s+([^\s]*)\s+([^\s]*)\s*([^\n\*]*)/', $docComment, $matches)) {
                    foreach ($matches[2] as $number => $name) {
                        $type = $matches[1][$number];
                        $desc = $matches[3][$number];
                        $name = trim($name, '$');

                        $param = ['type' => $type, 'description' => $desc];
                        $parsedParams[$name] = array_filter($param);
                    }
                };

                // process params
                foreach ($method->getParameters() as $parameter) {
                    $name = $parameter->getName();
                    $param = ['name' => $name, 'optional' => $parameter->isDefaultValueAvailable()];
                    if (array_key_exists($name, $parsedParams)) {
                        $param += $parsedParams[$name];
                    }

                    if ($param['optional']) {
                        $param['default'] = $parameter->getDefaultValue();
                    }

                    $result['services'][$methodName]['parameters'][] = $param;
                }

                // set return type
                if (preg_match('/@return\s+([^\s]+)\s*([^\n\*]+)/', $docComment, $matches)) {
                    $returns = ['type' => $matches[1], 'description' => trim($matches[2])];
                    $result['services'][$methodName]['returns'] = array_filter($returns);
                }
            }
        }

        return $result;
    }
1021666
public function getServiceConfig()
    {
        return array(
            'invokables' => array(
                'dlcdoctrine_event_finishlistener' => 'DlcDoctrine\Event\FinishListener',
                'dlcdoctrine_setup_service' => 'DlcDoctrine\Service\Setup',
            ),
            'factories' => array(
                'dlcdoctrine_module_options' => function ($sm) {
                    $config = $sm->get('Config');
                    return new Options\ModuleOptions(isset($config['dlcdoctrine']) ? $config['dlcdoctrine'] : array());
                },
                'dlcdoctrine_resolvetargetentitylistener' => function ($sm) {
                    $options = $sm->get('dlcdoctrine_module_options');
                    //Create instance of ResolveTargetEntityListener
                    $resolveTargetEntityListener = new \DlcDoctrine\Event\ResolveTargetEntityListener();
                    //Add all resolve target entities
                    foreach ($options->getResolveTargetEntities() as $originalEntity => $newConfig) {
                        $resolveTargetEntityListener->addResolveTargetEntity($originalEntity, $newConfig['newEntity'], $newConfig['mapping']);
                    }
                    
                    return $resolveTargetEntityListener;
                }
            ),
            'initializers' => array(
                function ($instance, $sm) {
                    if ($instance instanceof \DoctrineModule\Persistence\ObjectManagerAwareInterface) {
                        $instance->setObjectManager($sm->get('doctrine.entitymanager.orm_default'));
                    }
                }
            ),
        );
    }
890537
public Map<String, Object> getServiceCredentials() {
        if (serviceCredentials == null) {
            return null;
        }
        return Collections.unmodifiableMap(serviceCredentials);
    }
753261
public function getServices()
	{
		$services = false;
		if (!empty($this->cache) && Yii::$app->has($this->cache)) {
			/** @var $cache \yii\caching\Cache */
			$cache = Yii::$app->get($this->cache);
			$services = $cache->get('EAuth.services');
		}

		if (false === $services || !is_array($services)) {
			$services = [];
			foreach ($this->services as $service => $options) {
				/** @var $class ServiceBase */
				$class = $this->getIdentity($service);
				$services[$service] = (object)[
					'id' => $class->getServiceName(),
					'title' => $class->getServiceTitle(),
					'type' => $class->getServiceType(),
					'jsArguments' => $class->getJsArguments(),
				];
			}
			if (isset($cache)) {
				$cache->set('EAuth.services', $services, $this->cacheExpire);
			}
		}
		return $services;
	}
1047181
public function getServiceNames()
    {
        $dir = __DIR__ . '/../vendor/google/apiclient-services/src/Google/Service';

        if (!is_dir($dir) || !is_readable($dir)) {
            throw new RuntimeException("Cannot read directory $dir");
        }

        $this->library->load('gapi');

        $names = array();

        foreach (glob("$dir/*.php") as $file) {
            $name = pathinfo($file, PATHINFO_FILENAME);
            $class = "Google_Service_$name";
            if (class_exists($class) && $class instanceof \Google_Service) {
                $names[] = $name;
            }
        }

        return $names;
    }
372547
public function getGroupIdCapabilitiesMap()
    {
        $groupIdCapabilitiesMap = array();
        foreach ($this->groupIdCapabilitiesNameMap as $groupId => $capabilitiesName) {
            foreach ($capabilitiesName as $capabilityName) {
                $groupIdCapabilitiesMap[$groupId][$capabilityName] = $this->capabilities[$capabilityName];
            }
        }

        return $groupIdCapabilitiesMap;
    }
1361387
public function getClassMap()
    {
        $unifiedNamespaceClassMapOfProfessionalEdition = parent::getClassMap();

        $enterpriseEditionRootPath = $this->facts->getEnterpriseEditionRootPath();
        $unifiedNamespaceClassMapOfEnterpriseEdition = $this->resolveUnifiedNamespaceClassMap($enterpriseEditionRootPath);

        return array_merge($unifiedNamespaceClassMapOfProfessionalEdition, $unifiedNamespaceClassMapOfEnterpriseEdition);
    }
1076007
public function getAllServices():\stdClass
    {
        $file = JL::open(FEnv::get("framework.config.core.services.file"));
        foreach ($file as $one => $value) {
            $value->edit_save = $this->generateRoute(
                "iumio_manager_services_manager_edit_save_service",
                array("servicename" => $one),
                null,
                true
            );

            $value->edit = $this->generateRoute(
                "iumio_manager_services_manager_edit",
                array("servicename" => $one),
                null,
                true
            );

            $value->remove = $this->generateRoute(
                "iumio_manager_services_manager_remove_service",
                array("servicename" => $one),
                null,
                true
            );
        }
        return ($file);
    }
555826
public function getServiceConfig()
    {
        return array(
            'initializers' => array(
                function ($instance, $sm) {
                    if ($instance instanceof \DlcBase\Module\ModuleNamespaceAwareInterface) {
                        $class           = get_class($instance);
                        $moduleNamespace = substr($class, 0, strpos($class, '\\'));
                        $instance->setModuleNamespace($moduleNamespace);
                    }
                }
            ),
        );
    }
1107659
public function getList()
    {
        /** @var RcmUserService $rcmUserService */
        $rcmUserService = $this->serviceLocator->get(RcmUserService::class);

        //ACCESS CHECK
        if (!$rcmUserService->isAllowed(
            ResourceName::RESOURCE_SITES,
            'admin'
        )
        ) {
            $this->getResponse()->setStatusCode(Response::STATUS_CODE_401);
            return $this->getResponse();
        }

        $config = $this->getConfig();

        $pageTypes = $config['Rcm']['pageTypes'];

        return new ApiJsonModel($pageTypes, 0, 'Success');
    }
614101
public function getConfig()
    {
        return [
            'service_manager'    => [
                'aliases'   => [
                    'ModuleRouteListener' => ModuleRouteListener::class
                ],
                'factories' => [
                    ModuleRouteListener::class                   => InvokableFactory::class,
                    Listener\ApplicationBootstrapListener::class => InvokableFactory::class,
                    Listener\ErrorLoggerListener::class          => InvokableFactory::class,
                    Listener\RouteTrailingSlashListener::class   => InvokableFactory::class,
                    Listener\SetupRouterBaseUrl::class           => InvokableFactory::class
                ]
            ],
            'controller_plugins' => [
                'aliases'   => [
                    'config'    => Controller\Plugin\Config::class,
                    'Config'    => Controller\Plugin\Config::class,
                    'flashdata' => Controller\Plugin\FlashData::class,
                    'flashData' => Controller\Plugin\FlashData::class,
                    'FlashData' => Controller\Plugin\FlashData::class,
                    'htmlclass' => Controller\Plugin\HtmlClass::class,
                    'htmlClass' => Controller\Plugin\HtmlClass::class,
                    'HtmlClass' => Controller\Plugin\HtmlClass::class,
                    'log'       => Controller\Plugin\Log::class,
                    'Log'       => Controller\Plugin\Log::class,
                    'redirect'  => Controller\Plugin\Redirect::class,
                    'Redirect'  => Controller\Plugin\Redirect::class,
                    'headtitle' => Controller\Plugin\Title::class,
                    'headTitle' => Controller\Plugin\Title::class,
                    'HeadTitle' => Controller\Plugin\Title::class,
                    'title'     => Controller\Plugin\Title::class,
                    'Title'     => Controller\Plugin\Title::class,
                    'url'       => Controller\Plugin\Url::class,
                    'Url'       => Controller\Plugin\Url::class
                ],
                'factories' => [
                    Controller\Plugin\Config::class    => function(ContainerInterface $container) {
                        return new  Controller\Plugin\Config($container->get('Config'));
                    },
                    Controller\Plugin\FlashData::class => InvokableFactory::class,
                    Controller\Plugin\HtmlClass::class => InvokableFactory::class,
                    Controller\Plugin\Log::class       => InvokableFactory::class,
                    Controller\Plugin\Redirect::class  => InvokableFactory::class,
                    Controller\Plugin\Title::class     => InvokableFactory::class,
                    Controller\Plugin\Url::class       => InvokableFactory::class
                ]
            ],
            'listeners'          => [
                ModuleRouteListener::class                 => ModuleRouteListener::class,
                Listener\ErrorLoggerListener::class        => Listener\ErrorLoggerListener::class,
                Listener\RouteTrailingSlashListener::class => Listener\RouteTrailingSlashListener::class,
                Listener\SetupRouterBaseUrl::class         => Listener\RouteTrailingSlashListener::class
            ]
        ];
    }
173384
public function getMap()
    {
        return $this
            ->select([Page::tableName() . '.id', PageLang::tableName() . '.link', Page::tableName() . '.type'])
            ->joinLang();
    }
812198
public function getServiceConfig()
    {
        $configFiles = glob(
                $this->getDir() . '/' . $this->relativeModuleDir . 'config/service/service.config{,.*}.php',
                GLOB_BRACE
        );

        // glob() returns false on error. On some systems, glob() will return false (instead of an empty array) if no
        // files are found. Treat both in the same way - no config will be loaded.
        $configFiles = $configFiles ?: array();

        $config = array();
        foreach ($configFiles as $configFile) {
            $config = ArrayUtils::merge($config, include $configFile);
        }
        return $config;
    }
1074327
public Map<String, Set<ServiceDefinition>> getNamespaceServiceDefinitionMap() {
        Map<String, Set<ServiceDefinition>> namespaceServiceDefinitionMap = new HashMap<String, Set<ServiceDefinition>>();

        for (String namespace : serviceImplementationMap.keySet()) {
            Set<ServiceDefinition> serviceDefinitions = new HashSet<ServiceDefinition>();
            namespaceServiceDefinitionMap.put(namespace, serviceDefinitions);
            for (ServiceDefinition sd : serviceImplementationMap.get(namespace).keySet()) {
                serviceDefinitions.add(sd);
            }
        }
        return Collections.unmodifiableMap(namespaceServiceDefinitionMap);
    }
833545
public function getClassMap()
    {
        $unifiedNamespaceClassMapOfCommunityEdition = parent::getClassMap();

        $professionalEditionRootPath = $this->facts->getProfessionalEditionRootPath();
        $unifiedNamespaceClassMapOfProfessionalEdition = $this->resolveUnifiedNamespaceClassMap($professionalEditionRootPath);

        return array_merge($unifiedNamespaceClassMapOfCommunityEdition, $unifiedNamespaceClassMapOfProfessionalEdition);
    }
743791
public function getServices()
    {
        $mergedModuleServices = array();

        foreach ($this->services as $services) {
            $mergedModuleServices = ArrayUtils::merge($mergedModuleServices, $services);
        }

        return $mergedModuleServices;
    }
853782
public function getService()
    {
        $serviceNodes = $this->element->getElementsByTagName('service');
        if ($serviceNodes->length > 0) {
            return new ServiceNode($this->document, $serviceNodes->item(0));
        }
        return null;
    }