protected function getPluginTypes($pattern, $plugin_path)
    {
        $types = [];
        $project_root = ProjectX::projectRoot();

        foreach ($this->getInstalledPluginNamespaces() as $name => $namespace) {
            $plugin_dir = "$project_root/vendor/$name";

            if (!file_exists($plugin_dir)) {
                continue;
            }
            $plugin_dir = "$plugin_dir/src";

            if (isset($plugin_path)) {
                $plugin_dir = "$plugin_dir/$plugin_path";
            }

            if (!file_exists($plugin_dir)) {
                continue;
            }

            $classes = (new PhpClassDiscovery)
                ->setSearchPattern($pattern)
                ->addSearchLocation($plugin_dir)
                ->discover();

            foreach ($classes as $classname) {
                if (!class_exists($classname)) {
                    continue;
                }

                $types[$classname::getTypeId()] = $classname;
            }
        }

        return $types;
    }
protected function getPluginTypes($pattern, $plugin_path)
    {
        $types = [];
        $project_root = ProjectX::projectRoot();

        foreach ($this->getInstalledPluginNamespaces() as $name => $namespace) {
            $plugin_dir = "$project_root/vendor/$name";

            if (!file_exists($plugin_dir)) {
                continue;
            }
            $plugin_dir = "$plugin_dir/src";

            if (isset($plugin_path)) {
                $plugin_dir = "$plugin_dir/$plugin_path";
            }

            if (!file_exists($plugin_dir)) {
                continue;
            }

            $classes = (new PhpClassDiscovery)
                ->setSearchPattern($pattern)
                ->addSearchLocation($plugin_dir)
                ->discover();

            foreach ($classes as $classname) {
                if (!class_exists($classname)) {
                    continue;
                }

                $types[$classname::getTypeId()] = $classname;
            }
        }

        return $types;
    }
protected function getPluginTypes ( $ pattern , $ plugin_path ) { $ types = [ ] ; $ project_root = ProjectX :: projectRoot ( ) ; foreach ( $ this -> getInstalledPluginNamespaces ( ) as $ name => $ namespace ) { $ plugin_dir = "$project_root/vendor/$name" ; if ( ! file_exists ( $ plugin_dir ) ) { continue ; } $ plugin_dir = "$plugin_dir/src" ; if ( isset ( $ plugin_path ) ) { $ plugin_dir = "$plugin_dir/$plugin_path" ; } if ( ! file_exists ( $ plugin_dir ) ) { continue ; } $ classes = ( new PhpClassDiscovery ) -> setSearchPattern ( $ pattern ) -> addSearchLocation ( $ plugin_dir ) -> discover ( ) ; foreach ( $ classes as $ classname ) { if ( ! class_exists ( $ classname ) ) { continue ; } $ types [ $ classname :: getTypeId ( ) ] = $ classname ; } } return $ types ; }
Get plugin types.

@param string $pattern
The plugin type search pattern.
@param string $plugin_path
The plugin path after the /src directory.

@return array
An array of plugin type class names, keyed by type identifier.
Get plugin types .