ApplicationFactory.php
private function loadPlugins(): void
    {
        $finder = Finder::create();
        $finder
            ->name('*Plugin.php')
        ;
        if (is_dir($dir = __DIR__.'/../Plugins')) {
            $finder->in(__DIR__.'/../Plugins');
        }
        $dirs = $this->loadDirectoryFromAutoloader();
        $finder->in($dirs);
        foreach ($finder->files() as $file) {
            $namespace = 'Dotfiles\\Plugins\\'.str_replace('Plugin.php', '', $file->getFileName());
            $className = $namespace.'\\'.str_replace('.php', '', $file->getFileName());
            if (class_exists($className)) {
                /* @var \Dotfiles\Core\Plugin $plugin */
                $plugin = new $className();
                $this->registerPlugin($plugin);
            }
        }
    }
private function loadPlugins(): void
    {
        $finder = Finder::create();
        $finder
            ->name('*Plugin.php')
        ;
        if (is_dir($dir = __DIR__.'/../Plugins')) {
            $finder->in(__DIR__.'/../Plugins');
        }
        $dirs = $this->loadDirectoryFromAutoloader();
        $finder->in($dirs);
        foreach ($finder->files() as $file) {
            $namespace = 'Dotfiles\\Plugins\\'.str_replace('Plugin.php', '', $file->getFileName());
            $className = $namespace.'\\'.str_replace('.php', '', $file->getFileName());
            if (class_exists($className)) {
                /* @var \Dotfiles\Core\Plugin $plugin */
                $plugin = new $className();
                $this->registerPlugin($plugin);
            }
        }
    }
private function loadPlugins ( ) : void { $ finder = Finder :: create ( ) ; $ finder -> name ( '*Plugin.php' ) ; if ( is_dir ( $ dir = __DIR__ . '/../Plugins' ) ) { $ finder -> in ( __DIR__ . '/../Plugins' ) ; } $ dirs = $ this -> loadDirectoryFromAutoloader ( ) ; $ finder -> in ( $ dirs ) ; foreach ( $ finder -> files ( ) as $ file ) { $ namespace = 'Dotfiles\\Plugins\\' . str_replace ( 'Plugin.php' , '' , $ file -> getFileName ( ) ) ; $ className = $ namespace . '\\' . str_replace ( '.php' , '' , $ file -> getFileName ( ) ) ; if ( class_exists ( $ className ) ) { /* @var \Dotfiles\Core\Plugin $plugin */ $ plugin = new $ className ( ) ; $ this -> registerPlugin ( $ plugin ) ; } } }
Load available plugins.
Load available plugins .