src/fwidm/dwdHourlyCrawler/DWDLib.php
private function createServices(DWDHourlyParameters $variables): array
    {
        $conf = DWDConfiguration::getHourlyConfiguration()->parameters;
        $controllers = array();
        if (!empty($variables->getVariables())) {
            foreach ($variables->getVariables() as $var) {

                switch ($var) {
                    case $conf->pressure->name:
                        $controllers[$conf->pressure->name] = new HourlyPressureService('pressure');
                        break;
                    case $conf->airTemperature->name:
                        $controllers[$conf->airTemperature->name] = new HourlyAirTemperatureService('airTemperature');
                        break;
                    case $conf->cloudiness->name:
                        $controllers[$conf->cloudiness->name] = new HourlyCloudinessService('cloudiness');
                        break;
                    case $conf->precipitation->name:
                        $controllers[$conf->precipitation->name] = new HourlyPrecipitationService('precipitation');
                        break;
                    case $conf->soilTemperature->name:
                        $controllers[$conf->soilTemperature->name] = new HourlySoilTempService('soilTemperature');
                        break;
                    case $conf->solar->name:
                        $controllers[$conf->solar->name] = new HourlySolarService('solar');
                        break;
                    case $conf->sun->name:
                        $controllers[$conf->sun->name] = new HourlySunService('sun');
                        break;
                    case $conf->wind->name:
                        $controllers[$conf->wind->name] = new HourlyWindService('wind');
                        break;
                    default:
                        print('Unknown variable: var=' . $var . '<br>');
                }
            }
        }
        return $controllers;
    }
private function createServices(DWDHourlyParameters $variables): array
    {
        $conf = DWDConfiguration::getHourlyConfiguration()->parameters;
        $controllers = array();
        if (!empty($variables->getVariables())) {
            foreach ($variables->getVariables() as $var) {

                switch ($var) {
                    case $conf->pressure->name:
                        $controllers[$conf->pressure->name] = new HourlyPressureService('pressure');
                        break;
                    case $conf->airTemperature->name:
                        $controllers[$conf->airTemperature->name] = new HourlyAirTemperatureService('airTemperature');
                        break;
                    case $conf->cloudiness->name:
                        $controllers[$conf->cloudiness->name] = new HourlyCloudinessService('cloudiness');
                        break;
                    case $conf->precipitation->name:
                        $controllers[$conf->precipitation->name] = new HourlyPrecipitationService('precipitation');
                        break;
                    case $conf->soilTemperature->name:
                        $controllers[$conf->soilTemperature->name] = new HourlySoilTempService('soilTemperature');
                        break;
                    case $conf->solar->name:
                        $controllers[$conf->solar->name] = new HourlySolarService('solar');
                        break;
                    case $conf->sun->name:
                        $controllers[$conf->sun->name] = new HourlySunService('sun');
                        break;
                    case $conf->wind->name:
                        $controllers[$conf->wind->name] = new HourlyWindService('wind');
                        break;
                    default:
                        print('Unknown variable: var=' . $var . '<br>');
                }
            }
        }
        return $controllers;
    }
private function createServices ( DWDHourlyParameters $ variables ) : array { $ conf = DWDConfiguration :: getHourlyConfiguration ( ) -> parameters ; $ controllers = array ( ) ; if ( ! empty ( $ variables -> getVariables ( ) ) ) { foreach ( $ variables -> getVariables ( ) as $ var ) { switch ( $ var ) { case $ conf -> pressure -> name : $ controllers [ $ conf -> pressure -> name ] = new HourlyPressureService ( 'pressure' ) ; break ; case $ conf -> airTemperature -> name : $ controllers [ $ conf -> airTemperature -> name ] = new HourlyAirTemperatureService ( 'airTemperature' ) ; break ; case $ conf -> cloudiness -> name : $ controllers [ $ conf -> cloudiness -> name ] = new HourlyCloudinessService ( 'cloudiness' ) ; break ; case $ conf -> precipitation -> name : $ controllers [ $ conf -> precipitation -> name ] = new HourlyPrecipitationService ( 'precipitation' ) ; break ; case $ conf -> soilTemperature -> name : $ controllers [ $ conf -> soilTemperature -> name ] = new HourlySoilTempService ( 'soilTemperature' ) ; break ; case $ conf -> solar -> name : $ controllers [ $ conf -> solar -> name ] = new HourlySolarService ( 'solar' ) ; break ; case $ conf -> sun -> name : $ controllers [ $ conf -> sun -> name ] = new HourlySunService ( 'sun' ) ; break ; case $ conf -> wind -> name : $ controllers [ $ conf -> wind -> name ] = new HourlyWindService ( 'wind' ) ; break ; default : print ( 'Unknown variable: var=' . $ var . '<br>' ) ; } } } return $ controllers ; }
Create a new instance of the appropriate controller.
@param DWDHourlyParameters $variables
@return AbstractHourlyService
@throws Error
@internal param $var
Create a new instance of the appropriate controller .