Skip to content

Commit 585195a

Browse files
wouterjnicolas-grekas
authored andcommitted
Add remaining missing return types to safe methods
1 parent e8b32ea commit 585195a

File tree

3 files changed

+19
-9
lines changed

3 files changed

+19
-9
lines changed

Command/ConfigDebugCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ private function getAvailableBundles(bool $alias): array
237237
return $availableBundles;
238238
}
239239

240-
private function getConfig(ExtensionInterface $extension, ContainerBuilder $container, bool $resolveEnvs = false)
240+
private function getConfig(ExtensionInterface $extension, ContainerBuilder $container, bool $resolveEnvs = false): mixed
241241
{
242242
return $container->resolveEnvPlaceholders(
243243
$container->getParameterBag()->resolveValue(

Console/Descriptor/Descriptor.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,9 @@ abstract protected function describeContainerEnvVars(array $envs, array $options
120120
* Common options are:
121121
* * name: name of listened event
122122
*/
123-
abstract protected function describeEventDispatcherListeners(EventDispatcherInterface $eventDispatcher, array $options = []);
123+
abstract protected function describeEventDispatcherListeners(EventDispatcherInterface $eventDispatcher, array $options = []): void;
124124

125-
abstract protected function describeCallable(mixed $callable, array $options = []);
125+
abstract protected function describeCallable(mixed $callable, array $options = []): void;
126126

127127
protected function formatValue(mixed $value): string
128128
{

Console/Descriptor/MarkdownDescriptor.php

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ protected function describeEventDispatcherListeners(EventDispatcherInterface $ev
336336
}
337337
}
338338

339-
protected function describeCallable(mixed $callable, array $options = [])
339+
protected function describeCallable(mixed $callable, array $options = []): void
340340
{
341341
$string = '';
342342

@@ -359,7 +359,9 @@ protected function describeCallable(mixed $callable, array $options = [])
359359
}
360360
}
361361

362-
return $this->write($string."\n");
362+
$this->write($string."\n");
363+
364+
return;
363365
}
364366

365367
if (\is_string($callable)) {
@@ -375,15 +377,19 @@ protected function describeCallable(mixed $callable, array $options = [])
375377
$string .= "\n- Static: yes";
376378
}
377379

378-
return $this->write($string."\n");
380+
$this->write($string."\n");
381+
382+
return;
379383
}
380384

381385
if ($callable instanceof \Closure) {
382386
$string .= "\n- Type: `closure`";
383387

384388
$r = new \ReflectionFunction($callable);
385389
if (str_contains($r->name, '{closure}')) {
386-
return $this->write($string."\n");
390+
$this->write($string."\n");
391+
392+
return;
387393
}
388394
$string .= "\n".sprintf('- Name: `%s`', $r->name);
389395

@@ -394,14 +400,18 @@ protected function describeCallable(mixed $callable, array $options = [])
394400
}
395401
}
396402

397-
return $this->write($string."\n");
403+
$this->write($string."\n");
404+
405+
return;
398406
}
399407

400408
if (method_exists($callable, '__invoke')) {
401409
$string .= "\n- Type: `object`";
402410
$string .= "\n".sprintf('- Name: `%s`', $callable::class);
403411

404-
return $this->write($string."\n");
412+
$this->write($string."\n");
413+
414+
return;
405415
}
406416

407417
throw new \InvalidArgumentException('Callable is not describable.');

0 commit comments

Comments
 (0)