Code Duplication    Length = 6-6 lines in 2 locations

Plugins/Weather_plugin/Weather_plugin.php 2 locations

@@ 59-64 (lines=6) @@
56
57
        if(preg_match(JarvisLanguage::translate('preg_match_today',get_called_class()), $command)) {
58
            $answer = JarvisLanguage::translate('forecast_for_today',get_called_class());
59
            foreach ($forecast as $weather) {
60
                if($weather->time->day->format('d.m.Y')==date('d.m.Y')) {
61
                    $answer.=JarvisLanguage::translate('from',get_called_class()) . " " .$weather->time->from->format('H:i') . " ". JarvisLanguage::translate('to',get_called_class()) . " " . $weather->time->to->format('H:i').": ";
62
                    $answer.=$weather->weather->description." ".sprintf(JarvisLanguage::translate('temperature',get_called_class()),trim(str_replace('°C','',$weather->temperature)));
63
                }
64
            }
65
        } else if(preg_match(JarvisLanguage::translate('preg_match_tomorrow',get_called_class()), $command)) {
66
            $answer = JarvisLanguage::translate('forecast_for_tomorrow',get_called_class());
67
            foreach ($forecast as $weather) {
@@ 67-72 (lines=6) @@
64
            }
65
        } else if(preg_match(JarvisLanguage::translate('preg_match_tomorrow',get_called_class()), $command)) {
66
            $answer = JarvisLanguage::translate('forecast_for_tomorrow',get_called_class());
67
            foreach ($forecast as $weather) {
68
                if($weather->time->day->format('d.m.Y')==$tomorrow->format('d.m.Y')) {
69
                    $answer.=JarvisLanguage::translate('from',get_called_class()) . " " .$weather->time->from->format('H:i') . " ". JarvisLanguage::translate('to',get_called_class()) . " " . $weather->time->to->format('H:i').": ";
70
                    $answer.=$weather->weather->description." ".sprintf(JarvisLanguage::translate('temperature',get_called_class()),trim(str_replace('°C','',$weather->temperature)));
71
                }
72
            }
73
        } else {
74
            $answer = JarvisLanguage::translate('not_understand_weather_day',get_called_class());
75
        }