Skip to content

Commit 9c63be4

Browse files
derrabusnicolas-grekas
authored andcommitted
[Config] fix return type declarations
1 parent 05fe553 commit 9c63be4

File tree

4 files changed

+24
-9
lines changed

4 files changed

+24
-9
lines changed

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,13 @@ public function setNormalizeKeys($normalizeKeys)
3838
}
3939

4040
/**
41-
* Normalizes keys between the different configuration formats.
41+
* {@inheritdoc}
4242
*
4343
* Namely, you mostly have foo_bar in YAML while you have foo-bar in XML.
4444
* After running this method, all keys are normalized to foo_bar.
4545
*
4646
* If you have a mixed key like foo-bar_moo, it will not be altered.
4747
* The key will also not be altered if the target key already exists.
48-
*
49-
* @param mixed $value
50-
*
51-
* @return array The value with normalized keys
5248
*/
5349
protected function preNormalize($value)
5450
{

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

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,21 +49,37 @@ public function __construct($name, NodeInterface $parent = null)
4949
$this->parent = $parent;
5050
}
5151

52+
/**
53+
* @param string $key
54+
*/
5255
public function setAttribute($key, $value)
5356
{
5457
$this->attributes[$key] = $value;
5558
}
5659

60+
/**
61+
* @param string $key
62+
*
63+
* @return mixed
64+
*/
5765
public function getAttribute($key, $default = null)
5866
{
5967
return isset($this->attributes[$key]) ? $this->attributes[$key] : $default;
6068
}
6169

70+
/**
71+
* @param string $key
72+
*
73+
* @return bool
74+
*/
6275
public function hasAttribute($key)
6376
{
6477
return isset($this->attributes[$key]);
6578
}
6679

80+
/**
81+
* @return array
82+
*/
6783
public function getAttributes()
6884
{
6985
return $this->attributes;
@@ -74,6 +90,9 @@ public function setAttributes(array $attributes)
7490
$this->attributes = $attributes;
7591
}
7692

93+
/**
94+
* @param string $key
95+
*/
7796
public function removeAttribute($key)
7897
{
7998
unset($this->attributes[$key]);
@@ -92,7 +111,7 @@ public function setInfo($info)
92111
/**
93112
* Returns info message.
94113
*
95-
* @return string The info text
114+
* @return string|null The info text
96115
*/
97116
public function getInfo()
98117
{
@@ -112,7 +131,7 @@ public function setExample($example)
112131
/**
113132
* Retrieves the example configuration for this node.
114133
*
115-
* @return string|array The example
134+
* @return string|array|null The example
116135
*/
117136
public function getExample()
118137
{

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function setKeyAttribute($attribute, $remove = true)
7878
/**
7979
* Retrieves the name of the attribute which value should be used as key.
8080
*
81-
* @return string The name of the attribute
81+
* @return string|null The name of the attribute
8282
*/
8383
public function getKeyAttribute()
8484
{

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ public static function loadFile($file, $schemaOrCallable = null)
152152
* @param \DOMElement $element A \DOMElement instance
153153
* @param bool $checkPrefix Check prefix in an element or an attribute name
154154
*
155-
* @return array A PHP array
155+
* @return mixed
156156
*/
157157
public static function convertDomElementToArray(\DOMElement $element, $checkPrefix = true)
158158
{

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