| @@ 198-206 (lines=9) @@ | ||
| 195 | private function buildRequestRate($array) |
|
| 196 | { |
|
| 197 | $result = []; |
|
| 198 | foreach ($array as $pair) { |
|
| 199 | $string = self::DIRECTIVE_REQUEST_RATE . ':' . $pair['ratio']; |
|
| 200 | if (isset($pair['from']) && |
|
| 201 | isset($pair['to']) |
|
| 202 | ) { |
|
| 203 | $string .= ' ' . $pair['from'] . '-' . $pair['to']; |
|
| 204 | } |
|
| 205 | $result[] = $string; |
|
| 206 | } |
|
| 207 | return $result; |
|
| 208 | } |
|
| 209 | ||
| @@ 176-184 (lines=9) @@ | ||
| 173 | public function render(RenderHandler $handler) |
|
| 174 | { |
|
| 175 | $this->sort(); |
|
| 176 | foreach ($this->requestRates as $array) { |
|
| 177 | $time = ''; |
|
| 178 | if (isset($array['from']) && |
|
| 179 | isset($array['to']) |
|
| 180 | ) { |
|
| 181 | $time .= ' ' . $array['from'] . '-' . $array['to']; |
|
| 182 | } |
|
| 183 | $handler->add(self::DIRECTIVE_REQUEST_RATE, $array['ratio'] . $time); |
|
| 184 | } |
|
| 185 | return true; |
|
| 186 | } |
|
| 187 | } |
|