Skip to content

Commit d7463c8

Browse files
author
Philippe Segatori
committed
[Http-Kernel][5.0] Add type-hints
1 parent 8172d0f commit d7463c8

33 files changed

+85
-173
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 ($this->debug) {
5452
$collectedLogs = [];

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ interface WarmableInterface
2020
{
2121
/**
2222
* Warms up the cache.
23-
*
24-
* @param string $cacheDir The cache directory
2523
*/
26-
public function warmUp($cacheDir);
24+
public function warmUp(string $cacheDir);
2725
}

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ interface ArgumentResolverInterface
2424
/**
2525
* Returns the arguments to pass to the controller.
2626
*
27-
* @param Request $request
2827
* @param callable $controller
2928
*
3029
* @return array An array of arguments to pass to the controller

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/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));

src/Symfony/Component/HttpKernel/EventListener/ExceptionListener.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,7 @@ public static function getSubscribedEvents(): array
103103
];
104104
}
105105

106-
/**
107-
* Logs an exception.
108-
*
109-
* @param \Exception $exception The \Exception instance
110-
* @param string $message The error message to log
111-
*/
112-
protected function logException(\Exception $exception, $message)
106+
protected function logException(\Exception $exception, string $message)
113107
{
114108
if (null !== $this->logger) {
115109
if (!$exception instanceof HttpExceptionInterface || $exception->getStatusCode() >= 500) {

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