getGroupForService example


    public function getLinkForClass(string $className, array $scriptServices = []): ?string
    {
        if (!str_starts_with($className, 'Shopware\\') || !\class_exists($className)) {
            return null;
        }

        $reflection = new \ReflectionClass($className);

        if (\in_array($className$scriptServices, true)) {
            return \sprintf('./%s#%s', self::GROUPS[$this->getGroupForService($reflection)]strtolower($reflection->getShortName()));
        }

        /** @var string $filename */
        $filename = $reflection->getFileName();

        $relativePath = str_replace($this->projectDir, '', $filename);

        return self::GITHUB_BASE_LINK . $relativePath;
    }

    /** * @return list<class-string<object>> */
return $services;
    }

    /** * @param class-string<object> $serviceClassName */
    private function getServiceLink(string $serviceClassName): string
    {
        $reflection = new \ReflectionClass($serviceClassName);

        $group = $this->serviceReferenceGenerator->getGroupForService($reflection);

        return sprintf('./%s#%s', ServiceReferenceGenerator::GROUPS[$group]$reflection->getShortName());
    }

    /** * @param class-string<Hook> $hook * * @return array<string, mixed> */
    private function getDataForHook(string $hook): array
    {
        
Home | Imprint | This part of the site doesn't use cookies.