| Conditions | 1 |
| Paths | 1 |
| Total Lines | 115 |
| Code Lines | 88 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
| 1 | <?php |
||
| 113 | function definitions(): Traversable |
||
| 114 | { |
||
| 115 | yield from [ |
||
| 116 | IAuxSettingsBuilder::class => AuxSettingsBuilder::class, |
||
| 117 | IBufferedOutputBuilder::class => BufferedOutputBuilder::class, |
||
| 118 | IBufferedOutputSingletonFactory::class => BufferedOutputSingletonFactory::class, |
||
| 119 | ICharFrameFactory::class => CharFrameFactory::class, |
||
| 120 | ICharFrameRevolverFactory::class => CharFrameRevolverFactory::class, |
||
| 121 | IConsoleCursorBuilder::class => ConsoleCursorBuilder::class, |
||
| 122 | IConsoleCursorFactory::class => ConsoleCursorFactory::class, |
||
| 123 | ISettingsProviderBuilder::class => SettingsProviderBuilder::class, |
||
| 124 | IDriverLinkerFactory::class => DriverLinkerFactory::class, |
||
| 125 | IDriverBuilder::class => DriverBuilder::class, |
||
| 126 | IDriverOutputBuilder::class => DriverOutputBuilder::class, |
||
| 127 | IDriverOutputFactory::class => DriverOutputFactory::class, |
||
| 128 | IDriverSettingsBuilder::class => DriverSettingsBuilder::class, |
||
| 129 | IDriverSetup::class => DriverSetup::class, |
||
| 130 | IDriverFactory::class => DriverFactory::class, |
||
| 131 | IFrameCollectionFactory::class => FrameCollectionFactory::class, |
||
| 132 | IFrameRevolverBuilder::class => FrameRevolverBuilder::class, |
||
| 133 | IIntegerNormalizerBuilder::class => IntegerNormalizerBuilder::class, |
||
| 134 | IIntervalFactory::class => IntervalFactory::class, |
||
| 135 | IIntervalNormalizerFactory::class => IntervalNormalizerFactory::class, |
||
| 136 | ILoopSetup::class => LoopSetup::class, |
||
| 137 | ILoopSetupBuilder::class => LoopSetupBuilder::class, |
||
| 138 | ILoopSetupFactory::class => LoopSetupFactory::class, |
||
| 139 | ILoopFactory::class => LoopFactory::class, |
||
| 140 | ISpinnerFactory::class => SpinnerFactory::class, |
||
| 141 | IStyleFrameFactory::class => StyleFrameFactory::class, |
||
| 142 | IStyleFrameRevolverFactory::class => StyleFrameRevolverFactory::class, |
||
| 143 | ITimerBuilder::class => TimerBuilder::class, |
||
| 144 | ITimerFactory::class => TimerFactory::class, |
||
| 145 | IWidgetBuilder::class => WidgetBuilder::class, |
||
| 146 | IWidgetFactory::class => WidgetFactory::class, |
||
| 147 | IWidgetSettingsFactory::class => WidgetSettingsFactory::class, |
||
| 148 | IWidgetRevolverBuilder::class => WidgetRevolverBuilder::class, |
||
| 149 | IWidgetRevolverFactory::class => WidgetRevolverFactory::class, |
||
| 150 | IWidgetSettingsBuilder::class => WidgetSettingsBuilder::class, |
||
| 151 | IWidthMeasurerFactory::class => WidthMeasurerFactory::class, |
||
| 152 | |||
| 153 | ISettingsProvider::class => static function (ContainerInterface $container): ISettingsProvider { |
||
| 154 | return $container->get(ISettingsProviderBuilder::class)->build(); |
||
| 155 | }, |
||
| 156 | IDriver::class => static function (ContainerInterface $container): IDriver { |
||
| 157 | return $container->get(IDriverFactory::class)->getDriver(); |
||
| 158 | }, |
||
| 159 | IDriverLinker::class => static function (ContainerInterface $container): IDriverLinker { |
||
| 160 | return $container->get(IDriverLinkerFactory::class)->getDriverLinker(); |
||
| 161 | }, |
||
| 162 | IDriverSettings::class => static function (ContainerInterface $container): IDriverSettings { |
||
| 163 | return $container->get(ISettingsProvider::class)->getDriverSettings(); |
||
| 164 | }, |
||
| 165 | IIntervalNormalizer::class => static function (ContainerInterface $container): IIntervalNormalizer { |
||
| 166 | return $container->get(IIntervalNormalizerFactory::class)->create(); |
||
| 167 | }, |
||
| 168 | ILoop::class => static function (ContainerInterface $container): ILoop { |
||
| 169 | return $container->get(ILoopFactory::class)->getLoop(); |
||
| 170 | }, |
||
| 171 | ILoopProbeFactory::class => static function (): never { |
||
| 172 | throw new DomainException( |
||
| 173 | sprintf( |
||
| 174 | 'Service for id [%s] is not available in this context.', |
||
| 175 | ILoopProbeFactory::class |
||
| 176 | ) |
||
| 177 | ); |
||
| 178 | }, |
||
| 179 | ILoopProbe::class => static function (ContainerInterface $container): ILoopProbe { |
||
| 180 | return $container->get(ILoopProbeFactory::class)->getProbe(); |
||
| 181 | }, |
||
| 182 | ILoopSettingsFactory::class => static function (ContainerInterface $container): ILoopSettingsFactory { |
||
| 183 | $loopProbe = null; |
||
| 184 | $signalProcessingProbe = null; |
||
| 185 | try { |
||
| 186 | $loopProbe = $container->get(ILoopProbeFactory::class)->getProbe(); |
||
| 187 | $signalProcessingProbe = $container->get(ISignalProcessingProbeFactory::class)->getProbe(); |
||
| 188 | } finally { |
||
| 189 | return new LoopSettingsFactory( |
||
| 190 | $loopProbe, |
||
| 191 | $signalProcessingProbe |
||
| 192 | ); |
||
| 193 | } |
||
| 194 | }, |
||
| 195 | ISignalProcessingProbe::class => static function (ContainerInterface $container): ISignalProcessingProbe { |
||
| 196 | return $container->get(ISignalProcessingProbeFactory::class)->getProbe(); |
||
| 197 | }, |
||
| 198 | ISignalProcessingProbeFactory::class => SignalProcessingProbeFactory::class, |
||
| 199 | IResourceStream::class => static function (ContainerInterface $container): IResourceStream { |
||
| 200 | /** @var ISettingsProvider $provider */ |
||
| 201 | $provider = $container->get(ISettingsProvider::class); |
||
| 202 | return new ResourceStream($provider->getTerminalSettings()->getOutputStream()); |
||
| 203 | }, |
||
| 204 | ITerminalProbeFactory::class => static function (): ITerminalProbeFactory { |
||
| 205 | return new TerminalProbeFactory( |
||
| 206 | new ArrayObject([ |
||
| 207 | NativeTerminalProbe::class, |
||
| 208 | ]), |
||
| 209 | ); |
||
| 210 | }, |
||
| 211 | ITerminalSettingsFactory::class => static function (ContainerInterface $container |
||
| 212 | ): ITerminalSettingsFactory { |
||
| 213 | $terminalProbe = $container->get(ITerminalProbeFactory::class)->getProbe(); |
||
| 214 | |||
| 215 | return new TerminalSettingsFactory($terminalProbe); |
||
| 216 | }, |
||
| 217 | IWidthMeasurer::class => static function (ContainerInterface $container): IWidthMeasurer { |
||
| 218 | return $container->get(IWidthMeasurerFactory::class)->create(); |
||
| 219 | }, |
||
| 220 | OptionNormalizerMode::class => static function (ContainerInterface $container): OptionNormalizerMode { |
||
| 221 | return $container->get(ISettingsProvider::class)->getAuxSettings()->getOptionNormalizerMode(); |
||
| 222 | }, |
||
| 223 | OptionCursor::class => static function (ContainerInterface $container): OptionCursor { |
||
| 224 | return $container->get(ISettingsProvider::class)->getTerminalSettings()->getOptionCursor(); |
||
| 225 | }, |
||
| 226 | OptionStyleMode::class => static function (ContainerInterface $container): OptionStyleMode { |
||
| 227 | return $container->get(ISettingsProvider::class)->getTerminalSettings()->getOptionStyleMode(); |
||
| 228 | }, |
||
| 232 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths