Return the list of resource definitions exposed via the capabilities route

@return array
765818
public function getResources()
    {
        $keys = $this->capabilities->keys();
        $definitions = [];

        foreach ($keys as $key) {
            $definitions[$key] = $this->capabilities->get($key);
        }

        return $definitions;
    }
100656
public function getArrguments()
    {
        return [
            'model-name' => $this->modelName,
            '--resource-file' => $this->resourceFile,
            '--views-directory' => $this->viewsDirectory,
            '--routes-prefix' => $this->prefix,
            '--language-filename' => $this->languageFileName,
            '--layout-name' => $this->layout,
            '--template-name' => $this->template,
            '--force' => $this->force,
        ];
    }
179837
public function getAvailableAndAssignedRoutes(): array
    {
        $routes = $this->getAppRoutes();
        $exists = [];

        foreach (array_keys($this->manager->getPermissions()) as $name) {
            if ($name[0] !== '/') {
                continue;
            }
            $exists[] = $name;
            unset($routes[$name]);
        }

        return [
            'available' => array_keys($routes),
            'assigned' => $exists,
        ];
    }
1152898
public function getEnabledExtensions()
    {
        $enabled = [];
        $extensions = $this->getExtensions();

        foreach ($this->getEnabled() as $id) {
            if (isset($extensions[$id])) {
                $enabled[$id] = $extensions[$id];
            }
        }

        return $enabled;
    }
1095978
public function toRouteDefinition()
    {
        $routes = [];

        foreach ($this->paths as $path) {
            $routes[] = sprintf(
                $this->getTemplate(), $path->verb, $path->path, $this->uses, var_export($path->as, true),
                $this->getMiddleware($path), $this->implodeArray($path->where), var_export($path->domain, true)
            );
        }

        return implode(PHP_EOL.PHP_EOL, $routes);
    }
763927
private function gatherRoutesDefinitions()
    {
        $route = $this->findRouteByName($this->homeRouteName);
        $this->homeDefinition = new RouteDefinition($this->homeRouteName, $this->resolveRouteOptions($route, $this->homeRouteName));

        /** @var Route $route */
        foreach ($this->routes as $name => $route) {
            if ($this->homeRouteName !== $name && null !== $cms = $route->getOption('_cms')) {
                if (array_key_exists('name', $cms)) {
                    $this->createRouteDefinition($name, $route);
                }
            }
        }

        $this->homeDefinition->sortChildren();
    }
3701
public function getAvailableCapabilities()
    {
        Piwik::checkUserHasSomeAdminAccess();

        $response = array();

        foreach ($this->capabilityProvider->getAllCapabilities() as $capability) {
            $response[] = array(
                'id' => $capability->getId(),
                'name' => $capability->getName(),
                'description' => $capability->getDescription(),
                'helpUrl' => $capability->getHelpUrl(),
                'includedInRoles' => $capability->getIncludedInRoles(),
                'category' => $capability->getCategory(),
            );
        }

        return $response;
    }
260445
protected function getInternalDomains()
    {
        $internalDomains = [];

        $routes = $this->grabService('router')->getRouteCollection();
        /* @var \Symfony\Component\Routing\Route $route */
        foreach ($routes as $route) {
            if (!is_null($route->getHost())) {
                $compiled = $route->compile();
                if (!is_null($compiled->getHostRegex())) {
                    $internalDomains[] = $compiled->getHostRegex();
                }
            }
        }

        return array_unique($internalDomains);
    }
574161
protected function getAllResources(): array
    {
        return array_merge($this->resources, [
            $this->socket->getResourceId() => $this->socket->getResource(),
        ]);
    }
183138
public function getRoutingResourcesPaths()
    {
        $ds = DIRECTORY_SEPARATOR;
        $path = $this->getPath().$ds.'Resources'.$ds.'config'.$ds.'routing.yml';

        if (file_exists($path)) {
            return [$path];
        }

        return [];
    }
634816
public function get_capabilities() {
        global $DB;

        $sort = 'ORDER BY contextlevel,component,name';   // To group them sensibly for display

        $extracaps = array('moodle/grade:viewall');
        list($extra, $params) = $DB->get_in_or_equal($extracaps, SQL_PARAMS_NAMED, 'cap');
        $sql = "SELECT *
                  FROM {capabilities}
                 WHERE contextlevel = ".CONTEXT_USER."
                       OR name $extra";

        return $records = $DB->get_records_sql($sql.' '.$sort, $params);
    }
1295541
def list_capability_definitions(service_instance=None):
    '''
    
    '''
    profile_manager = salt.utils.pbm.get_profile_manager(service_instance)
    ret_list = [_get_capability_definition_dict(c) for c in
                salt.utils.pbm.get_capability_definitions(profile_manager)]
    return ret_list
14661
public function prepareCapabilities(array $capabilities = []): array
    {
        if (empty($capabilities)) {
            return [];
        }

        $result = [];
        foreach ($capabilities as $capName => $checked) {
            $checked = (bool)$checked;
            if (!$checked) {
                continue;
            }

            $capEntity = $this->Capabilities->newEntity();
            $capEntity->name = $capName;
            $result[] = $capEntity;
        }

        return $result;
    }
725051
public function capability()
    {
        $response = $this->requestAndResponse('CAPABILITY');

        if (!$response) {
            return $response;
        }

        $capabilities = array();
        foreach ($response as $line) {
            $capabilities = array_merge($capabilities, $line);
        }
        return $capabilities;
    }
665764
public function getDefinitionDimensions()
	{
		if ( $this->dimensionsCache !== null ) return $this->dimensionsCache;

		$dimensions = array();
		$taxonomy_base_name = $this->getTaxonomyXSD();

		foreach ( $this->getDefinitionRoleRefs() as $roleRefsKey => $role )
		{
			$dimensions += $this->getDefinitionRoleDimensions( $roleRefsKey );
		}

		$this->dimensionsCache = $dimensions;
		return $dimensions;
	}
763193
public function getCandidates()
    {
        $candidates = array();

        foreach ($this->collection->all() as $name => $route) {
            $specs = array();

            preg_match_all('/\{\w+\}/', $route->getPath(), $matches);

            if (isset($matches[0])) {
                $specs = $matches[0];
            }

            foreach ($specs as $spec) {
                $param          = substr($spec, 1, -1);
                $regexSpec      = '\\'.$spec.'\\';
                $requirements   = $route->getRequirements();

                if (isset($requirements[$param])) {
                    $route->setRegex(

                        str_replace(
                            $spec,
                            $this->getRegexOperand($requirements[$param]),
                            $route->getRegex()
                        )
                    );
                }
            }

            // Build regeular expression to match routes
            $route->setRegex('^'.'/'.ltrim(trim($route->getRegex()), '/').'/?$');
            $route->setRegex('/'.str_replace('/', '\/', $route->getRegex()).'/');

            if (preg_match($route->getRegex(), $this->request->getPathInfo())) {
                // We have a match
                $candidates[] = $route;
            }
        }

        return $candidates;
    }
20973
protected function getRouteDefinitions()
    {
        $scanner = $this->laravel->make('annotations.model.scanner');

        $scanner->setClassesToScan($this->provider->modelScans());

        return '<?php '.PHP_EOL.PHP_EOL.$scanner->getModelDefinitions().PHP_EOL;
    }