src/ApplicationFactory/DefaultApplicationFactory.php
public function createApplication(string $app_type, FileSystemInterface $filesystem) : ApplicationInterface
    {
        switch($app_type)
        {
            case ApplicationType::SHELL:
                return (new Calgamo($filesystem))
                    ->newApp()
                    ->requireModule(CalgamoShellRequestModule::class);

            case ApplicationType::CRON:
                return (new Calgamo($filesystem))
                    ->newApp()
                    ->requireModule(CalgamoShellRequestModule::class);
                break;

            case ApplicationType::HTTP:
                return (new Calgamo($filesystem))
                    ->newApp()
                    ->requireModule('zend.request');
                break;

            case ApplicationType::REST:
                return (new Calgamo($filesystem))
                    ->newApp()
                    ->requireModule(ZendRequestModule::class)
                    ->requireModule(CalgamoRestApiModule::class);
                break;
        }
        return new NullApplication();
    }
public function createApplication(string $app_type, FileSystemInterface $filesystem) : ApplicationInterface
    {
        switch($app_type)
        {
            case ApplicationType::SHELL:
                return (new Calgamo($filesystem))
                    ->newApp()
                    ->requireModule(CalgamoShellRequestModule::class);

            case ApplicationType::CRON:
                return (new Calgamo($filesystem))
                    ->newApp()
                    ->requireModule(CalgamoShellRequestModule::class);
                break;

            case ApplicationType::HTTP:
                return (new Calgamo($filesystem))
                    ->newApp()
                    ->requireModule('zend.request');
                break;

            case ApplicationType::REST:
                return (new Calgamo($filesystem))
                    ->newApp()
                    ->requireModule(ZendRequestModule::class)
                    ->requireModule(CalgamoRestApiModule::class);
                break;
        }
        return new NullApplication();
    }
public function createApplication ( string $ app_type , FileSystemInterface $ filesystem ) : ApplicationInterface { switch ( $ app_type ) { case ApplicationType :: SHELL : return ( new Calgamo ( $ filesystem ) ) -> newApp ( ) -> requireModule ( CalgamoShellRequestModule :: class ) ; case ApplicationType :: CRON : return ( new Calgamo ( $ filesystem ) ) -> newApp ( ) -> requireModule ( CalgamoShellRequestModule :: class ) ; break ; case ApplicationType :: HTTP : return ( new Calgamo ( $ filesystem ) ) -> newApp ( ) -> requireModule ( 'zend.request' ) ; break ; case ApplicationType :: REST : return ( new Calgamo ( $ filesystem ) ) -> newApp ( ) -> requireModule ( ZendRequestModule :: class ) -> requireModule ( CalgamoRestApiModule :: class ) ; break ; } return new NullApplication ( ) ; }
Create appication by type

@param string $app_type
@param FileSystemInterface $filesystem

@return ApplicationInterface
Create appication by type