Skip to content

Commit c254243

Browse files
committed
Return null explicitly and specify return type instead of PHPDoc
1 parent 94820ac commit c254243

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/Visitor/Php/BasePHPVisitor.php

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,7 @@ protected function getStringArgument(Node\Expr\MethodCall $node, int $index): ?s
3535
return $label;
3636
}
3737

38-
/**
39-
* @param Node $node
40-
*
41-
* @return string|null
42-
*/
43-
private function getStringValue(Node $node)
38+
private function getStringValue(Node $node): ?string
4439
{
4540
if ($node instanceof Node\Scalar\String_) {
4641
return $node->value;
@@ -49,15 +44,17 @@ private function getStringValue(Node $node)
4944
if ($node instanceof Node\Expr\BinaryOp\Concat) {
5045
$left = $this->getStringValue($node->left);
5146
if (null === $left) {
52-
return;
47+
return null;
5348
}
5449

5550
$right = $this->getStringValue($node->right);
5651
if (null === $right) {
57-
return;
52+
return null;
5853
}
5954

6055
return $left.$right;
6156
}
57+
58+
return null;
6259
}
6360
}

0 commit comments

Comments
 (0)