Skip to content

Commit 772c6bb

Browse files
committed
Added more parameter type declarations.
1 parent b64fdb7 commit 772c6bb

File tree

6 files changed

+13
-9
lines changed

6 files changed

+13
-9
lines changed

src/Symfony/Bridge/Doctrine/DataCollector/DoctrineDataCollector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ private function sanitizeQueries(string $connectionName, array $queries)
126126
return $queries;
127127
}
128128

129-
private function sanitizeQuery(string $connectionName, $query)
129+
private function sanitizeQuery(string $connectionName, array $query): array
130130
{
131131
$query['explainable'] = true;
132132
if (null === $query['params']) {

src/Symfony/Bridge/Monolog/Formatter/ConsoleFormatter.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ public function format(array $record)
133133
/**
134134
* @internal
135135
*/
136-
public function echoLine($line, $depth, $indentPad)
136+
public function echoLine(string $line, int $depth, string $indentPad)
137137
{
138138
if (-1 !== $depth) {
139139
fwrite($this->outputBuffer, $line);
@@ -143,7 +143,7 @@ public function echoLine($line, $depth, $indentPad)
143143
/**
144144
* @internal
145145
*/
146-
public function castObject($v, array $a, Stub $s, $isNested)
146+
public function castObject($v, array $a, Stub $s, bool $isNested)
147147
{
148148
if ($this->options['multiline']) {
149149
return $a;
@@ -180,7 +180,7 @@ private function replacePlaceHolder(array $record)
180180
return $record;
181181
}
182182

183-
private function dumpData($data, $colors = null)
183+
private function dumpData($data, bool $colors = null): string
184184
{
185185
if (null === $this->dumper) {
186186
return '';

src/Symfony/Bridge/Twig/Command/LintCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,13 @@ protected function findFiles(string $filename)
118118
throw new RuntimeException(sprintf('File or directory "%s" is not readable', $filename));
119119
}
120120

121-
private function validate(string $template, $file)
121+
private function validate(string $template, string $file): array
122122
{
123123
$realLoader = $this->twig->getLoader();
124124
try {
125-
$temporaryLoader = new ArrayLoader([(string) $file => $template]);
125+
$temporaryLoader = new ArrayLoader([$file => $template]);
126126
$this->twig->setLoader($temporaryLoader);
127-
$nodeTree = $this->twig->parse($this->twig->tokenize(new Source($template, (string) $file)));
127+
$nodeTree = $this->twig->parse($this->twig->tokenize(new Source($template, $file)));
128128
$this->twig->compile($nodeTree);
129129
$this->twig->setLoader($realLoader);
130130
} catch (Error $e) {

src/Symfony/Bundle/FrameworkBundle/CacheWarmer/AbstractPhpFileCacheWarmer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ protected function warmUpPhpArrayAdapter(PhpArrayAdapter $phpArrayAdapter, array
7272
/**
7373
* @internal
7474
*/
75-
final protected function ignoreAutoloadException($class, \Exception $exception)
75+
final protected function ignoreAutoloadException(string $class, \Exception $exception)
7676
{
7777
try {
7878
ClassExistenceResource::throwOnRequiredClass($class, $exception);

src/Symfony/Bundle/FrameworkBundle/Command/AbstractConfigCommand.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Symfony\Component\Config\Definition\ConfigurationInterface;
1515
use Symfony\Component\Console\Exception\LogicException;
1616
use Symfony\Component\Console\Helper\Table;
17+
use Symfony\Component\Console\Output\OutputInterface;
1718
use Symfony\Component\Console\Style\StyleInterface;
1819
use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
1920

@@ -26,6 +27,9 @@
2627
*/
2728
abstract class AbstractConfigCommand extends ContainerDebugCommand
2829
{
30+
/**
31+
* @param OutputInterface|StyleInterface $output
32+
*/
2933
protected function listBundles($output)
3034
{
3135
$title = 'Available registered bundles with their extension alias if available';

src/Symfony/Component/Config/Resource/ClassExistenceResource.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public function __sleep(): array
128128
*
129129
* @internal
130130
*/
131-
public static function throwOnRequiredClass($class, \Exception $previous = null)
131+
public static function throwOnRequiredClass(string $class, \Exception $previous = null)
132132
{
133133
// If the passed class is the resource being checked, we shouldn't throw.
134134
if (null === $previous && self::$autoloadedClass === $class) {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy