@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace leinonen\Yii2Monolog\CreationStrategies; |
6 | 6 | |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | public function resolve(string $class): CreationStrategyInterface |
19 | 19 | { |
20 | 20 | $shortClassName = (new \ReflectionClass($class))->getShortName(); |
21 | - $strategyClassName = self::CREATION_STRATEGY_NAMESPACE . "\\{$shortClassName}Strategy"; |
|
21 | + $strategyClassName = self::CREATION_STRATEGY_NAMESPACE."\\{$shortClassName}Strategy"; |
|
22 | 22 | |
23 | 23 | if (\class_exists($strategyClassName)) { |
24 | 24 | return new $strategyClassName; |
@@ -46,7 +46,7 @@ |
||
46 | 46 | */ |
47 | 47 | private function validateProcessorClass(string $processorClass) |
48 | 48 | { |
49 | - if (! (new \ReflectionClass($processorClass))->hasMethod('__invoke')) { |
|
49 | + if ( ! (new \ReflectionClass($processorClass))->hasMethod('__invoke')) { |
|
50 | 50 | throw new \InvalidArgumentException("{$processorClass} isn't callable. All processor classes must implement the __invoke method."); |
51 | 51 | } |
52 | 52 | } |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace leinonen\Yii2Monolog; |
6 | 6 |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace leinonen\Yii2Monolog\CreationStrategies; |
6 | 6 |
@@ -49,7 +49,7 @@ |
||
49 | 49 | private function validateFormatter(string $formatterClass) |
50 | 50 | { |
51 | 51 | $formatterInterface = FormatterInterface::class; |
52 | - if (! (new \ReflectionClass($formatterClass))->implementsInterface($formatterInterface)) { |
|
52 | + if ( ! (new \ReflectionClass($formatterClass))->implementsInterface($formatterInterface)) { |
|
53 | 53 | throw new \InvalidArgumentException("{$formatterClass} doesn't implement {$formatterInterface}"); |
54 | 54 | } |
55 | 55 | } |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace leinonen\Yii2Monolog\Factories; |
6 | 6 | |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | private function validateHandler(string $handlerClass) |
70 | 70 | { |
71 | 71 | $handlerInterface = HandlerInterface::class; |
72 | - if (! (new \ReflectionClass($handlerClass))->implementsInterface($handlerInterface)) { |
|
72 | + if ( ! (new \ReflectionClass($handlerClass))->implementsInterface($handlerInterface)) { |
|
73 | 73 | throw new \InvalidArgumentException("{$handlerClass} doesn't implement {$handlerInterface}"); |
74 | 74 | } |
75 | 75 | } |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace leinonen\Yii2Monolog\CreationStrategies; |
6 | 6 | |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | */ |
39 | 39 | public function getConfigurationCallable(array $config): callable |
40 | 40 | { |
41 | - return function (StreamHandler $instance) { |
|
41 | + return function(StreamHandler $instance) { |
|
42 | 42 | return $instance; |
43 | 43 | }; |
44 | 44 | } |
@@ -89,12 +89,12 @@ |
||
89 | 89 | { |
90 | 90 | if (! \is_object($configuredInstance)) { |
91 | 91 | throw new InvalidConfigException( |
92 | - \sprintf( |
|
93 | - 'The return value of the configure callable must be an instance of %s got %s', |
|
94 | - $className, |
|
95 | - \gettype($configuredInstance) |
|
96 | - ) |
|
97 | - ); |
|
92 | + \sprintf( |
|
93 | + 'The return value of the configure callable must be an instance of %s got %s', |
|
94 | + $className, |
|
95 | + \gettype($configuredInstance) |
|
96 | + ) |
|
97 | + ); |
|
98 | 98 | } |
99 | 99 | |
100 | 100 | $instanceClassName = (new \ReflectionClass($configuredInstance))->name; |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | $givenParameters = \array_keys($config); |
72 | 72 | |
73 | 73 | foreach ($requiredParameters as $requiredParameter) { |
74 | - if (! \in_array($requiredParameter, $givenParameters, true)) { |
|
74 | + if ( ! \in_array($requiredParameter, $givenParameters, true)) { |
|
75 | 75 | throw new InvalidConfigException( |
76 | 76 | "The parameter '{$requiredParameter}' is required for {$className}" |
77 | 77 | ); |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | */ |
88 | 88 | private function validateConfiguredInstance($configuredInstance, string $className) |
89 | 89 | { |
90 | - if (! \is_object($configuredInstance)) { |
|
90 | + if ( ! \is_object($configuredInstance)) { |
|
91 | 91 | throw new InvalidConfigException( |
92 | 92 | \sprintf( |
93 | 93 | 'The return value of the configure callable must be an instance of %s got %s', |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | |
96 | 96 | return $this->mapConfigurations( |
97 | 97 | $handlerConfigs, |
98 | - function ($handlerClass, $handlerConfig) { |
|
98 | + function($handlerClass, $handlerConfig) { |
|
99 | 99 | $formatter = $this->getFormatterFromHandlerConfig($handlerConfig); |
100 | 100 | $processors = $this->getProcessorsFromHandlerConfig($handlerConfig); |
101 | 101 | |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | |
127 | 127 | return $this->mapConfigurations( |
128 | 128 | $processorConfigs, |
129 | - function ($processor, $config) { |
|
129 | + function($processor, $config) { |
|
130 | 130 | if (\is_callable($processor)) { |
131 | 131 | return $processor; |
132 | 132 | } |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | */ |
147 | 147 | private function mapConfigurations(array $config, callable $mapFunction): array |
148 | 148 | { |
149 | - return collect($config)->map(function ($configValue, $configKey) use ($mapFunction) { |
|
149 | + return collect($config)->map(function($configValue, $configKey) use ($mapFunction) { |
|
150 | 150 | // In case the key is int assume that just the configurable class name has been given |
151 | 151 | // and supply empty configurations. |
152 | 152 | if (\is_int($configKey)) { |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | if (isset($handlerConfig['formatter'])) { |
172 | 172 | return $this->mapConfigurations( |
173 | 173 | $handlerConfig['formatter'], |
174 | - function ($formatterClass, $formatterConfig) { |
|
174 | + function($formatterClass, $formatterConfig) { |
|
175 | 175 | return $this->formatterFactory->make($formatterClass, $formatterConfig); |
176 | 176 | } |
177 | 177 | )[0]; |