Skip to content

Commit 5b5c09e

Browse files
Merge branch '5.4' into 6.0
* 5.4: Add some missing return types to internal/final classes
2 parents 5e3bd31 + 5531067 commit 5b5c09e

8 files changed

+55
-18
lines changed

CacheWarmer/CacheWarmerAggregate.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,7 @@ public function enableOnlyOptionalWarmers()
4444
}
4545

4646
/**
47-
* Warms up the cache.
48-
*
49-
* @return string[] A list of classes or files to preload on PHP 7.4+
47+
* {@inheritdoc}
5048
*/
5149
public function warmUp(string $cacheDir): array
5250
{

DataCollector/AjaxDataCollector.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
use Symfony\Component\HttpFoundation\Response;
1616

1717
/**
18-
* AjaxDataCollector.
19-
*
2018
* @author Bart van den Burg <bart@burgov.nl>
2119
*
2220
* @final

DataCollector/ConfigDataCollector.php

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,17 @@ public function lateCollect()
9191
$this->data = $this->cloneVar($this->data);
9292
}
9393

94+
/**
95+
* Gets the token.
96+
*/
9497
public function getToken(): ?string
9598
{
9699
return $this->data['token'];
97100
}
98101

102+
/**
103+
* Gets the Symfony version.
104+
*/
99105
public function getSymfonyVersion(): string
100106
{
101107
return $this->data['symfony_version'];
@@ -142,11 +148,17 @@ public function getSymfonyEol(): string
142148
return $this->data['symfony_eol'];
143149
}
144150

151+
/**
152+
* Gets the PHP version.
153+
*/
145154
public function getPhpVersion(): string
146155
{
147156
return $this->data['php_version'];
148157
}
149158

159+
/**
160+
* Gets the PHP version extra part.
161+
*/
150162
public function getPhpVersionExtra(): ?string
151163
{
152164
return $this->data['php_version_extra'] ?? null;
@@ -167,6 +179,9 @@ public function getPhpTimezone(): string
167179
return $this->data['php_timezone'];
168180
}
169181

182+
/**
183+
* Gets the environment.
184+
*/
170185
public function getEnv(): string
171186
{
172187
return $this->data['env'];
@@ -182,16 +197,25 @@ public function isDebug(): bool|string
182197
return $this->data['debug'];
183198
}
184199

200+
/**
201+
* Returns true if the XDebug is enabled.
202+
*/
185203
public function hasXDebug(): bool
186204
{
187205
return $this->data['xdebug_enabled'];
188206
}
189207

208+
/**
209+
* Returns true if APCu is enabled.
210+
*/
190211
public function hasApcu(): bool
191212
{
192213
return $this->data['apcu_enabled'];
193214
}
194215

216+
/**
217+
* Returns true if Zend OPcache is enabled.
218+
*/
195219
public function hasZendOpcache(): bool
196220
{
197221
return $this->data['zend_opcache_enabled'];
@@ -202,6 +226,9 @@ public function getBundles()
202226
return $this->data['bundles'];
203227
}
204228

229+
/**
230+
* Gets the PHP SAPI name.
231+
*/
205232
public function getSapiName(): string
206233
{
207234
return $this->data['sapi_name'];

DataCollector/EventDataCollector.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,31 +70,51 @@ public function lateCollect()
7070
$this->data = $this->cloneVar($this->data);
7171
}
7272

73+
/**
74+
* @see TraceableEventDispatcher
75+
*/
7376
public function setCalledListeners(array $listeners)
7477
{
7578
$this->data['called_listeners'] = $listeners;
7679
}
7780

81+
/**
82+
* @see TraceableEventDispatcher
83+
*/
7884
public function getCalledListeners(): array
7985
{
8086
return $this->data['called_listeners'];
8187
}
8288

89+
/**
90+
* @see TraceableEventDispatcher
91+
*/
8392
public function setNotCalledListeners(array $listeners)
8493
{
8594
$this->data['not_called_listeners'] = $listeners;
8695
}
8796

97+
/**
98+
* @see TraceableEventDispatcher
99+
*/
88100
public function getNotCalledListeners(): array
89101
{
90102
return $this->data['not_called_listeners'];
91103
}
92104

105+
/**
106+
* @param array $events An array of orphaned events
107+
*
108+
* @see TraceableEventDispatcher
109+
*/
93110
public function setOrphanedEvents(array $events)
94111
{
95112
$this->data['orphaned_events'] = $events;
96113
}
97114

115+
/**
116+
* @see TraceableEventDispatcher
117+
*/
98118
public function getOrphanedEvents(): array
99119
{
100120
return $this->data['orphaned_events'];

DataCollector/ExceptionDataCollector.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@ public function hasException(): bool
4848
}
4949

5050
/**
51-
* Gets the exception.
52-
*
5351
* @return \Exception|FlattenException
5452
*/
5553
public function getException(): \Exception|FlattenException

DataCollector/MemoryDataCollector.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,6 @@ public function getMemoryLimit(): int
6363
return $this->data['memory_limit'];
6464
}
6565

66-
/**
67-
* Updates the memory usage data.
68-
*/
6966
public function updateMemoryUsage()
7067
{
7168
$this->data['memory'] = memory_get_peak_usage(true);

DataCollector/RequestDataCollector.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
*/
3232
class RequestDataCollector extends DataCollector implements EventSubscriberInterface, LateDataCollectorInterface
3333
{
34-
protected $controllers;
34+
private $controllers;
3535
private $sessionUsages = [];
3636
private $requestStack;
3737

@@ -428,11 +428,9 @@ public function collectSessionUsage(): void
428428
}
429429

430430
/**
431-
* Parse a controller.
432-
*
433431
* @return array|string An array of controller data or a simple string
434432
*/
435-
protected function parseController(array|object|string|null $controller): array|string
433+
private function parseController(array|object|string|null $controller): array|string
436434
{
437435
if (\is_string($controller) && str_contains($controller, '::')) {
438436
$controller = explode('::', $controller);

DataCollector/TimeDataCollector.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
*/
2525
class TimeDataCollector extends DataCollector implements LateDataCollectorInterface
2626
{
27-
protected $kernel;
28-
protected $stopwatch;
27+
private $kernel;
28+
private $stopwatch;
2929

3030
public function __construct(KernelInterface $kernel = null, Stopwatch $stopwatch = null)
3131
{
@@ -76,8 +76,6 @@ public function lateCollect()
7676
}
7777

7878
/**
79-
* Sets the request events.
80-
*
8179
* @param StopwatchEvent[] $events The request events
8280
*/
8381
public function setEvents(array $events)
@@ -97,6 +95,9 @@ public function getEvents(): array
9795
return $this->data['events'];
9896
}
9997

98+
/**
99+
* Gets the request elapsed time.
100+
*/
100101
public function getDuration(): float
101102
{
102103
if (!isset($this->data['events']['__section__'])) {

0 commit comments

Comments
 (0)