@@ -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 | |
@@ -150,25 +150,25 @@ discard block |
||
| 150 | 150 | IWidgetSettingsBuilder::class => WidgetSettingsBuilder::class, |
| 151 | 151 | IWidthMeasurerFactory::class => WidthMeasurerFactory::class, |
| 152 | 152 | |
| 153 | - ISettingsProvider::class => static function (ContainerInterface $container): ISettingsProvider { |
|
| 153 | + ISettingsProvider::class => static function(ContainerInterface $container): ISettingsProvider { |
|
| 154 | 154 | return $container->get(ISettingsProviderBuilder::class)->build(); |
| 155 | 155 | }, |
| 156 | - IDriver::class => static function (ContainerInterface $container): IDriver { |
|
| 156 | + IDriver::class => static function(ContainerInterface $container): IDriver { |
|
| 157 | 157 | return $container->get(IDriverFactory::class)->getDriver(); |
| 158 | 158 | }, |
| 159 | - IDriverLinker::class => static function (ContainerInterface $container): IDriverLinker { |
|
| 159 | + IDriverLinker::class => static function(ContainerInterface $container): IDriverLinker { |
|
| 160 | 160 | return $container->get(IDriverLinkerFactory::class)->getDriverLinker(); |
| 161 | 161 | }, |
| 162 | - IDriverSettings::class => static function (ContainerInterface $container): IDriverSettings { |
|
| 162 | + IDriverSettings::class => static function(ContainerInterface $container): IDriverSettings { |
|
| 163 | 163 | return $container->get(ISettingsProvider::class)->getDriverSettings(); |
| 164 | 164 | }, |
| 165 | - IIntervalNormalizer::class => static function (ContainerInterface $container): IIntervalNormalizer { |
|
| 165 | + IIntervalNormalizer::class => static function(ContainerInterface $container): IIntervalNormalizer { |
|
| 166 | 166 | return $container->get(IIntervalNormalizerFactory::class)->create(); |
| 167 | 167 | }, |
| 168 | - ILoop::class => static function (ContainerInterface $container): ILoop { |
|
| 168 | + ILoop::class => static function(ContainerInterface $container): ILoop { |
|
| 169 | 169 | return $container->get(ILoopFactory::class)->getLoop(); |
| 170 | 170 | }, |
| 171 | - ILoopProbeFactory::class => static function (): never { |
|
| 171 | + ILoopProbeFactory::class => static function(): never { |
|
| 172 | 172 | throw new DomainException( |
| 173 | 173 | sprintf( |
| 174 | 174 | 'Service for id [%s] is not available in this context.', |
@@ -176,10 +176,10 @@ discard block |
||
| 176 | 176 | ) |
| 177 | 177 | ); |
| 178 | 178 | }, |
| 179 | - ILoopProbe::class => static function (ContainerInterface $container): ILoopProbe { |
|
| 179 | + ILoopProbe::class => static function(ContainerInterface $container): ILoopProbe { |
|
| 180 | 180 | return $container->get(ILoopProbeFactory::class)->getProbe(); |
| 181 | 181 | }, |
| 182 | - ILoopSettingsFactory::class => static function (ContainerInterface $container): ILoopSettingsFactory { |
|
| 182 | + ILoopSettingsFactory::class => static function(ContainerInterface $container): ILoopSettingsFactory { |
|
| 183 | 183 | $loopProbe = null; |
| 184 | 184 | $signalProcessingProbe = null; |
| 185 | 185 | try { |
@@ -192,38 +192,38 @@ discard block |
||
| 192 | 192 | ); |
| 193 | 193 | } |
| 194 | 194 | }, |
| 195 | - ISignalProcessingProbe::class => static function (ContainerInterface $container): ISignalProcessingProbe { |
|
| 195 | + ISignalProcessingProbe::class => static function(ContainerInterface $container): ISignalProcessingProbe { |
|
| 196 | 196 | return $container->get(ISignalProcessingProbeFactory::class)->getProbe(); |
| 197 | 197 | }, |
| 198 | 198 | ISignalProcessingProbeFactory::class => SignalProcessingProbeFactory::class, |
| 199 | - IResourceStream::class => static function (ContainerInterface $container): IResourceStream { |
|
| 199 | + IResourceStream::class => static function(ContainerInterface $container): IResourceStream { |
|
| 200 | 200 | /** @var ISettingsProvider $provider */ |
| 201 | 201 | $provider = $container->get(ISettingsProvider::class); |
| 202 | 202 | return new ResourceStream($provider->getTerminalSettings()->getOutputStream()); |
| 203 | 203 | }, |
| 204 | - ITerminalProbeFactory::class => static function (): ITerminalProbeFactory { |
|
| 204 | + ITerminalProbeFactory::class => static function(): ITerminalProbeFactory { |
|
| 205 | 205 | return new TerminalProbeFactory( |
| 206 | 206 | new ArrayObject([ |
| 207 | 207 | NativeTerminalProbe::class, |
| 208 | 208 | ]), |
| 209 | 209 | ); |
| 210 | 210 | }, |
| 211 | - ITerminalSettingsFactory::class => static function (ContainerInterface $container |
|
| 211 | + ITerminalSettingsFactory::class => static function(ContainerInterface $container |
|
| 212 | 212 | ): ITerminalSettingsFactory { |
| 213 | 213 | $terminalProbe = $container->get(ITerminalProbeFactory::class)->getProbe(); |
| 214 | 214 | |
| 215 | 215 | return new TerminalSettingsFactory($terminalProbe); |
| 216 | 216 | }, |
| 217 | - IWidthMeasurer::class => static function (ContainerInterface $container): IWidthMeasurer { |
|
| 217 | + IWidthMeasurer::class => static function(ContainerInterface $container): IWidthMeasurer { |
|
| 218 | 218 | return $container->get(IWidthMeasurerFactory::class)->create(); |
| 219 | 219 | }, |
| 220 | - OptionNormalizerMode::class => static function (ContainerInterface $container): OptionNormalizerMode { |
|
| 220 | + OptionNormalizerMode::class => static function(ContainerInterface $container): OptionNormalizerMode { |
|
| 221 | 221 | return $container->get(ISettingsProvider::class)->getAuxSettings()->getOptionNormalizerMode(); |
| 222 | 222 | }, |
| 223 | - OptionCursor::class => static function (ContainerInterface $container): OptionCursor { |
|
| 223 | + OptionCursor::class => static function(ContainerInterface $container): OptionCursor { |
|
| 224 | 224 | return $container->get(ISettingsProvider::class)->getTerminalSettings()->getOptionCursor(); |
| 225 | 225 | }, |
| 226 | - OptionStyleMode::class => static function (ContainerInterface $container): OptionStyleMode { |
|
| 226 | + OptionStyleMode::class => static function(ContainerInterface $container): OptionStyleMode { |
|
| 227 | 227 | return $container->get(ISettingsProvider::class)->getTerminalSettings()->getOptionStyleMode(); |
| 228 | 228 | }, |
| 229 | 229 | ]; |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | |
| 16 | 16 | $definitions->bind( |
| 17 | 17 | ILoopProbeFactory::class, |
| 18 | - static function (): ILoopProbeFactory { |
|
| 18 | + static function(): ILoopProbeFactory { |
|
| 19 | 19 | return new LoopProbeFactory(probes()); |
| 20 | 20 | }, |
| 21 | 21 | ); |
@@ -47,12 +47,12 @@ |
||
| 47 | 47 | // Automatically run loop at end of program, unless already started or stopped explicitly. |
| 48 | 48 | // @codeCoverageIgnoreStart |
| 49 | 49 | $hasRun = false; |
| 50 | - EventLoop::defer(static function () use (&$hasRun): void { |
|
| 50 | + EventLoop::defer(static function() use (&$hasRun): void { |
|
| 51 | 51 | $hasRun = true; |
| 52 | 52 | }); |
| 53 | 53 | |
| 54 | 54 | $stopped = &self::$stopped; |
| 55 | - register_shutdown_function(static function () use (&$hasRun, &$stopped): void { |
|
| 55 | + register_shutdown_function(static function() use (&$hasRun, &$stopped): void { |
|
| 56 | 56 | // Don't run if we're coming from a fatal error (uncaught exception). |
| 57 | 57 | if (self::error()) { |
| 58 | 58 | return; |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | ); |
| 20 | 20 | $definitions->bind( |
| 21 | 21 | ITerminalProbeFactory::class, |
| 22 | - static function (): ITerminalProbeFactory { |
|
| 22 | + static function(): ITerminalProbeFactory { |
|
| 23 | 23 | return new TerminalProbeFactory( |
| 24 | 24 | new ArrayObject([ |
| 25 | 25 | SymfonyTerminalProbe::class, |
@@ -130,7 +130,7 @@ |
||
| 130 | 130 | public function wrap(Closure $callback): Closure |
| 131 | 131 | { |
| 132 | 132 | return |
| 133 | - function (mixed ...$args) use ($callback): void { |
|
| 133 | + function(mixed ...$args) use ($callback): void { |
|
| 134 | 134 | $this->eraseAll(); |
| 135 | 135 | $callback(...$args); |
| 136 | 136 | $this->render(); |
@@ -16,7 +16,7 @@ |
||
| 16 | 16 | use Ansi8ColorTableTrait; |
| 17 | 17 | |
| 18 | 18 | /** @var array<string,int>|null */ |
| 19 | - protected static ?array $colors = null; |
|
| 19 | + protected static ? array $colors = null; |
|
| 20 | 20 | |
| 21 | 21 | /** @return array<string,int> */ |
| 22 | 22 | protected static function getColors(): array |
@@ -125,7 +125,7 @@ |
||
| 125 | 125 | return 0; |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | - return (int)((round($b / 255) << 2) | (round($g / 255) << 1) | round($r / 255)); |
|
| 128 | + return (int)((round($b / 255) << 2)|(round($g / 255) << 1)|round($r / 255)); |
|
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | protected function getSaturation(int $r, int $g, int $b): int |
@@ -8,22 +8,22 @@ |
||
| 8 | 8 | trait Ansi8ColorTableTrait |
| 9 | 9 | { |
| 10 | 10 | protected const COLORS = [ |
| 11 | - 0 => '#000000', // ansi4 bc color (black) |
|
| 12 | - 1 => '#800000', // ansi4 bc color (red) |
|
| 13 | - 2 => '#008000', // ansi4 bc color (green) |
|
| 14 | - 3 => '#808000', // ansi4 bc color (yellow) |
|
| 15 | - 4 => '#000080', // ansi4 bc color (blue) |
|
| 16 | - 5 => '#800080', // ansi4 bc color (magenta) |
|
| 17 | - 6 => '#008080', // ansi4 bc color (cyan) |
|
| 18 | - 7 => '#c0c0c0', // ansi4 bc color (light white) |
|
| 19 | - 8 => '#808080', // ansi4 bc color (dark gray) |
|
| 20 | - 9 => '#ff0000', // ansi4 bc color (red) |
|
| 21 | - 10 => '#00ff00', // ansi4 bc color (light green) |
|
| 22 | - 11 => '#ffff00', // ansi4 bc color (light yellow) |
|
| 23 | - 12 => '#0000ff', // ansi4 bc color (light blue) |
|
| 24 | - 13 => '#ff00ff', // ansi4 bc color (light magenta) |
|
| 25 | - 14 => '#00ffff', // ansi4 bc color (light cyan) |
|
| 26 | - 15 => '#ffffff', // ansi4 bc color (white) |
|
| 11 | + 0 => '#000000', // ansi4 bc color (black) |
|
| 12 | + 1 => '#800000', // ansi4 bc color (red) |
|
| 13 | + 2 => '#008000', // ansi4 bc color (green) |
|
| 14 | + 3 => '#808000', // ansi4 bc color (yellow) |
|
| 15 | + 4 => '#000080', // ansi4 bc color (blue) |
|
| 16 | + 5 => '#800080', // ansi4 bc color (magenta) |
|
| 17 | + 6 => '#008080', // ansi4 bc color (cyan) |
|
| 18 | + 7 => '#c0c0c0', // ansi4 bc color (light white) |
|
| 19 | + 8 => '#808080', // ansi4 bc color (dark gray) |
|
| 20 | + 9 => '#ff0000', // ansi4 bc color (red) |
|
| 21 | + 10 => '#00ff00', // ansi4 bc color (light green) |
|
| 22 | + 11 => '#ffff00', // ansi4 bc color (light yellow) |
|
| 23 | + 12 => '#0000ff', // ansi4 bc color (light blue) |
|
| 24 | + 13 => '#ff00ff', // ansi4 bc color (light magenta) |
|
| 25 | + 14 => '#00ffff', // ansi4 bc color (light cyan) |
|
| 26 | + 15 => '#ffffff', // ansi4 bc color (white) |
|
| 27 | 27 | 16 => '#000000', |
| 28 | 28 | 17 => '#00005f', |
| 29 | 29 | 18 => '#000087', |