Skip to content

Commit

Permalink
minor #33159 [FrameworkBundle] Add parameter types from HttpKernel (d…
Browse files Browse the repository at this point in the history
…errabus)

This PR was merged into the 5.0-dev branch.

Discussion
----------

[FrameworkBundle] Add parameter types from HttpKernel

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #32179
| License       | MIT
| Doc PR        | N/A

This PR adds parameter type declarations from HttpKernel classes to FrameworkBundle. We can merge this now or later into 5.1 if we want to keep FrameworkBundle 5.0 compatible with HttpKernel 4.4.

Commits
-------

9408a07 [FrameworkBundle] Add parameter types from HttpKernel.
  • Loading branch information
nicolas-grekas committed Aug 16, 2019
2 parents 23334df + 9408a07 commit 2439837
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 17 deletions.
Expand Up @@ -43,7 +43,7 @@ public function isOptional()
/**
* {@inheritdoc}
*/
public function warmUp($cacheDir)
public function warmUp(string $cacheDir)
{
$arrayAdapter = new ArrayAdapter();

Expand Down
Expand Up @@ -35,11 +35,9 @@ public function __construct(ContainerInterface $container)
}

/**
* Warms up the cache.
*
* @param string $cacheDir The cache directory
* {@inheritdoc}
*/
public function warmUp($cacheDir)
public function warmUp(string $cacheDir)
{
$router = $this->container->get('router');

Expand Down
Expand Up @@ -36,7 +36,7 @@ public function __construct(ContainerInterface $container)
/**
* {@inheritdoc}
*/
public function warmUp($cacheDir)
public function warmUp(string $cacheDir)
{
if (null === $this->translator) {
$this->translator = $this->container->get('translator');
Expand Down
11 changes: 3 additions & 8 deletions src/Symfony/Bundle/FrameworkBundle/HttpCache/HttpCache.php
Expand Up @@ -40,19 +40,14 @@ public function __construct(KernelInterface $kernel, string $cacheDir = null)
}

/**
* Forwards the Request to the backend and returns the Response.
*
* @param bool $raw Whether to catch exceptions or not
* @param Response $entry A Response instance (the stale entry if present, null otherwise)
*
* @return Response A Response instance
* {@inheritdoc}
*/
protected function forward(Request $request, $raw = false, Response $entry = null)
protected function forward(Request $request, bool $catch = false, Response $entry = null)
{
$this->getKernel()->boot();
$this->getKernel()->getContainer()->set('cache', $this);

return parent::forward($request, $raw, $entry);
return parent::forward($request, $catch, $entry);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Bundle/FrameworkBundle/Routing/Router.php
Expand Up @@ -74,7 +74,7 @@ public function getRouteCollection()
/**
* {@inheritdoc}
*/
public function warmUp($cacheDir)
public function warmUp(string $cacheDir)
{
$currentDir = $this->getOption('cache_dir');

Expand Down
Expand Up @@ -88,7 +88,7 @@ public function __construct(ContainerInterface $container, MessageFormatterInter
/**
* {@inheritdoc}
*/
public function warmUp($cacheDir)
public function warmUp(string $cacheDir)
{
// skip warmUp when translator doesn't use cache
if (null === $this->options['cache_dir']) {
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Bundle/FrameworkBundle/composer.json
Expand Up @@ -23,7 +23,7 @@
"symfony/dependency-injection": "^5.0",
"symfony/error-renderer": "^4.4|^5.0",
"symfony/http-foundation": "^4.4|^5.0",
"symfony/http-kernel": "^4.4|^5.0",
"symfony/http-kernel": "^5.0",
"symfony/polyfill-mbstring": "~1.0",
"symfony/filesystem": "^4.4|^5.0",
"symfony/finder": "^4.4|^5.0",
Expand Down

0 comments on commit 2439837

Please sign in to comment.