Skip to content

Commit 4c5b17f

Browse files
wouterjnicolas-grekas
authored andcommitted
Add missing return types and enforce return types on all methods
1 parent 7400749 commit 4c5b17f

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

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;

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)) {

Form/DoctrineOrmTypeGuesser.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\Bridge\Doctrine\Form;
1313

1414
use Doctrine\DBAL\Types\Types;
15+
use Doctrine\ORM\Mapping\ClassMetadata;
1516
use Doctrine\ORM\Mapping\ClassMetadataInfo;
1617
use Doctrine\ORM\Mapping\MappingException as LegacyMappingException;
1718
use Doctrine\Persistence\ManagerRegistry;
@@ -151,6 +152,13 @@ public function guessPattern(string $class, string $property): ?ValueGuess
151152
return null;
152153
}
153154

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

0 commit comments

Comments
 (0)