Skip to content

Commit ca86fc5

Browse files
committed
Added more parameter type declarations.
1 parent 3feb66d commit ca86fc5

File tree

35 files changed

+53
-101
lines changed

35 files changed

+53
-101
lines changed

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

Lines changed: 2 additions & 2 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;

src/Symfony/Component/BrowserKit/CookieJar.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,8 @@ public function clear()
104104
* Updates the cookie jar from a response Set-Cookie headers.
105105
*
106106
* @param string[] $setCookies Set-Cookie headers from an HTTP response
107-
* @param string $uri The base URL
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

src/Symfony/Component/Config/Definition/Exception/InvalidConfigurationException.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,8 @@ public function getPath()
3434

3535
/**
3636
* Adds extra information that is suffixed to the original exception message.
37-
*
38-
* @param string $hint
3937
*/
40-
public function addHint($hint)
38+
public function addHint(string $hint)
4139
{
4240
if (!$this->containsHints) {
4341
$this->message .= "\nHint: ".$hint;

src/Symfony/Component/Config/FileLocator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function __construct($paths = [])
3535
*/
3636
public function locate(string $name, string $currentPath = null, bool $first = true)
3737
{
38-
if ('' == $name) {
38+
if ('' === $name) {
3939
throw new \InvalidArgumentException('An empty file name is not valid to be located.');
4040
}
4141

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) {

src/Symfony/Component/Config/Util/XmlUtils.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ public static function phpize($value)
247247
}
248248
}
249249

250-
protected static function getXmlErrors($internalErrors)
250+
protected static function getXmlErrors(bool $internalErrors)
251251
{
252252
$errors = [];
253253
foreach (libxml_get_errors() as $error) {

src/Symfony/Component/Console/Question/ChoiceQuestion.php

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,9 @@ public function getChoices()
5858
*
5959
* When multiselect is set to true, multiple choices can be answered.
6060
*
61-
* @param bool $multiselect
62-
*
6361
* @return $this
6462
*/
65-
public function setMultiselect($multiselect)
63+
public function setMultiselect(bool $multiselect)
6664
{
6765
$this->multiselect = $multiselect;
6866
$this->setValidator($this->getDefaultValidator());
@@ -93,11 +91,9 @@ public function getPrompt()
9391
/**
9492
* Sets the prompt for choices.
9593
*
96-
* @param string $prompt
97-
*
9894
* @return $this
9995
*/
100-
public function setPrompt($prompt)
96+
public function setPrompt(string $prompt)
10197
{
10298
$this->prompt = $prompt;
10399

@@ -109,11 +105,9 @@ public function setPrompt($prompt)
109105
*
110106
* The error message has a string placeholder (%s) for the invalid value.
111107
*
112-
* @param string $errorMessage
113-
*
114108
* @return $this
115109
*/
116-
public function setErrorMessage($errorMessage)
110+
public function setErrorMessage(string $errorMessage)
117111
{
118112
$this->errorMessage = $errorMessage;
119113
$this->setValidator($this->getDefaultValidator());

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