add parameter type declarations where possible

This commit is contained in:
Christian Flothmann 2019-07-27 12:14:41 +02:00
parent be50e2e177
commit 4dd3c549c8
6 changed files with 7 additions and 7 deletions

View File

@ -107,7 +107,7 @@ EOF
return $filesInfo; return $filesInfo;
} }
protected function findFiles($filename) protected function findFiles(string $filename)
{ {
if (is_file($filename)) { if (is_file($filename)) {
return [$filename]; return [$filename];

View File

@ -38,7 +38,7 @@ class TemplateCacheWarmer implements CacheWarmerInterface, ServiceSubscriberInte
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function warmUp($cacheDir) public function warmUp(string $cacheDir)
{ {
if (null === $this->twig) { if (null === $this->twig) {
$this->twig = $this->container->get('twig'); $this->twig = $this->container->get('twig');

View File

@ -42,7 +42,7 @@ EOF
; ;
} }
protected function findFiles($filename) protected function findFiles(string $filename)
{ {
if (0 === strpos($filename, '@')) { if (0 === strpos($filename, '@')) {
$dir = $this->getApplication()->getKernel()->locateResource($filename); $dir = $this->getApplication()->getKernel()->locateResource($filename);

View File

@ -37,7 +37,7 @@ class PreviewErrorController
$this->errorRenderer = $errorRenderer; $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]); $exception = FlattenException::createFromThrowable(new \Exception('Something has intentionally gone wrong.'), $code, ['X-Debug' => false]);

View File

@ -170,7 +170,7 @@ class TwigExtension extends Extension
return $bundleHierarchy; return $bundleHierarchy;
} }
private function normalizeBundleName($name) private function normalizeBundleName(string $name)
{ {
if ('Bundle' === substr($name, -6)) { if ('Bundle' === substr($name, -6)) {
$name = substr($name, 0, -6); $name = substr($name, 0, -6);

View File

@ -19,9 +19,9 @@
"php": "^7.2.9", "php": "^7.2.9",
"symfony/config": "^4.4|^5.0", "symfony/config": "^4.4|^5.0",
"symfony/error-renderer": "^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-foundation": "^4.4|^5.0",
"symfony/http-kernel": "^4.4|^5.0", "symfony/http-kernel": "^5.0",
"symfony/polyfill-ctype": "~1.8", "symfony/polyfill-ctype": "~1.8",
"twig/twig": "^2.10" "twig/twig": "^2.10"
}, },