@@ -37,6 +37,10 @@ discard block |
||
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | abstract protected function getServiceConfig($id): ConfigInterface; |
| 40 | + |
|
| 41 | + /** |
|
| 42 | + * @param string $id |
|
| 43 | + */ |
|
| 40 | 44 | abstract protected function hasServiceConfig($id): bool; |
| 41 | 45 | |
| 42 | 46 | public function get($id) |
@@ -75,6 +79,9 @@ discard block |
||
| 75 | 79 | return $this->hasServiceConfig($id); |
| 76 | 80 | } |
| 77 | 81 | |
| 82 | + /** |
|
| 83 | + * @param string $id |
|
| 84 | + */ |
|
| 78 | 85 | protected function getInstanceFromFactory($id) |
| 79 | 86 | { |
| 80 | 87 | $class = null; |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | // Make sure we have one of these |
| 49 | 49 | if (!$this->has($id)) { |
| 50 | 50 | throw new UnknownServiceException( |
| 51 | - 'Unable to locate service ' . $id . '. Please check your configuration.' |
|
| 51 | + 'Unable to locate service '.$id.'. Please check your configuration.' |
|
| 52 | 52 | ); |
| 53 | 53 | } |
| 54 | 54 | |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | || !in_array(FactoryInterface::class, class_implements($class)) |
| 99 | 99 | ) { |
| 100 | 100 | throw new InvalidConfigException( |
| 101 | - $id . '. Is not a valid factory. Please check your configuration.' |
|
| 101 | + $id.'. Is not a valid factory. Please check your configuration.' |
|
| 102 | 102 | ); |
| 103 | 103 | } |
| 104 | 104 | |
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | { |
| 15 | 15 | public function __invoke(array $options) |
| 16 | 16 | { |
| 17 | - $maxNestingLevel = (int) ($options['maxNestingLevel'] ?? 3); |
|
| 17 | + $maxNestingLevel = (int) ($options['maxNestingLevel'] ?? 3); |
|
| 18 | 18 | $exceptionTraceAsString = (bool) ($options['exceptionTraceAsString'] ?? true); |
| 19 | 19 | return new MongoDBFormatter($maxNestingLevel, $exceptionTraceAsString); |
| 20 | 20 | } |
@@ -11,9 +11,9 @@ |
||
| 11 | 11 | { |
| 12 | 12 | public function __invoke(array $options) |
| 13 | 13 | { |
| 14 | - $applicationName = $options['applicationName'] ?? ''; |
|
| 15 | - $systemName = $options['systemName'] ?? ''; |
|
| 16 | - $extraPrefix = $options['extraPrefix'] ?? ''; |
|
| 14 | + $applicationName = $options['applicationName'] ?? ''; |
|
| 15 | + $systemName = $options['systemName'] ?? ''; |
|
| 16 | + $extraPrefix = $options['extraPrefix'] ?? ''; |
|
| 17 | 17 | $contextPrefix = (string) ($options['contextPrefix'] ?? 'ctxt_'); |
| 18 | 18 | |
| 19 | 19 | return new LogstashFormatter($applicationName, $systemName, $extraPrefix, $contextPrefix); |
@@ -12,10 +12,10 @@ |
||
| 12 | 12 | { |
| 13 | 13 | public function __invoke(array $options) |
| 14 | 14 | { |
| 15 | - $batchMode = (int) ($options['batchMode'] ?? JsonFormatter::BATCH_MODE_JSON); |
|
| 15 | + $batchMode = (int) ($options['batchMode'] ?? JsonFormatter::BATCH_MODE_JSON); |
|
| 16 | 16 | $appendNewline = (bool) ($options['appendNewline'] ?? true); |
| 17 | - $hostmane = (string) ($options['hostname'] ?? ''); |
|
| 18 | - $appName = (string) ($options['appName'] ?? ''); |
|
| 17 | + $hostmane = (string) ($options['hostname'] ?? ''); |
|
| 18 | + $appName = (string) ($options['appName'] ?? ''); |
|
| 19 | 19 | |
| 20 | 20 | $formatter = new LogmaticFormatter($batchMode, $appendNewline); |
| 21 | 21 | |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | { |
| 12 | 12 | public function __invoke(array $options) |
| 13 | 13 | { |
| 14 | - $batchMode = (int) ($options['batchMode'] ?? JsonFormatter::BATCH_MODE_JSON); |
|
| 14 | + $batchMode = (int) ($options['batchMode'] ?? JsonFormatter::BATCH_MODE_JSON); |
|
| 15 | 15 | $appendNewline = (bool) ($options['appendNewline'] ?? true); |
| 16 | 16 | return new JsonFormatter($batchMode, $appendNewline); |
| 17 | 17 | } |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | { |
| 12 | 12 | public function __invoke(array $options) |
| 13 | 13 | { |
| 14 | - $batchMode = $options['batchMode'] ?? LogglyFormatter::BATCH_MODE_NEWLINES; |
|
| 14 | + $batchMode = $options['batchMode'] ?? LogglyFormatter::BATCH_MODE_NEWLINES; |
|
| 15 | 15 | $appendNewline = (bool) ($options['appendNewline'] ?? true); |
| 16 | 16 | return new LogglyFormatter($batchMode, $appendNewline); |
| 17 | 17 | } |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | |
| 20 | 20 | if (!$this->getContainer()->has($name)) { |
| 21 | 21 | throw new MissingServiceException( |
| 22 | - 'No service found for :' . $name |
|
| 22 | + 'No service found for :'.$name |
|
| 23 | 23 | ); |
| 24 | 24 | } |
| 25 | 25 | |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | |
| 45 | 45 | if (!$this->has($id)) { |
| 46 | 46 | throw new MissingConfigException( |
| 47 | - 'Unable to locate channel ' . $id |
|
| 47 | + 'Unable to locate channel '.$id |
|
| 48 | 48 | ); |
| 49 | 49 | } |
| 50 | 50 | |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | { |
| 82 | 82 | if (!$this->handlerManager->has($id)) { |
| 83 | 83 | throw new UnknownServiceException( |
| 84 | - 'Unable to locate processor ' . $id |
|
| 84 | + 'Unable to locate processor '.$id |
|
| 85 | 85 | ); |
| 86 | 86 | } |
| 87 | 87 | |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | { |
| 93 | 93 | if (!$this->processorManager->has($id)) { |
| 94 | 94 | throw new UnknownServiceException( |
| 95 | - 'Unable to locate processor ' . $id |
|
| 95 | + 'Unable to locate processor '.$id |
|
| 96 | 96 | ); |
| 97 | 97 | } |
| 98 | 98 | |
@@ -17,8 +17,8 @@ |
||
| 17 | 17 | public function __invoke(array $options) |
| 18 | 18 | { |
| 19 | 19 | $exchange = $this->getService($options['exchange'] ?? null); |
| 20 | - $exchangeName = (string) ($options['exchangeName'] ?? 'log'); |
|
| 21 | - $level = (int) ($options['level'] ?? Logger::DEBUG); |
|
| 20 | + $exchangeName = (string) ($options['exchangeName'] ?? 'log'); |
|
| 21 | + $level = (int) ($options['level'] ?? Logger::DEBUG); |
|
| 22 | 22 | $bubble = (bool) ($options['bubble'] ?? true); |
| 23 | 23 | |
| 24 | 24 | return new AmqpHandler( |