Skip to content

Commit 1b10b6f

Browse files
committed
Add all missing return types
1 parent 65fa483 commit 1b10b6f

File tree

17 files changed

+85
-36
lines changed

17 files changed

+85
-36
lines changed

src/Symfony/Bridge/Doctrine/DataCollector/DoctrineDataCollector.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,17 @@ public function reset()
113113
}
114114
}
115115

116+
/**
117+
* @return array
118+
*/
116119
public function getManagers()
117120
{
118121
return $this->data['managers'];
119122
}
120123

124+
/**
125+
* @return array
126+
*/
121127
public function getConnections()
122128
{
123129
return $this->data['connections'];
@@ -131,11 +137,17 @@ public function getQueryCount()
131137
return array_sum(array_map('count', $this->data['queries']));
132138
}
133139

140+
/**
141+
* @return array
142+
*/
134143
public function getQueries()
135144
{
136145
return $this->data['queries'];
137146
}
138147

148+
/**
149+
* @return int
150+
*/
139151
public function getTime()
140152
{
141153
$time = 0;

src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterEventListenersAndSubscribersPass.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ public function __construct(string $connectionsParameter, string $managerTemplat
5353
$this->tagPrefix = $tagPrefix;
5454
}
5555

56+
/**
57+
* @return void
58+
*/
5659
public function process(ContainerBuilder $container)
5760
{
5861
if (!$container->hasParameter($this->connectionsParameter)) {

src/Symfony/Bridge/Doctrine/Form/DoctrineOrmTypeGuesser.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,15 @@ public function guessPattern(string $class, string $property): ?ValueGuess
151151
return null;
152152
}
153153

154+
/**
155+
* @template T of object
156+
*
157+
* @psalm-param class-string<T> $className
158+
*
159+
* @return array|null
160+
*
161+
* @psalm-return array{0:ClassMetadata<T>, 1:string}
162+
*/
154163
protected function getMetadata(string $class)
155164
{
156165
// normalize class name

src/Symfony/Bridge/Monolog/Handler/ConsoleHandler.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,8 @@ private function doHandle(array|LogRecord $record): bool
129129

130130
/**
131131
* Sets the console output to use for printing logs.
132+
*
133+
* @return void
132134
*/
133135
public function setOutput(OutputInterface $output)
134136
{
@@ -148,6 +150,8 @@ public function close(): void
148150
/**
149151
* Before a command is executed, the handler gets activated and the console output
150152
* is set in order to know where to write the logs.
153+
*
154+
* @return void
151155
*/
152156
public function onCommand(ConsoleCommandEvent $event)
153157
{
@@ -161,6 +165,8 @@ public function onCommand(ConsoleCommandEvent $event)
161165

162166
/**
163167
* After a command has been executed, it disables the output.
168+
*
169+
* @return void
164170
*/
165171
public function onTerminate(ConsoleTerminateEvent $event)
166172
{

src/Symfony/Bridge/Monolog/Handler/ServerLogHandler.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,9 @@ private static function nullErrorHandler(): void
130130
{
131131
}
132132

133+
/**
134+
* @return resource
135+
*/
133136
private function createSocket()
134137
{
135138
$socket = stream_socket_client($this->host, $errno, $errstr, 0, \STREAM_CLIENT_CONNECT | \STREAM_CLIENT_ASYNC_CONNECT | \STREAM_CLIENT_PERSISTENT, $this->context);

src/Symfony/Bridge/Twig/DataCollector/TwigDataCollector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ public function getProfile(): Profile
134134
return $this->profile ??= unserialize($this->data['profile'], ['allowed_classes' => ['Twig_Profiler_Profile', Profile::class]]);
135135
}
136136

137-
private function getComputedData(string $index)
137+
private function getComputedData(string $index): mixed
138138
{
139139
$this->computed ??= $this->computeData($this->getProfile());
140140

src/Symfony/Bundle/FrameworkBundle/Command/AbstractConfigCommand.php

Lines changed: 6 additions & 0 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';
@@ -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) {

src/Symfony/Bundle/FrameworkBundle/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];

src/Symfony/Bundle/FrameworkBundle/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(): NodeBuilder
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()

src/Symfony/Bundle/FrameworkBundle/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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy