diff --git a/src/Symfony/Bridge/Twig/Command/DebugCommand.php b/src/Symfony/Bridge/Twig/Command/DebugCommand.php index fa142d381e..17bbd845b2 100644 --- a/src/Symfony/Bridge/Twig/Command/DebugCommand.php +++ b/src/Symfony/Bridge/Twig/Command/DebugCommand.php @@ -234,7 +234,7 @@ EOF } } - private function displayGeneralJson(SymfonyStyle $io, $filter) + private function displayGeneralJson(SymfonyStyle $io, ?string $filter) { $decorated = $io->isDecorated(); $types = ['functions', 'filters', 'tests', 'globals']; @@ -288,7 +288,7 @@ EOF return $loaderPaths; } - private function getMetadata($type, $entity) + private function getMetadata(string $type, $entity) { if ('globals' === $type) { return $entity; @@ -344,7 +344,7 @@ EOF } } - private function getPrettyMetadata($type, $entity, $decorated) + private function getPrettyMetadata(string $type, $entity, bool $decorated) { if ('tests' === $type) { return ''; diff --git a/src/Symfony/Bridge/Twig/Command/LintCommand.php b/src/Symfony/Bridge/Twig/Command/LintCommand.php index 9ea2ff7eb6..5f066874e8 100644 --- a/src/Symfony/Bridge/Twig/Command/LintCommand.php +++ b/src/Symfony/Bridge/Twig/Command/LintCommand.php @@ -118,7 +118,7 @@ EOF throw new RuntimeException(sprintf('File or directory "%s" is not readable', $filename)); } - private function validate($template, $file) + private function validate(string $template, $file) { $realLoader = $this->twig->getLoader(); try { @@ -136,7 +136,7 @@ EOF return ['template' => $template, 'file' => $file, 'valid' => true]; } - private function display(InputInterface $input, OutputInterface $output, SymfonyStyle $io, $files) + private function display(InputInterface $input, OutputInterface $output, SymfonyStyle $io, array $files) { switch ($input->getOption('format')) { case 'txt': @@ -148,7 +148,7 @@ EOF } } - private function displayTxt(OutputInterface $output, SymfonyStyle $io, $filesInfo) + private function displayTxt(OutputInterface $output, SymfonyStyle $io, array $filesInfo) { $errors = 0; @@ -170,7 +170,7 @@ EOF return min($errors, 1); } - private function displayJson(OutputInterface $output, $filesInfo) + private function displayJson(OutputInterface $output, array $filesInfo) { $errors = 0; @@ -189,7 +189,7 @@ EOF return min($errors, 1); } - private function renderException(OutputInterface $output, $template, Error $exception, $file = null) + private function renderException(OutputInterface $output, string $template, Error $exception, string $file = null) { $line = $exception->getTemplateLine(); @@ -212,7 +212,7 @@ EOF } } - private function getContext($template, $line, $context = 3) + private function getContext(string $template, int $line, int $context = 3) { $lines = explode("\n", $template); diff --git a/src/Symfony/Bridge/Twig/DataCollector/TwigDataCollector.php b/src/Symfony/Bridge/Twig/DataCollector/TwigDataCollector.php index b7d059daea..b766bd99bd 100644 --- a/src/Symfony/Bridge/Twig/DataCollector/TwigDataCollector.php +++ b/src/Symfony/Bridge/Twig/DataCollector/TwigDataCollector.php @@ -147,7 +147,7 @@ class TwigDataCollector extends DataCollector implements LateDataCollectorInterf return $this->profile; } - private function getComputedData($index) + private function getComputedData(string $index) { if (null === $this->computed) { $this->computed = $this->computeData($this->getProfile()); diff --git a/src/Symfony/Bridge/Twig/NodeVisitor/TranslationDefaultDomainNodeVisitor.php b/src/Symfony/Bridge/Twig/NodeVisitor/TranslationDefaultDomainNodeVisitor.php index 04b68ef6be..836a343948 100644 --- a/src/Symfony/Bridge/Twig/NodeVisitor/TranslationDefaultDomainNodeVisitor.php +++ b/src/Symfony/Bridge/Twig/NodeVisitor/TranslationDefaultDomainNodeVisitor.php @@ -116,7 +116,7 @@ class TranslationDefaultDomainNodeVisitor extends AbstractNodeVisitor /** * @return bool */ - private function isNamedArguments($arguments) + private function isNamedArguments(Node $arguments) { foreach ($arguments as $name => $node) { if (!\is_int($name)) {