Merge branch '4.4'
* 4.4: add parameter type declarations to private methods
This commit is contained in:
commit
69092dca65
@ -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 '';
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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());
|
||||
|
@ -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)) {
|
||||
|
Reference in New Issue
Block a user