Completed
Push — master ( c23b73...bac89c )
by Nikita
04:11
created

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<link rel="stylesheet" href="<?= $path ?>/_index.css">
2
3
<div class="content">
4
    <div class="content__top clearfix">
5
        <div class="navigation-city"><h1 class="title title_level_1"><?= $city->city ?>. Погода</h1></div>
6
        <div class="current-weather">
7
            <div class="current-weather__today">Сейчас <span
8
                    class="current-weather__local-time"><?= date("H:i") ?></span></div>
9
            <span class="current-weather__col current-weather__col_type_now t_c_<?= $city->fact->temperature ?>"><i
10
                    class="icon icon_size_48 icon_thumb_<?= $city->fact->getIcon() ?>" data-width="48"></i><span
11
                    class="current-weather__comment">пасмурно</span><div
12
                    class="current-weather__thermometer current-weather__thermometer_type_now"><?= $city->fact->getTemperatureStr() ?>
13
                    °C
14
                </div></span><span
15
                class="current-weather__col current-weather__col_type_after t_c_<?= $city->getCurrentDay()->night->temperature_avg ?>"><span
16
                    class="current-weather__thermometer-name">ночью</span><i
17
                    class="icon icon_thumb_<?= $city->getCurrentDay()->night->getIcon() ?> icon_size_30"
18
                    data-width="30"></i><div
19
                    class="current-weather__thermometer current-weather__thermometer_type_after"><?= $city->getCurrentDay()->night->getTemperatureAvgStr() ?>
20
                </div></span><span
21
                class="current-weather__col current-weather__col_type_after t_c_<?= $city->getCurrentDay()->day->temperature_avg ?>"><span
22
                    class="current-weather__thermometer-name">днём</span><i
23
                    class="icon icon_thumb_<?= $city->getCurrentDay()->day->getIcon() ?> icon_size_30"
24
                    data-width="30"></i><div
25
                    class="current-weather__thermometer current-weather__thermometer_type_after"><?= $city->getCurrentDay()->day->getTemperatureAvgStr() ?>
26
                </div></span><span class="current-weather__col current-weather__info"><div
27
                    class="current-weather__info-row">
28
                    <span class="current-weather__info-label">Восход: </span><?= $city->getCurrentDay()->sunrise ?><span
29
                        class="current-weather__info-label current-weather__info-label_type_sunset">Закат: </span><?= $city->getCurrentDay()->sunset ?>
30
                </div><div class="current-weather__info-row current-weather__info-row_type_wind"><span
31
                        class="current-weather__info-label">Ветер: </span> <span
32
                        class="wind-speed"><?= $city->fact->wind_speed ?> м/с</span> <abbr
33
                        class=" icon-abbr" title="Ветер: северо-восточный"><?= $city->fact->getWindDirection() ?></abbr><i
34
                        class="icon icon_size_12 icon_wind_<?= $city->fact->wind_direction ?> icon_wind"
35
                        data-width="12"></i></div><div
36
                    class="current-weather__info-row"><span
37
                        class="current-weather__info-label">Влажность: </span><?= $city->fact->humidity ?>%
38
                </div><div class="current-weather__info-row"><span
39
                        class="current-weather__info-label">Давление: </span><?= $city->fact->pressure ?> мм
40
                    рт. ст.
41
                </div><div class="current-weather__info-row current-weather__info-row_type_time">Данные
42
                    на <?= $city->fact->getObservationTime() ?></div></span>
43
44
            <div class="current-weather__yesterday">Вчера в это
45
                время: <?= $city->yesterday->getTemperatureStr() ?></div>
46
        </div>
47
    </div>
48
    <div class="forecasts">
49
        <div class="tabs-panes i-bem" data-bem="{&quot;tabs-panes&quot;:{&quot;id&quot;:&quot;forecasts&quot;}}">
50
            <div class="tabs-panes__pane tabs-panes__pane_active_yes" role="tabpanel" aria-labelledby="forecasts-tab-0"
51
                 aria-expanded="true">
52
                <ul class="forecast-brief forecast-item">
53
                    <?php
54
55
56
                    $i = 0;
57
                    foreach ($city->getListDays() as $key => $day) {
58
59
60
                        echo '<li class="forecast-brief__item">
61
                        <div class="forecast-brief__item-date ' . ($day->checkWeekend($key, true) ? "forecast-brief__item-date_weekend_yes" : "") . '"><span
62
                                class="forecast-brief__item-dayname">' . $day->getDayName($key) . '</span><span
63
                                class="forecast-brief__item-day">' . $day->getDayNumber($key) . ' ' . ($i > 0 ? "" : $day->getMonthName($key)) . '</span></div>
64
                        <div class="forecast-brief__item-description t_c_' . $day->day->temperature_avg . '"><i
65
                                class="icon icon_thumb_' . $day->day->getIcon() . ' icon_size_30" data-width="30"></i>
66
67
                            <div class="forecast-brief__item-comment">' . $day->day->weather_type . '</div>
68
                            <div class="forecast-brief__item-temp-day" title="Максимальная температура днём">
69
                             ' . $day->day->getTemperatureAvgStr() . '
70
                             ' . ($i > 0 ? "" : "днём") . '
71
                            </div>
72
                        </div>
73
                        <div class="forecast-brief__item-temp-night t_c_' . $day->night->temperature_avg . '" title="Минимальная температура ночью">
74
                            ' . $day->night->getTemperatureAvgStr() . '
75
                            ' . ($i > 0 ? "" : "ночью") . '
76
                        </div>
77
                    </li>';
78
79
                        if ($day->checkWeekend($key)) {
80
                            echo '<li class="forecast-brief__item forecast-brief__item_gap">&nbsp;</li>';
81
                        }
82
83
84
                        $i++;
85
86
87
                    }
