@@ -4,7 +4,6 @@ |
||
| 4 | 4 | |
| 5 | 5 | use Psr\Container\ContainerInterface; |
| 6 | 6 | use WShafer\PSR11MonoLog\Config\MainConfig; |
| 7 | -use WShafer\PSR11MonoLog\Config\MainConfigFactory; |
|
| 8 | 7 | use WShafer\PSR11MonoLog\Formatter\FormatterMapper; |
| 9 | 8 | use WShafer\PSR11MonoLog\Handler\HandlerMapper; |
| 10 | 9 | use WShafer\PSR11MonoLog\Processor\ProcessorMapper; |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | namespace WShafer\PSR11MonoLog\Handler; |
| 5 | 5 | |
@@ -21,9 +21,9 @@ discard block |
||
| 21 | 21 | { |
| 22 | 22 | $stream = $this->getStream($options['stream'] ?? null); |
| 23 | 23 | |
| 24 | - $level = (int) ($options['level'] ?? Logger::DEBUG); |
|
| 24 | + $level = (int) ($options['level'] ?? Logger::DEBUG); |
|
| 25 | 25 | $bubble = (boolean) ($options['bubble'] ?? true); |
| 26 | - $filePermission = (int) ($options['filePermission'] ?? 0644); |
|
| 26 | + $filePermission = (int) ($options['filePermission'] ?? 0644); |
|
| 27 | 27 | $useLocking = (boolean) ($options['useLocking'] ?? true); |
| 28 | 28 | |
| 29 | 29 | return new StreamHandler($stream, $level, $bubble, $filePermission, $useLocking); |
@@ -36,6 +36,10 @@ discard block |
||
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | abstract protected function getServiceConfig($id) : ConfigInterface; |
| 39 | + |
|
| 40 | + /** |
|
| 41 | + * @param string $id |
|
| 42 | + */ |
|
| 39 | 43 | abstract protected function hasServiceConfig($id) : bool; |
| 40 | 44 | |
| 41 | 45 | public function get($id) |
@@ -74,6 +78,9 @@ discard block |
||
| 74 | 78 | return $this->hasServiceConfig($id); |
| 75 | 79 | } |
| 76 | 80 | |
| 81 | + /** |
|
| 82 | + * @param string $id |
|
| 83 | + */ |
|
| 77 | 84 | protected function getInstanceFromFactory($id) |
| 78 | 85 | { |
| 79 | 86 | $class = null; |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | namespace WShafer\PSR11MonoLog\Formatter; |
| 5 | 5 | |
@@ -10,9 +10,9 @@ discard block |
||
| 10 | 10 | { |
| 11 | 11 | public function __invoke(array $options) |
| 12 | 12 | { |
| 13 | - $applicationName = $options['applicationName'] ?? null; |
|
| 14 | - $systemName = $options['systemName'] ?? null; |
|
| 15 | - $extraPrefix = $options['extraPrefix'] ?? null; |
|
| 13 | + $applicationName = $options['applicationName'] ?? null; |
|
| 14 | + $systemName = $options['systemName'] ?? null; |
|
| 15 | + $extraPrefix = $options['extraPrefix'] ?? null; |
|
| 16 | 16 | $contextPrefix = (string) ($options['contextPrefix'] ?? 'ctxt_'); |
| 17 | 17 | |
| 18 | 18 | return new LogstashFormatter($applicationName, $systemName, $extraPrefix, $contextPrefix); |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | namespace WShafer\PSR11MonoLog\Formatter; |
| 5 | 5 | |
@@ -13,8 +13,8 @@ discard block |
||
| 13 | 13 | { |
| 14 | 14 | public function __invoke(array $options) |
| 15 | 15 | { |
| 16 | - $format = $options['format'] ?? null; |
|
| 17 | - $dateFormat = $options['dateFormat'] ?? null; |
|
| 16 | + $format = $options['format'] ?? null; |
|
| 17 | + $dateFormat = $options['dateFormat'] ?? null; |
|
| 18 | 18 | $allowInlineLineBreaks = (bool) ($options['allowInlineLineBreaks'] ?? false); |
| 19 | 19 | $ignoreEmptyContextAndExtra = (bool) ($options['ignoreEmptyContextAndExtra'] ?? false); |
| 20 | 20 | |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | namespace WShafer\PSR11MonoLog\Handler; |
| 5 | 5 | |
@@ -11,16 +11,16 @@ discard block |
||
| 11 | 11 | { |
| 12 | 12 | public function __invoke(array $options) |
| 13 | 13 | { |
| 14 | - $token = (string) ($options['token'] ?? ''); |
|
| 15 | - $users = (array) ($options['users'] ?? []); |
|
| 16 | - $title = $options['title'] ?? null; |
|
| 17 | - $level = (int) ($options['level'] ?? Logger::DEBUG); |
|
| 14 | + $token = (string) ($options['token'] ?? ''); |
|
| 15 | + $users = (array) ($options['users'] ?? []); |
|
| 16 | + $title = $options['title'] ?? null; |
|
| 17 | + $level = (int) ($options['level'] ?? Logger::DEBUG); |
|
| 18 | 18 | $bubble = (boolean) ($options['bubble'] ?? true); |
| 19 | 19 | $useSSL = (boolean) ($options['useSSL'] ?? true); |
| 20 | - $highPriorityLevel = (int) ($options['highPriorityLevel'] ?? Logger::CRITICAL); |
|
| 21 | - $emergencyLevel = (int) ($options['emergencyLevel'] ?? Logger::EMERGENCY); |
|
| 22 | - $retry = (int) ($options['retry'] ?? 30); |
|
| 23 | - $expire = (int) ($options['expire'] ?? 25200); |
|
| 20 | + $highPriorityLevel = (int) ($options['highPriorityLevel'] ?? Logger::CRITICAL); |
|
| 21 | + $emergencyLevel = (int) ($options['emergencyLevel'] ?? Logger::EMERGENCY); |
|
| 22 | + $retry = (int) ($options['retry'] ?? 30); |
|
| 23 | + $expire = (int) ($options['expire'] ?? 25200); |
|
| 24 | 24 | |
| 25 | 25 | return new PushoverHandler( |
| 26 | 26 | $token, |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | namespace WShafer\PSR11MonoLog\Handler; |
| 5 | 5 | |
@@ -16,8 +16,8 @@ discard block |
||
| 16 | 16 | public function __invoke(array $options) |
| 17 | 17 | { |
| 18 | 18 | $client = $this->getClient($options); |
| 19 | - $table = $options['table'] ?? null; |
|
| 20 | - $level = (int) ($options['level'] ?? Logger::DEBUG); |
|
| 19 | + $table = $options['table'] ?? null; |
|
| 20 | + $level = (int) ($options['level'] ?? Logger::DEBUG); |
|
| 21 | 21 | $bubble = (boolean) ($options['bubble'] ?? true); |
| 22 | 22 | |
| 23 | 23 | return new DynamoDbHandler( |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | namespace WShafer\PSR11MonoLog\Handler; |
| 5 | 5 | |
@@ -11,16 +11,16 @@ discard block |
||
| 11 | 11 | { |
| 12 | 12 | public function __invoke(array $options) |
| 13 | 13 | { |
| 14 | - $token = (string) ($options['token'] ?? ''); |
|
| 15 | - $channel = (string) ($options['channel'] ?? ''); |
|
| 16 | - $userName = $options['userName'] ?? null; |
|
| 14 | + $token = (string) ($options['token'] ?? ''); |
|
| 15 | + $channel = (string) ($options['channel'] ?? ''); |
|
| 16 | + $userName = $options['userName'] ?? null; |
|
| 17 | 17 | $useAttachment = (boolean) ($options['useAttachment'] ?? true); |
| 18 | - $iconEmoji = $options['iconEmoji'] ?? null; |
|
| 19 | - $level = (int) ($options['level'] ?? Logger::DEBUG); |
|
| 18 | + $iconEmoji = $options['iconEmoji'] ?? null; |
|
| 19 | + $level = (int) ($options['level'] ?? Logger::DEBUG); |
|
| 20 | 20 | $bubble = (boolean) ($options['bubble'] ?? true); |
| 21 | 21 | $useShortAttachment = (boolean) ($options['useShortAttachment'] ?? false); |
| 22 | 22 | $includeContext = (boolean) ($options['includeContextAndExtra'] ?? false); |
| 23 | - $excludeFields = (array) ($options['excludeFields'] ?? []); |
|
| 23 | + $excludeFields = (array) ($options['excludeFields'] ?? []); |
|
| 24 | 24 | |
| 25 | 25 | return new SlackHandler( |
| 26 | 26 | $token, |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | namespace WShafer\PSR11MonoLog\Handler; |
| 5 | 5 | |
@@ -11,16 +11,16 @@ discard block |
||
| 11 | 11 | { |
| 12 | 12 | public function __invoke(array $options) |
| 13 | 13 | { |
| 14 | - $webhookUrl = (string) ($options['webhookUrl'] ?? ''); |
|
| 15 | - $channel = $options['channel'] ?? null; |
|
| 16 | - $userName = $options['userName'] ?? null; |
|
| 14 | + $webhookUrl = (string) ($options['webhookUrl'] ?? ''); |
|
| 15 | + $channel = $options['channel'] ?? null; |
|
| 16 | + $userName = $options['userName'] ?? null; |
|
| 17 | 17 | $useAttachment = (boolean) ($options['useAttachment'] ?? true); |
| 18 | - $iconEmoji = $options['iconEmoji'] ?? null; |
|
| 18 | + $iconEmoji = $options['iconEmoji'] ?? null; |
|
| 19 | 19 | $useShortAttachment = (boolean) ($options['useShortAttachment'] ?? false); |
| 20 | 20 | $includeContext = (boolean) ($options['includeContextAndExtra'] ?? false); |
| 21 | - $level = (int) ($options['level'] ?? Logger::DEBUG); |
|
| 21 | + $level = (int) ($options['level'] ?? Logger::DEBUG); |
|
| 22 | 22 | $bubble = (boolean) ($options['bubble'] ?? true); |
| 23 | - $excludeFields = (array) ($options['excludeFields'] ?? []); |
|
| 23 | + $excludeFields = (array) ($options['excludeFields'] ?? []); |
|
| 24 | 24 | |
| 25 | 25 | return new SlackWebhookHandler( |
| 26 | 26 | $webhookUrl, |