Skip to content

Commit b0433f3

Browse files
committed
[Config] Code review changes
- fixed argument and return type hints
1 parent d4d7328 commit b0433f3

File tree

3 files changed

+4
-12
lines changed

3 files changed

+4
-12
lines changed

src/Symfony/Component/Config/Definition/Builder/NodeDefinition.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function __construct(?string $name, NodeParentInterface $parent = null)
4444
$this->name = $name;
4545
}
4646

47-
public function getName()
47+
public function getName(): string
4848
{
4949
return $this->name;
5050
}

src/Symfony/Component/Config/Definition/Builder/NodeFinder.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,9 @@ class NodeFinder
2121
/**
2222
* Finds a node defined by $nodePath within the given $rootNode.
2323
*
24-
* @param string $nodePath The path of the node to find. e.g "doctrine.orm.mappings"
25-
* @param NodeDefinition $rootNode
26-
*
27-
* @return NodeDefinition
24+
* @param string $nodePath The path of the node to find. e.g "doctrine.orm.mappings"
2825
*/
29-
public function find($nodePath, NodeDefinition $rootNode)
26+
public function find(string $nodePath, NodeDefinition $rootNode): NodeDefinition
3027
{
3128
if (!$rootNode instanceof ArrayNodeDefinition) {
3229
if ($nodePath !== $rootNode->getName()) {

src/Symfony/Component/Config/Tests/Definition/Builder/NodeFinderTest.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,7 @@ public function testItShouldHandleComplexConfigurationProbably()
101101
$this->assertNode($instagramAccountsNode, 'accounts', ArrayNodeDefinition::class);
102102
}
103103

104-
/**
105-
* @param NodeDefinition $actualNode
106-
* @param string $expectedName
107-
* @param string $expectedType
108-
*/
109-
private function assertNode(NodeDefinition $actualNode, $expectedName, $expectedType)
104+
private function assertNode(NodeDefinition $actualNode, string $expectedName, string $expectedType): void
110105
{
111106
$this->assertSame($expectedName, $actualNode->getName());
112107
$this->assertInstanceOf($expectedType, $actualNode);

0 commit comments

Comments
 (0)