Skip to content

Commit 34cbd3e

Browse files
wouterjnicolas-grekas
authored andcommitted
[Components] Convert to native return types
1 parent d61a8ff commit 34cbd3e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+118
-409
lines changed

Bundle/Bundle.php

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -34,27 +34,19 @@ abstract class Bundle implements BundleInterface
3434
*/
3535
protected $container;
3636

37-
/**
38-
* @return void
39-
*/
40-
public function boot()
37+
public function boot(): void
4138
{
4239
}
4340

44-
/**
45-
* @return void
46-
*/
47-
public function shutdown()
41+
public function shutdown(): void
4842
{
4943
}
5044

5145
/**
5246
* This method can be overridden to register compilation passes,
5347
* other extensions, ...
54-
*
55-
* @return void
5648
*/
57-
public function build(ContainerBuilder $container)
49+
public function build(ContainerBuilder $container): void
5850
{
5951
}
6052

@@ -121,10 +113,7 @@ final public function getName(): string
121113
return $this->name;
122114
}
123115

124-
/**
125-
* @return void
126-
*/
127-
public function registerCommands(Application $application)
116+
public function registerCommands(Application $application): void
128117
{
129118
}
130119

Bundle/BundleInterface.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,5 @@ public function getNamespace(): string;
6767
*/
6868
public function getPath(): string;
6969

70-
/**
71-
* @return void
72-
*/
73-
public function setContainer(?ContainerInterface $container);
70+
public function setContainer(?ContainerInterface $container): void;
7471
}

CacheClearer/CacheClearerInterface.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ interface CacheClearerInterface
2020
{
2121
/**
2222
* Clears any caches necessary.
23-
*
24-
* @return void
2523
*/
26-
public function clear(string $cacheDir);
24+
public function clear(string $cacheDir): void;
2725
}

CacheClearer/Psr6CacheClearer.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,7 @@ public function clearPool(string $name): bool
5757
return $this->pools[$name]->clear();
5858
}
5959

60-
/**
61-
* @return void
62-
*/
63-
public function clear(string $cacheDir)
60+
public function clear(string $cacheDir): void
6461
{
6562
foreach ($this->pools as $pool) {
6663
$pool->clear();

CacheWarmer/CacheWarmer.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,7 @@
1818
*/
1919
abstract class CacheWarmer implements CacheWarmerInterface
2020
{
21-
/**
22-
* @return void
23-
*/
24-
protected function writeCacheFile(string $file, $content)
21+
protected function writeCacheFile(string $file, $content): void
2522
{
2623
$tmpFile = @tempnam(\dirname($file), basename($file));
2724
if (false !== @file_put_contents($tmpFile, $content) && @rename($tmpFile, $file)) {

CacheWarmer/CacheWarmerInterface.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ interface CacheWarmerInterface extends WarmableInterface
2525
*
2626
* A warmer should return true if the cache can be
2727
* generated incrementally and on-demand.
28-
*
29-
* @return bool
3028
*/
31-
public function isOptional();
29+
public function isOptional(): bool;
3230
}

CacheWarmer/WarmableInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ interface WarmableInterface
2323
*
2424
* @return string[] A list of classes or files to preload on PHP 7.4+
2525
*/
26-
public function warmUp(string $cacheDir);
26+
public function warmUp(string $cacheDir): array;
2727
}

DataCollector/DataCollector.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ protected function cloneVar(mixed $var): Data
5858
/**
5959
* @return callable[] The casters to add to the cloner
6060
*/
61-
protected function getCasters()
61+
protected function getCasters(): array
6262
{
6363
$casters = [
6464
'*' => function ($v, array $a, Stub $s, $isNested) {
@@ -82,10 +82,7 @@ public function __sleep(): array
8282
return ['data'];
8383
}
8484

85-
/**
86-
* @return void
87-
*/
88-
public function __wakeup()
85+
public function __wakeup(): void
8986
{
9087
}
9188

DataCollector/DataCollectorInterface.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,11 @@ interface DataCollectorInterface extends ResetInterface
2424
{
2525
/**
2626
* Collects data for the given Request and Response.
27-
*
28-
* @return void
2927
*/
30-
public function collect(Request $request, Response $response, \Throwable $exception = null);
28+
public function collect(Request $request, Response $response, \Throwable $exception = null): void;
3129

3230
/**
3331
* Returns the name of the collector.
34-
*
35-
* @return string
3632
*/
37-
public function getName();
33+
public function getName(): string;
3834
}

DataCollector/LateDataCollectorInterface.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ interface LateDataCollectorInterface
2020
{
2121
/**
2222
* Collects data as late as possible.
23-
*
24-
* @return void
2523
*/
26-
public function lateCollect();
24+
public function lateCollect(): void;
2725
}

0 commit comments

Comments
 (0)