Skip to content

Commit 9e570a2

Browse files
Philippe Segatorinicolas-grekas
authored andcommitted
[Http-Kernel][5.0] Add type-hints
1 parent 86e1321 commit 9e570a2

37 files changed

+98
-152
lines changed

src/Symfony/Component/HttpKernel/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-
* @param string $cacheDir The cache directory
2523
*/
26-
public function clear($cacheDir);
24+
public function clear(string $cacheDir);
2725
}

src/Symfony/Component/HttpKernel/CacheClearer/ChainCacheClearer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function __construct(iterable $clearers = [])
3030
/**
3131
* {@inheritdoc}
3232
*/
33-
public function clear($cacheDir)
33+
public function clear(string $cacheDir)
3434
{
3535
foreach ($this->clearers as $clearer) {
3636
$clearer->clear($cacheDir);

src/Symfony/Component/HttpKernel/CacheClearer/Psr6CacheClearer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function clearPool($name)
4949
/**
5050
* {@inheritdoc}
5151
*/
52-
public function clear($cacheDir)
52+
public function clear(string $cacheDir)
5353
{
5454
foreach ($this->pools as $pool) {
5555
$pool->clear();

src/Symfony/Component/HttpKernel/CacheWarmer/CacheWarmerAggregate.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,8 @@ public function enableOnlyOptionalWarmers()
4545

4646
/**
4747
* Warms up the cache.
48-
*
49-
* @param string $cacheDir The cache directory
5048
*/
51-
public function warmUp($cacheDir)
49+
public function warmUp(string $cacheDir)
5250
{
5351
if ($collectDeprecations = $this->debug && !\defined('PHPUNIT_COMPOSER_INSTALL')) {
5452
$collectedLogs = [];

src/Symfony/Component/HttpKernel/Controller/ArgumentResolver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function __construct(ArgumentMetadataFactoryInterface $argumentMetadataFa
4343
/**
4444
* {@inheritdoc}
4545
*/
46-
public function getArguments(Request $request, $controller): array
46+
public function getArguments(Request $request, callable $controller): array
4747
{
4848
$arguments = [];
4949

src/Symfony/Component/HttpKernel/Controller/ArgumentResolverInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ interface ArgumentResolverInterface
3030
*
3131
* @throws \RuntimeException When no value could be provided for a required argument
3232
*/
33-
public function getArguments(Request $request, $controller);
33+
public function getArguments(Request $request, callable $controller);
3434
}

src/Symfony/Component/HttpKernel/Controller/ContainerControllerResolver.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function __construct(ContainerInterface $container, LoggerInterface $logg
3232
parent::__construct($logger);
3333
}
3434

35-
protected function createController($controller)
35+
protected function createController(string $controller)
3636
{
3737
if (1 === substr_count($controller, ':')) {
3838
$controller = str_replace(':', '::', $controller);
@@ -45,7 +45,7 @@ protected function createController($controller)
4545
/**
4646
* {@inheritdoc}
4747
*/
48-
protected function instantiateController($class)
48+
protected function instantiateController(string $class)
4949
{
5050
if ($this->container->has($class)) {
5151
return $this->container->get($class);

src/Symfony/Component/HttpKernel/Controller/ControllerResolver.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,9 @@ public function getController(Request $request)
9494
/**
9595
* Returns a callable for the given controller.
9696
*
97-
* @param string $controller A Controller string
98-
*
9997
* @return callable A PHP callable
10098
*/
101-
protected function createController($controller)
99+
protected function createController(string $controller)
102100
{
103101
if (false === strpos($controller, '::')) {
104102
return $this->instantiateController($controller);
@@ -124,11 +122,9 @@ protected function createController($controller)
124122
/**
125123
* Returns an instantiated controller.
126124
*
127-
* @param string $class A class name
128-
*
129125
* @return object
130126
*/
131-
protected function instantiateController($class)
127+
protected function instantiateController(string $class)
132128
{
133129
return new $class();
134130
}

src/Symfony/Component/HttpKernel/Controller/TraceableArgumentResolver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function __construct(ArgumentResolverInterface $resolver, Stopwatch $stop
3131
/**
3232
* {@inheritdoc}
3333
*/
34-
public function getArguments(Request $request, $controller)
34+
public function getArguments(Request $request, callable $controller)
3535
{
3636
$e = $this->stopwatch->start('controller.get_arguments');
3737

src/Symfony/Component/HttpKernel/DependencyInjection/LazyLoadingFragmentHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function __construct(ContainerInterface $container, RequestStack $request
3535
/**
3636
* {@inheritdoc}
3737
*/
38-
public function render($uri, $renderer = 'inline', array $options = [])
38+
public function render($uri, string $renderer = 'inline', array $options = [])
3939
{
4040
if (!isset($this->initialized[$renderer]) && $this->container->has($renderer)) {
4141
$this->addRenderer($this->container->get($renderer));

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