Skip to content

Commit 34b8c76

Browse files
wouterjnicolas-grekas
authored andcommitted
Add missing return types and enforce return types on all methods
1 parent a68a9f1 commit 34b8c76

File tree

4 files changed

+15
-9
lines changed

4 files changed

+15
-9
lines changed

Command/AbstractConfigCommand.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828
*/
2929
abstract class AbstractConfigCommand extends ContainerDebugCommand
3030
{
31+
/**
32+
* @return void
33+
*/
3134
protected function listBundles(OutputInterface|StyleInterface $output)
3235
{
3336
$title = 'Available registered bundles with their extension alias if available';
@@ -63,14 +66,14 @@ protected function listNonBundleExtensions(OutputInterface|StyleInterface $outpu
6366
$bundleExtensions = [];
6467
foreach ($kernel->getBundles() as $bundle) {
6568
if ($extension = $bundle->getContainerExtension()) {
66-
$bundleExtensions[\get_class($extension)] = true;
69+
$bundleExtensions[$extension::class] = true;
6770
}
6871
}
6972

7073
$extensions = $this->getContainerBuilder($kernel)->getExtensions();
7174

7275
foreach ($extensions as $alias => $extension) {
73-
if (isset($bundleExtensions[\get_class($extension)])) {
76+
if (isset($bundleExtensions[$extension::class])) {
7477
continue;
7578
}
7679
$rows[] = [$alias];
@@ -156,6 +159,9 @@ protected function findExtension(string $name): ExtensionInterface
156159
throw new LogicException($message);
157160
}
158161

162+
/**
163+
* @return void
164+
*/
159165
public function validateConfiguration(ExtensionInterface $extension, mixed $configuration)
160166
{
161167
if (!$configuration) {

DataCollector/RouterDataCollector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
*/
2323
class RouterDataCollector extends BaseRouterDataCollector
2424
{
25-
public function guessRoute(Request $request, mixed $controller)
25+
public function guessRoute(Request $request, mixed $controller): string
2626
{
2727
if (\is_array($controller)) {
2828
$controller = $controller[0];

DependencyInjection/Configuration.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1864,7 +1864,7 @@ private function addHttpClientSection(ArrayNodeDefinition $rootNode, callable $e
18641864
->normalizeKeys(false)
18651865
->variablePrototype()->end()
18661866
->end()
1867-
->append($this->addHttpClientRetrySection())
1867+
->append($this->createHttpClientRetrySection())
18681868
->end()
18691869
->end()
18701870
->scalarNode('mock_response_factory')
@@ -2012,7 +2012,7 @@ private function addHttpClientSection(ArrayNodeDefinition $rootNode, callable $e
20122012
->normalizeKeys(false)
20132013
->variablePrototype()->end()
20142014
->end()
2015-
->append($this->addHttpClientRetrySection())
2015+
->append($this->createHttpClientRetrySection())
20162016
->end()
20172017
->end()
20182018
->end()
@@ -2022,7 +2022,7 @@ private function addHttpClientSection(ArrayNodeDefinition $rootNode, callable $e
20222022
;
20232023
}
20242024

2025-
private function addHttpClientRetrySection()
2025+
private function createHttpClientRetrySection(): ArrayNodeDefinition
20262026
{
20272027
$root = new NodeBuilder();
20282028

@@ -2226,7 +2226,7 @@ private function addWebhookSection(ArrayNodeDefinition $rootNode, callable $enab
22262226
;
22272227
}
22282228

2229-
private function addRemoteEventSection(ArrayNodeDefinition $rootNode, callable $enableIfStandalone)
2229+
private function addRemoteEventSection(ArrayNodeDefinition $rootNode, callable $enableIfStandalone): void
22302230
{
22312231
$rootNode
22322232
->children()

DependencyInjection/FrameworkExtension.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2831,7 +2831,7 @@ private function registerNotifierConfiguration(array $config, ContainerBuilder $
28312831
}
28322832
}
28332833

2834-
private function registerWebhookConfiguration(array $config, ContainerBuilder $container, PhpFileLoader $loader)
2834+
private function registerWebhookConfiguration(array $config, ContainerBuilder $container, PhpFileLoader $loader): void
28352835
{
28362836
if (!class_exists(WebhookController::class)) {
28372837
throw new LogicException('Webhook support cannot be enabled as the component is not installed. Try running "composer require symfony/webhook".');
@@ -2852,7 +2852,7 @@ private function registerWebhookConfiguration(array $config, ContainerBuilder $c
28522852
$controller->replaceArgument(1, new Reference($config['message_bus']));
28532853
}
28542854

2855-
private function registerRemoteEventConfiguration(array $config, ContainerBuilder $container, PhpFileLoader $loader)
2855+
private function registerRemoteEventConfiguration(array $config, ContainerBuilder $container, PhpFileLoader $loader): void
28562856
{
28572857
if (!class_exists(RemoteEvent::class)) {
28582858
throw new LogicException('RemoteEvent support cannot be enabled as the component is not installed. Try running "composer require symfony/remote-event".');

0 commit comments

Comments
 (0)