Skip to content

Commit e2b2e5a

Browse files
committed
Added more parameter type declarations.
1 parent 90e3da4 commit e2b2e5a

File tree

69 files changed

+118
-142
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+118
-142
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/BrowserKit/Cookie.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ public static function fromString(string $cookie, string $url = null)
196196
);
197197
}
198198

199-
private static function parseDate($dateValue)
199+
private static function parseDate(string $dateValue): ?string
200200
{
201201
// trim single quotes around date if present
202202
if (($length = \strlen($dateValue)) > 1 && "'" === $dateValue[0] && "'" === $dateValue[$length - 1]) {
@@ -213,6 +213,8 @@ private static function parseDate($dateValue)
213213
if (false !== $date = date_create($dateValue, new \DateTimeZone('GMT'))) {
214214
return $date->format('U');
215215
}
216+
217+
return null;
216218
}
217219

218220
/**

src/Symfony/Component/BrowserKit/CookieJar.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,9 @@ public function clear()
103103
/**
104104
* Updates the cookie jar from a response Set-Cookie headers.
105105
*
106-
* @param array $setCookies Set-Cookie headers from an HTTP response
107-
* @param string $uri The base URL
106+
* @param string[] $setCookies Set-Cookie headers from an HTTP response
108107
*/
109-
public function updateFromSetCookie(array $setCookies, $uri = null)
108+
public function updateFromSetCookie(array $setCookies, string $uri = null)
110109
{
111110
$cookies = [];
112111

@@ -131,8 +130,6 @@ public function updateFromSetCookie(array $setCookies, $uri = null)
131130

132131
/**
133132
* Updates the cookie jar from a Response object.
134-
*
135-
* @param string $uri The base URL
136133
*/
137134
public function updateFromResponse(Response $response, string $uri = null)
138135
{

src/Symfony/Component/Config/Definition/ArrayNode.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -332,11 +332,9 @@ protected function normalizeValue($value)
332332
/**
333333
* Remaps multiple singular values to a single plural value.
334334
*
335-
* @param array $value The source values
336-
*
337335
* @return array The remapped values
338336
*/
339-
protected function remapXml($value)
337+
protected function remapXml(array $value)
340338
{
341339
foreach ($this->xmlRemappings as list($singular, $plural)) {
342340
if (!isset($value[$singular])) {

src/Symfony/Component/Config/Definition/Dumper/XmlReferenceDumper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function dump(ConfigurationInterface $configuration, string $namespace =
3131
return $this->dumpNode($configuration->getConfigTreeBuilder()->buildTree(), $namespace);
3232
}
3333

34-
public function dumpNode(NodeInterface $node, $namespace = null)
34+
public function dumpNode(NodeInterface $node, string $namespace = null)
3535
{
3636
$this->reference = '';
3737
$this->writeNode($node, 0, true, $namespace);

src/Symfony/Component/Config/Definition/Dumper/YamlReferenceDumper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function dump(ConfigurationInterface $configuration)
3333
return $this->dumpNode($configuration->getConfigTreeBuilder()->buildTree());
3434
}
3535

36-
public function dumpAtPath(ConfigurationInterface $configuration, $path)
36+
public function dumpAtPath(ConfigurationInterface $configuration, string $path)
3737
{
3838
$rootNode = $node = $configuration->getConfigTreeBuilder()->buildTree();
3939

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