| @@ 13-28 (lines=16) @@ | ||
| 10 | ||
| 11 | class NewRelicHandlerFactory implements FactoryInterface |
|
| 12 | { |
|
| 13 | public function __invoke(array $options) |
|
| 14 | { |
|
| 15 | $level = (int) ($options['level'] ?? Logger::DEBUG); |
|
| 16 | $bubble = (bool) ($options['bubble'] ?? true); |
|
| 17 | $appName = $options['appName'] ?? null; |
|
| 18 | $explodeArrays = (bool) ($options['explodeArrays'] ?? false); |
|
| 19 | $transactionName = $options['transactionName'] ?? null; |
|
| 20 | ||
| 21 | return new NewRelicHandler( |
|
| 22 | $level, |
|
| 23 | $bubble, |
|
| 24 | $appName, |
|
| 25 | $explodeArrays, |
|
| 26 | $transactionName |
|
| 27 | ); |
|
| 28 | } |
|
| 29 | } |
|
| 30 | ||
| @@ 27-37 (lines=11) @@ | ||
| 24 | * @return StreamHandler |
|
| 25 | * @throws Exception |
|
| 26 | */ |
|
| 27 | public function __invoke(array $options) |
|
| 28 | { |
|
| 29 | $stream = $this->getStream($options['stream'] ?? null); |
|
| 30 | ||
| 31 | $level = (int) ($options['level'] ?? Logger::DEBUG); |
|
| 32 | $bubble = (bool) ($options['bubble'] ?? true); |
|
| 33 | $filePermission = (int) ($options['filePermission'] ?? 0644); |
|
| 34 | $useLocking = (bool) ($options['useLocking'] ?? true); |
|
| 35 | ||
| 36 | return new StreamHandler($stream, $level, $bubble, $filePermission, $useLocking); |
|
| 37 | } |
|
| 38 | ||
| 39 | protected function getStream($stream) |
|
| 40 | { |
|