Skip to content

[TwigBundle] add parameter type declarations where possible #32775

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Symfony/Bridge/Twig/Command/LintCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ private function getFilesInfo(array $filenames)
return $filesInfo;
}

protected function findFiles($filename)
protected function findFiles(string $filename)
{
if (is_file($filename)) {
return [$filename];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function __construct(ContainerInterface $container, iterable $iterator)
/**
* {@inheritdoc}
*/
public function warmUp($cacheDir)
public function warmUp(string $cacheDir)
{
if (null === $this->twig) {
$this->twig = $this->container->get('twig');
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Bundle/TwigBundle/Command/LintCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ protected function configure()
;
}

protected function findFiles($filename)
protected function findFiles(string $filename)
{
if (0 === strpos($filename, '@')) {
$dir = $this->getApplication()->getKernel()->locateResource($filename);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function __construct(HttpKernelInterface $kernel, $controller, ErrorRende
$this->errorRenderer = $errorRenderer;
}

public function previewErrorPageAction(Request $request, $code)
public function previewErrorPageAction(Request $request, int $code)
{
$exception = FlattenException::createFromThrowable(new \Exception('Something has intentionally gone wrong.'), $code, ['X-Debug' => false]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ private function getBundleTemplatePaths(ContainerBuilder $container, array $conf
return $bundleHierarchy;
}

private function normalizeBundleName($name)
private function normalizeBundleName(string $name)
{
if ('Bundle' === substr($name, -6)) {
$name = substr($name, 0, -6);
Expand Down
4 changes: 2 additions & 2 deletions src/Symfony/Bundle/TwigBundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
"php": "^7.2.9",
"symfony/config": "^4.4|^5.0",
"symfony/error-renderer": "^4.4|^5.0",
"symfony/twig-bridge": "^4.4|^5.0",
"symfony/twig-bridge": "^5.0",
"symfony/http-foundation": "^4.4|^5.0",
"symfony/http-kernel": "^4.4|^5.0",
"symfony/http-kernel": "^5.0",
"symfony/polyfill-ctype": "~1.8",
"twig/twig": "^2.10"
},
Expand Down