Skip to content

Commit

Permalink
Merge branch '4.4'
Browse files Browse the repository at this point in the history
* 4.4:
  add parameter type declarations to private methods
  • Loading branch information
nicolas-grekas committed Aug 2, 2019
2 parents d2e957f + 0a00294 commit bb59bbb
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions Command/DebugCommand.php
Expand Up @@ -234,7 +234,7 @@ private function displayGeneralText(SymfonyStyle $io, string $filter = null)
}
}

private function displayGeneralJson(SymfonyStyle $io, $filter)
private function displayGeneralJson(SymfonyStyle $io, ?string $filter)
{
$decorated = $io->isDecorated();
$types = ['functions', 'filters', 'tests', 'globals'];
Expand Down Expand Up @@ -288,7 +288,7 @@ private function getLoaderPaths(string $name = null): array
return $loaderPaths;
}

private function getMetadata($type, $entity)
private function getMetadata(string $type, $entity)
{
if ('globals' === $type) {
return $entity;
Expand Down Expand Up @@ -344,7 +344,7 @@ private function getMetadata($type, $entity)
}
}

private function getPrettyMetadata($type, $entity, $decorated)
private function getPrettyMetadata(string $type, $entity, bool $decorated)
{
if ('tests' === $type) {
return '';
Expand Down
12 changes: 6 additions & 6 deletions Command/LintCommand.php
Expand Up @@ -118,7 +118,7 @@ protected function findFiles(string $filename)
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 {
Expand All @@ -136,7 +136,7 @@ private function validate($template, $file)
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':
Expand All @@ -148,7 +148,7 @@ private function display(InputInterface $input, OutputInterface $output, Symfony
}
}

private function displayTxt(OutputInterface $output, SymfonyStyle $io, $filesInfo)
private function displayTxt(OutputInterface $output, SymfonyStyle $io, array $filesInfo)
{
$errors = 0;

Expand All @@ -170,7 +170,7 @@ private function displayTxt(OutputInterface $output, SymfonyStyle $io, $filesInf
return min($errors, 1);
}

private function displayJson(OutputInterface $output, $filesInfo)
private function displayJson(OutputInterface $output, array $filesInfo)
{
$errors = 0;

Expand All @@ -189,7 +189,7 @@ private function displayJson(OutputInterface $output, $filesInfo)
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();

Expand All @@ -212,7 +212,7 @@ private function renderException(OutputInterface $output, $template, Error $exce
}
}

private function getContext($template, $line, $context = 3)
private function getContext(string $template, int $line, int $context = 3)
{
$lines = explode("\n", $template);

Expand Down
2 changes: 1 addition & 1 deletion DataCollector/TwigDataCollector.php
Expand Up @@ -147,7 +147,7 @@ public function getProfile()
return $this->profile;
}

private function getComputedData($index)
private function getComputedData(string $index)
{
if (null === $this->computed) {
$this->computed = $this->computeData($this->getProfile());
Expand Down
2 changes: 1 addition & 1 deletion NodeVisitor/TranslationDefaultDomainNodeVisitor.php
Expand Up @@ -116,7 +116,7 @@ public function getPriority()
/**
* @return bool
*/
private function isNamedArguments($arguments)
private function isNamedArguments(Node $arguments)
{
foreach ($arguments as $name => $node) {
if (!\is_int($name)) {
Expand Down

0 comments on commit bb59bbb

Please sign in to comment.