| @@ 171-183 (lines=13) @@ | ||
| 168 | * |
|
| 169 | * @return array |
|
| 170 | */ |
|
| 171 | protected function formatFormatters(array $formatters = []) |
|
| 172 | { |
|
| 173 | foreach ($formatters as $id => $option) { |
|
| 174 | $class = $option['formatter'] ?? LineFormatter::class; |
|
| 175 | unset($option['formatter']); |
|
| 176 | ||
| 177 | $formatters[$id] = function () use ($class, $option) { |
|
| 178 | return (new ClassResolver($class))->resolve($option); |
|
| 179 | }; |
|
| 180 | } |
|
| 181 | ||
| 182 | return $formatters; |
|
| 183 | } |
|
| 184 | ||
| 185 | /** |
|
| 186 | * @param array $handlers |
|
| @@ 229-245 (lines=17) @@ | ||
| 226 | * |
|
| 227 | * @return array |
|
| 228 | */ |
|
| 229 | protected function formatProcessors(array $processors = []) |
|
| 230 | { |
|
| 231 | foreach ($processors as $id => $option) { |
|
| 232 | if (empty($option['processor'])) { |
|
| 233 | continue; |
|
| 234 | } |
|
| 235 | ||
| 236 | $class = $option['processor']; |
|
| 237 | unset($option['processor']); |
|
| 238 | ||
| 239 | $processors[$id] = function () use ($class, $option) { |
|
| 240 | return (new ClassResolver($class))->resolve($option); |
|
| 241 | }; |
|
| 242 | } |
|
| 243 | ||
| 244 | return $processors; |
|
| 245 | } |
|
| 246 | ||
| 247 | /** |
|
| 248 | * @param array $channels |
|