Skip to content

Commit 8a41670

Browse files
committed
Fix scalar function arguments.
1 parent 8d5aa46 commit 8a41670

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/PhpNodeVisitor.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@ protected static function getValue(Expr $value)
149149

150150
switch ($type) {
151151
case 'Scalar_String':
152-
case 'Scalar_LNumber':
153-
case 'Scalar_DNumber':
152+
case 'Scalar_Int':
153+
case 'Scalar_Float':
154154
return $value->value;
155155
case 'Expr_BinaryOp_Concat':
156156
$values = [];

tests/PhpFunctionsScannerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function testPhpFunctionsExtractor()
2929
$function = array_shift($functions);
3030
$this->assertSame('fn1', $function->getName());
3131
$this->assertSame(3, $function->countArguments());
32-
$this->assertSame(['arg1', 'arg2', null], $function->getArguments());
32+
$this->assertSame(['arg1', 'arg2', 3], $function->getArguments());
3333
$this->assertSame(4, $function->getLine());
3434
$this->assertSame(4, $function->getLastLine());
3535
$this->assertSame($file, $function->getFilename());
@@ -71,7 +71,7 @@ public function testPhpFunctionsExtractor()
7171
$function = array_shift($functions);
7272
$this->assertSame('fn5', $function->getName());
7373
$this->assertSame(2, $function->countArguments());
74-
$this->assertSame([null, null], $function->getArguments());
74+
$this->assertSame([6, 7.5], $function->getArguments());
7575
$this->assertSame(6, $function->getLine());
7676
$this->assertSame(6, $function->getLastLine());
7777
$this->assertSame($file, $function->getFilename());

0 commit comments

Comments
 (0)