@@ -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 | } |
@@ -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 | } |
@@ -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]; |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | $handlers = $channelConfiguration['handlers'] ?? []; |
| 100 | 100 | $processors = $channelConfiguration['processors'] ?? []; |
| 101 | 101 | |
| 102 | - $this->loggerRegistry->registerLogChannel($channelName, function () use ($channelName, $handlers, $processors) { |
|
| 102 | + $this->loggerRegistry->registerLogChannel($channelName, function() use ($channelName, $handlers, $processors) { |
|
| 103 | 103 | return $this->monologFactory->make($channelName, $handlers, $processors); |
| 104 | 104 | }); |
| 105 | 105 | } |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | */ |
| 111 | 111 | private function registerPsrLogger() |
| 112 | 112 | { |
| 113 | - $this->loggerRegistry->registerPsrLogger(function () { |
|
| 113 | + $this->loggerRegistry->registerPsrLogger(function() { |
|
| 114 | 114 | return $this->getLogger($this->getMainChannel()); |
| 115 | 115 | }); |
| 116 | 116 | } |
@@ -69,7 +69,7 @@ |
||
| 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 | } |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | { |
| 34 | 34 | $serviceName = $this->getLoggerAlias($channelName); |
| 35 | 35 | |
| 36 | - Yii::$container->setSingleton($serviceName, function () use ($channelName, $loggerCreationCallable) { |
|
| 36 | + Yii::$container->setSingleton($serviceName, function() use ($channelName, $loggerCreationCallable) { |
|
| 37 | 37 | return $loggerCreationCallable($channelName); |
| 38 | 38 | }); |
| 39 | 39 | } |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | */ |
| 46 | 46 | public function registerPsrLogger(callable $loggerCreationCallable) |
| 47 | 47 | { |
| 48 | - Yii::$container->setSingleton(LoggerInterface::class, function () use ($loggerCreationCallable) { |
|
| 48 | + Yii::$container->setSingleton(LoggerInterface::class, function() use ($loggerCreationCallable) { |
|
| 49 | 49 | return $loggerCreationCallable(); |
| 50 | 50 | }); |
| 51 | 51 | } |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | */ |
| 55 | 55 | public function export() |
| 56 | 56 | { |
| 57 | - $this->getMessages()->each(function (Yii2LogMessage $message) { |
|
| 57 | + $this->getMessages()->each(function(Yii2LogMessage $message) { |
|
| 58 | 58 | $this->logger->log($message->getPsr3LogLevel(), $message->getMessage(), $message->getContext()); |
| 59 | 59 | }); |
| 60 | 60 | } |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | */ |
| 72 | 72 | private function getMessages(): Collection |
| 73 | 73 | { |
| 74 | - return collect($this->messages)->map(function ($message) { |
|
| 74 | + return collect($this->messages)->map(function($message) { |
|
| 75 | 75 | return new Yii2LogMessage($message); |
| 76 | 76 | }); |
| 77 | 77 | } |
@@ -18,7 +18,7 @@ |
||
| 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; |