88
89
                    ?>
90
91
                </ul>
92
            </div>
93
94
            <h1 class="title title_level_1">Прогноз на 10 дней</h1>
95
96
            <div class="tabs-panes__pane tabs-panes__pane_active_yes" role="tabpanel" aria-labelledby="forecasts-tab-1" aria-expanded="false">
97
                <dl class="forecast-detailed forecast-item">
98
99
                    <?php
100
                    $i = 0;
101
                    foreach($city->getListDays() as $key => $day){
102
103
                        echo '<dt class="forecast-detailed__day ' . ($day->checkWeekend($key, true) ? "forecast-detailed__day_weekend" : "") . '">
104
                                <small class="forecast-detailed__weekday">' . $day->getDayName($key) . '</small>
105
                                <strong class="forecast-detailed__day-number">' . $day->getDayNumber($key) . '<span class="forecast-detailed__day-month">'.$day->getMonthName($key).'</span></strong>
106
                            </dt>';
107
108
                        echo '<dd class="forecast-detailed__day-info '.($i<1 ? "forecast-detailed__day-info_first": "").'">
109
                                <table class="weather-table">
110
                                    <thead class="weather-table__head">
111
                                    <tr>
112
                                        <th class="weather-table__head-cell" colspan="3"></th>
113
                                        <th class="weather-table__head-cell">
114
                                            <div class="weather-table__value">Давление, <br>мм рт. ст.</div>
115
                                        </th>
116
                                        <th class="weather-table__head-cell">
117
                                            <div class="weather-table__value">Влажность</div>
118
                                        </th>
119
                                        <th class="weather-table__head-cell weather-table__head-cell_type_wind" colspan="2">
120
                                            <div class="weather-table__value">Ветер, м/с</div>
121
                                        </th>
122
                                    </tr>
123
                                </thead>';
124
                        //var_dump($day->getListDetail());
0 ignored issues
show
Unused Code Comprehensibility introduced by
78% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
125
                        echo '<tbody class="weather-table__body">';
126
127
                        foreach ($day->getListDetail() as $key => $detail) {
128
129
                            echo '<tr class="weather-table__row t t_c_' . $detail->temperature_avg . '">
130
                                <td class="weather-table__body-cell weather-table__body-cell_type_daypart">
131
                                    <div class="weather-table__daypart">'.$key.'</div>
132
                                    <div class="weather-table__temp">'.$detail->getTemperatureFromTo().'</div>
133
                                </td>
134
                                <td class="weather-table__body-cell weather-table__body-cell_type_icon">
135
                                    <div class="weather-table__value"><i class="icon icon_size_30 icon_thumb_'.$detail->getIcon().'"
136
                                                                         data-width="30"></i></div>
137
                                </td>
138
                                <td class="weather-table__body-cell weather-table__body-cell_type_condition">
139
                                    <div class="weather-table__value">' . $detail->weather_type . '</div>
140
                                </td>
141
                                <td class="weather-table__body-cell weather-table__body-cell_type_air-pressure">
142
                                    <div class="weather-table__value">'.$detail->pressure.'</div>
143
                                </td>
144
                                <td class="weather-table__body-cell weather-table__body-cell_type_humidity">
145
                                    <div class="weather-table__value">'.$detail->humidity.'%</div>
146
                                </td>
147
                                <td class="weather-table__body-cell weather-table__body-cell_type_wind">
148
                                    <div class="weather-table__value"><abbr class=" icon-abbr"
149
                                                                            title="Ветер: западный">'.$detail->getWindDirection().'</abbr><i
150
                                            class="icon icon_size_12 icon_wind_'.$detail->wind_direction.' icon_wind" data-width="12"></i><span
151
                                            class="weather-table__wind"><span class="wind-speed">'.$detail->wind_speed.'</span></span></div>
152
                                </td>
153
                                <td class="weather-table__body-cell weather-table__body-cell_type_wind-strength">
154
                                    <div class="weather-table__value"></div>
155
                                </td>
156
                            </tr>
157
158
                            ';
159
160
                        }
161
162
                        echo '</tbody>';
163
164
                        echo '</table>
165
                                <!--<div class="forecast-detailed__geomagnetic-field">
166
                                    <small class="forecast-detailed__key">Магнитное поле:</small>
167
                                    <div class="forecast-detailed__value">слабо возмущенное</div>
168
                                </div>-->
169
                                <div class="forecast-detailed__moon"><i class="icon icon_size_26 icon_moon_'.$day->moon_phase.'" title=""
170
                                                                        data-width="26"></i></div>
171
                                <div class="forecast-detailed__sunset">
172
                                    <small class="forecast-detailed__key">Закат</small>
173
                                    <div class="forecast-detailed__value">'.$day->sunset.'</div>
174
                                </div>
175
                                <div class="forecast-detailed__sunrise">
176
                                    <small class="forecast-detailed__key">Восход</small>
177
                                    <div class="forecast-detailed__value">'.$day->sunrise.'</div>
178
                                </div>
179
                            </dd>';
180
181
182
183
                        $i++;
184
                    }
185
186
                    ?>
187
188
189
190
191
                </dl>
192
            </div>
193
194
        </div>
195
    </div>
196
</div>