findClassNames example



    /** * @return list<class-string<object>> */
    private function findScriptServices(): array
    {
        $scriptServices = [];

        $shopwareClasses = ConstructFinder::locatedIn(__DIR__ . '/../../../..')
            ->exclude('*/Test/*', '*/vendor/*', '*/DevOps/StaticAnalyze*')
            ->findClassNames();

        foreach ($shopwareClasses as $class) {
            if (!class_exists($class)) {
                // skip not autoloadable test classes                 continue;
            }

            $reflection = new \ReflectionClass($class);

            if (!$reflection->getDocComment()) {
                continue;
            }


    /** * @return list<class-string<Hook>> */
    private function getHookClasses(): array
    {
        $hookClasses = [];

        $shopwareClasses = ConstructFinder::locatedIn(__DIR__ . '/../../../..')
            ->exclude('*/Test/*', '*/vendor/*', '*/DevOps/StaticAnalyze*')
            ->findClassNames();

        foreach ($shopwareClasses as $class) {
            if (!class_exists($class)) {
                // skip not autoloadable test classes                 continue;
            }

            if (is_subclass_of($class, FunctionHook::class) || is_subclass_of($class, TraceHook::class)) {
                continue;
            }

            
Home | Imprint | This part of the site doesn't use cookies.