| @@ 208-216 (lines=9) @@ | ||
| 205 | private function buildRequestRate($array) |
|
| 206 | { |
|
| 207 | $result = []; |
|
| 208 | foreach ($array as $pair) { |
|
| 209 | $string = self::DIRECTIVE_REQUEST_RATE . ':1/' . $pair['rate'] . 's'; |
|
| 210 | if (isset($pair['from']) && |
|
| 211 | isset($pair['to']) |
|
| 212 | ) { |
|
| 213 | $string .= ' ' . $pair['from'] . '-' . $pair['to']; |
|
| 214 | } |
|
| 215 | $result[] = $string; |
|
| 216 | } |
|
| 217 | return $result; |
|
| 218 | } |
|
| 219 | ||
| @@ 146-154 (lines=9) @@ | ||
| 143 | public function render(RenderHandler $handler) |
|
| 144 | { |
|
| 145 | $this->sort(); |
|
| 146 | foreach ($this->requestRates as $array) { |
|
| 147 | $suffix = 's'; |
|
| 148 | if (isset($array['from']) && |
|
| 149 | isset($array['to']) |
|
| 150 | ) { |
|
| 151 | $suffix .= ' ' . $array['from'] . '-' . $array['to']; |
|
| 152 | } |
|
| 153 | $handler->add(self::DIRECTIVE_REQUEST_RATE, '1/' . $array['rate'] . $suffix); |
|
| 154 | } |
|
| 155 | return true; |
|
| 156 | } |
|
| 157 | } |
|