8000 minor #32276 [HttpKernel] [5.0] Replace docblocks by type-hints (Phil… · symfony/symfony@4bab40b · GitHub
[go: up one dir, main page]

Skip to content

Commit 4bab40b

Browse files
minor #32276 [HttpKernel] [5.0] Replace docblocks by type-hints (Philippe Segatori)
This PR was merged into the 5.0-dev branch. Discussion ---------- [HttpKernel] [5.0] Replace docblocks by type-hints | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | continuation of #24722 and checks for #32179 | License | MIT | Doc PR | N/A This PR replaces docblocks by type hints in the HttpKernel component considering #32179. Some docblocks without valuable information got also removed. <!-- Replace this notice by a short README for your feature/bugfix. This will help people understand your PR and can be used as a start for the documentation. Additionally (see https://symfony.com/roadmap): - Bug fixes must be submitted against the lowest maintained branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too). - Features and deprecations must be submitted against branch 4.4. - Legacy code removals go to the master branch. --> Commits ------- 9e570a2 [Http-Kernel][5.0] Add type-hints
2 parents 86e1321 + 9e570a2 commit 4bab40b

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