@@ -6,8 +6,8 @@ |
||
| 6 | 6 | |
| 7 | 7 | interface IInterval |
| 8 | 8 | { |
| 9 | - final public const MIN_INTERVAL_MILLISECONDS = 10; // 10 milliseconds |
|
| 10 | - final public const MAX_INTERVAL_MILLISECONDS = 900000; // 15 minutes |
|
| 9 | + final public const MIN_INTERVAL_MILLISECONDS = 10; // 10 milliseconds |
|
| 10 | + final public const MAX_INTERVAL_MILLISECONDS = 900000; // 15 minutes |
|
| 11 | 11 | |
| 12 | 12 | public function toMicroseconds(): float; |
| 13 | 13 | |
@@ -52,7 +52,7 @@ |
||
| 52 | 52 | public function wrap(Closure $callback): Closure |
| 53 | 53 | { |
| 54 | 54 | return |
| 55 | - function (mixed ...$args) use ($callback): void { |
|
| 55 | + function(mixed ...$args) use ($callback): void { |
|
| 56 | 56 | $this->erase(); |
| 57 | 57 | $callback(...$args); |
| 58 | 58 | $this->render(); |
@@ -38,8 +38,8 @@ |
||
| 38 | 38 | { |
| 39 | 39 | $this->options = |
| 40 | 40 | new PaletteOptions( |
| 41 | - interval: $this->options->getInterval() ?? 80, |
|
| 42 | - reversed: $this->options->getReversed(), |
|
| 41 | + interval : $this->options->getInterval() ?? 80, |
|
| 42 | + reversed : $this->options->getReversed(), |
|
| 43 | 43 | ); |
| 44 | 44 | |
| 45 | 45 | return parent::getOptions($mode); |
@@ -18,6 +18,6 @@ |
||
| 18 | 18 | |
| 19 | 19 | return (bool)(($error['type'] ?? 0) |
| 20 | 20 | & |
| 21 | - (E_ERROR | E_CORE_ERROR | E_COMPILE_ERROR | E_USER_ERROR | E_RECOVERABLE_ERROR)); |
|
| 21 | + (E_ERROR|E_CORE_ERROR|E_COMPILE_ERROR|E_USER_ERROR|E_RECOVERABLE_ERROR)); |
|
| 22 | 22 | } |
| 23 | 23 | } |
@@ -183,38 +183,38 @@ discard block |
||
| 183 | 183 | IOutput::class => Output::class, |
| 184 | 184 | IBuffer::class => StringBuffer::class, |
| 185 | 185 | IBufferedOutput::class => BufferedOutput::class, |
| 186 | - IResourceStream::class => static function (IContainer $container): IResourceStream { |
|
| 186 | + IResourceStream::class => static function(IContainer $container): IResourceStream { |
|
| 187 | 187 | return |
| 188 | 188 | $container->get(IResourceStreamFactory::class)->create(); |
| 189 | 189 | }, |
| 190 | - NormalizerMode::class => static function (IContainer $container): NormalizerMode { |
|
| 190 | + NormalizerMode::class => static function(IContainer $container): NormalizerMode { |
|
| 191 | 191 | return |
| 192 | 192 | $container->get(IAuxConfig::class)->getNormalizerMode(); |
| 193 | 193 | }, |
| 194 | - ISettingsProvider::class => static function (IContainer $container): ISettingsProvider { |
|
| 194 | + ISettingsProvider::class => static function(IContainer $container): ISettingsProvider { |
|
| 195 | 195 | return $container->get(ISettingsProviderFactory::class)->create(); |
| 196 | 196 | }, |
| 197 | - IConfigProvider::class => static function (IContainer $container): IConfigProvider { |
|
| 197 | + IConfigProvider::class => static function(IContainer $container): IConfigProvider { |
|
| 198 | 198 | return $container->get(IConfigProviderFactory::class)->create(); |
| 199 | 199 | }, |
| 200 | - ILoopProvider::class => static function (IContainer $container): ILoopProvider { |
|
| 200 | + ILoopProvider::class => static function(IContainer $container): ILoopProvider { |
|
| 201 | 201 | return $container->get(ILoopProviderFactory::class)->create(); |
| 202 | 202 | }, |
| 203 | - IDriverProvider::class => static function (IContainer $container): IDriverProvider { |
|
| 203 | + IDriverProvider::class => static function(IContainer $container): IDriverProvider { |
|
| 204 | 204 | return $container->get(IDriverProviderFactory::class)->create(); |
| 205 | 205 | }, |
| 206 | 206 | |
| 207 | 207 | IDriverSetup::class => DriverSetup::class, |
| 208 | - ISignalHandlingSetup::class => static function (IContainer $container): ISignalHandlingSetup { |
|
| 208 | + ISignalHandlingSetup::class => static function(IContainer $container): ISignalHandlingSetup { |
|
| 209 | 209 | return $container->get(ISignalHandlingSetupFactory::class)->create(); |
| 210 | 210 | }, |
| 211 | - IDriverLinker::class => static function (IContainer $container): IDriverLinker { |
|
| 211 | + IDriverLinker::class => static function(IContainer $container): IDriverLinker { |
|
| 212 | 212 | return $container->get(IDriverLinkerFactory::class)->create(); |
| 213 | 213 | }, |
| 214 | - IIntervalNormalizer::class => static function (IContainer $container): IIntervalNormalizer { |
|
| 214 | + IIntervalNormalizer::class => static function(IContainer $container): IIntervalNormalizer { |
|
| 215 | 215 | return $container->get(IIntervalNormalizerFactory::class)->create(); |
| 216 | 216 | }, |
| 217 | - ILoopCreatorClassProvider::class => static function (IContainer $container): ILoopCreatorClassProvider { |
|
| 217 | + ILoopCreatorClassProvider::class => static function(IContainer $container): ILoopCreatorClassProvider { |
|
| 218 | 218 | $creatorClass = |
| 219 | 219 | $container->get(ILoopCreatorClassExtractor::class) |
| 220 | 220 | ->extract( |
@@ -244,28 +244,28 @@ discard block |
||
| 244 | 244 | function configs(): Traversable |
| 245 | 245 | { |
| 246 | 246 | yield from [ |
| 247 | - IConfig::class => static function (IContainer $container): IConfig { |
|
| 247 | + IConfig::class => static function(IContainer $container): IConfig { |
|
| 248 | 248 | return $container->get(IConfigProvider::class)->getConfig(); |
| 249 | 249 | }, |
| 250 | - IDriverConfig::class => static function (IContainer $container): IDriverConfig { |
|
| 250 | + IDriverConfig::class => static function(IContainer $container): IDriverConfig { |
|
| 251 | 251 | return $container->get(IConfig::class)->get(IDriverConfig::class); |
| 252 | 252 | }, |
| 253 | - IOutputConfig::class => static function (IContainer $container): IOutputConfig { |
|
| 253 | + IOutputConfig::class => static function(IContainer $container): IOutputConfig { |
|
| 254 | 254 | return $container->get(IConfig::class)->get(IOutputConfig::class); |
| 255 | 255 | }, |
| 256 | - ILoopConfig::class => static function (IContainer $container): ILoopConfig { |
|
| 256 | + ILoopConfig::class => static function(IContainer $container): ILoopConfig { |
|
| 257 | 257 | return $container->get(IConfig::class)->get(ILoopConfig::class); |
| 258 | 258 | }, |
| 259 | - IAuxConfig::class => static function (IContainer $container): IAuxConfig { |
|
| 259 | + IAuxConfig::class => static function(IContainer $container): IAuxConfig { |
|
| 260 | 260 | return $container->get(IConfig::class)->get(IAuxConfig::class); |
| 261 | 261 | }, |
| 262 | - IWidgetConfig::class => static function (IContainer $container): IWidgetConfig { |
|
| 262 | + IWidgetConfig::class => static function(IContainer $container): IWidgetConfig { |
|
| 263 | 263 | return $container->get(IConfig::class)->get(IWidgetConfig::class); |
| 264 | 264 | }, |
| 265 | - IRootWidgetConfig::class => static function (IContainer $container): IRootWidgetConfig { |
|
| 265 | + IRootWidgetConfig::class => static function(IContainer $container): IRootWidgetConfig { |
|
| 266 | 266 | return $container->get(IConfig::class)->get(IRootWidgetConfig::class); |
| 267 | 267 | }, |
| 268 | - RunMethodMode::class => static function (IContainer $container): RunMethodMode { |
|
| 268 | + RunMethodMode::class => static function(IContainer $container): RunMethodMode { |
|
| 269 | 269 | return $container->get(IAuxConfig::class)->getRunMethodMode(); |
| 270 | 270 | }, |
| 271 | 271 | ]; |
@@ -357,19 +357,19 @@ discard block |
||
| 357 | 357 | function detectors(): Traversable |
| 358 | 358 | { |
| 359 | 359 | yield from [ |
| 360 | - ILoopSupportDetector::class => static function (IContainer $container): LoopSupportDetector { |
|
| 360 | + ILoopSupportDetector::class => static function(IContainer $container): LoopSupportDetector { |
|
| 361 | 361 | return |
| 362 | 362 | new LoopSupportDetector( |
| 363 | 363 | $container->get(ILoopCreatorClassProvider::class)->getCreatorClass(), |
| 364 | 364 | ); |
| 365 | 365 | }, |
| 366 | - ISignalHandlingSupportDetector::class => static function (): SignalHandlingSupportDetector { |
|
| 366 | + ISignalHandlingSupportDetector::class => static function(): SignalHandlingSupportDetector { |
|
| 367 | 367 | return |
| 368 | 368 | new SignalHandlingSupportDetector( |
| 369 | 369 | Probes::load(ISignalHandlingProbe::class) |
| 370 | 370 | ); |
| 371 | 371 | }, |
| 372 | - IColorSupportDetector::class => static function (): IColorSupportDetector { |
|
| 372 | + IColorSupportDetector::class => static function(): IColorSupportDetector { |
|
| 373 | 373 | return |
| 374 | 374 | new ColorSupportDetector( |
| 375 | 375 | Probes::load(IColorSupportProbe::class) |
@@ -384,7 +384,7 @@ discard block |
||
| 384 | 384 | function substitutes(): Traversable |
| 385 | 385 | { |
| 386 | 386 | yield from [ |
| 387 | - IWidgetSettingsSolver::class => static function (): IWidgetSettingsSolver { |
|
| 387 | + IWidgetSettingsSolver::class => static function(): IWidgetSettingsSolver { |
|
| 388 | 388 | return new class implements IWidgetSettingsSolver { |
| 389 | 389 | public function solve(): IWidgetSettings |
| 390 | 390 | { |
@@ -398,7 +398,7 @@ discard block |
||
| 398 | 398 | } |
| 399 | 399 | }; |
| 400 | 400 | }, |
| 401 | - IRootWidgetConfigFactory::class => static function (): IRootWidgetConfigFactory { |
|
| 401 | + IRootWidgetConfigFactory::class => static function(): IRootWidgetConfigFactory { |
|
| 402 | 402 | return |
| 403 | 403 | new class implements IRootWidgetConfigFactory { |
| 404 | 404 | public function create( |
@@ -25,8 +25,8 @@ discard block |
||
| 25 | 25 | { |
| 26 | 26 | return |
| 27 | 27 | new Container( |
| 28 | - spawnerCreatorCb: $this->getSpawnerCreator(), |
|
| 29 | - definitions: $this->registry->load(), |
|
| 28 | + spawnerCreatorCb : $this->getSpawnerCreator(), |
|
| 29 | + definitions : $this->registry->load(), |
|
| 30 | 30 | ); |
| 31 | 31 | } |
| 32 | 32 | |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | return |
| 36 | 36 | $this->spawnerCreator |
| 37 | 37 | ?? |
| 38 | - static function (ContainerInterface $container): IServiceSpawner { |
|
| 38 | + static function(ContainerInterface $container): IServiceSpawner { |
|
| 39 | 39 | return |
| 40 | 40 | new ServiceSpawner($container); |
| 41 | 41 | }; |
@@ -73,7 +73,7 @@ |
||
| 73 | 73 | */ |
| 74 | 74 | public function createHandler(IDriver $driver, ILoop $loop): Closure |
| 75 | 75 | { |
| 76 | - return static function () use ($driver, $loop): void { |
|
| 76 | + return static function() use ($driver, $loop): void { |
|
| 77 | 77 | $driver->interrupt(); |
| 78 | 78 | $loop->stop(); |
| 79 | 79 | }; |
@@ -45,13 +45,13 @@ |
||
| 45 | 45 | // Automatically run loop at the end of script, unless already started or stopped explicitly. |
| 46 | 46 | // @codeCoverageIgnoreStart |
| 47 | 47 | $hasRun = false; |
| 48 | - EventLoop::defer(static function () use (&$hasRun): void { |
|
| 48 | + EventLoop::defer(static function() use (&$hasRun): void { |
|
| 49 | 49 | $hasRun = true; |
| 50 | 50 | }); |
| 51 | 51 | |
| 52 | 52 | /** @psalm-suppress UnsupportedPropertyReferenceUsage */ |
| 53 | 53 | $stopped = &self::$stopped; |
| 54 | - register_shutdown_function(static function () use (&$hasRun, &$stopped): void { |
|
| 54 | + register_shutdown_function(static function() use (&$hasRun, &$stopped): void { |
|
| 55 | 55 | // Don't run if we're coming from a fatal error (uncaught exception). |
| 56 | 56 | if (self::error()) { // See [889ad594-ca28-4770-bb38-fd5bd8cb1777]. |
| 57 | 57 | return; |