Skip to content

Commit 7aabe35

Browse files
committed
Fix magic constants as default parameter values
1 parent c2135cb commit 7aabe35

File tree

3 files changed

+28
-1
lines changed

3 files changed

+28
-1
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"nette/utils": "^3.1.1",
2222
"nikic/php-parser": "^4.5.0",
2323
"ondram/ci-detector": "^3.1",
24-
"ondrejmirtes/better-reflection": "^4.3.3",
24+
"ondrejmirtes/better-reflection": "^4.3.4",
2525
"phpdocumentor/type-resolver": "1.0.1",
2626
"phpstan/phpdoc-parser": "^0.4.7",
2727
"react/child-process": "^0.6.1",

tests/PHPStan/Analyser/AnalyserIntegrationTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,12 @@ public function testTwoSameClassesInSingleFile(): void
222222
$this->assertSame(21, $error->getLine());
223223
}
224224

225+
public function testBug3405(): void
226+
{
227+
$errors = $this->runAnalyse(__DIR__ . '/data/bug-3405.php');
228+
$this->assertCount(0, $errors);
229+
}
230+
225231
/**
226232
* @param string $file
227233
* @return \PHPStan\Analyser\Error[]
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
namespace Bug3405;
4+
5+
class Foo
6+
{
7+
8+
public function doFoo(
9+
string $file = __FILE__,
10+
int $line = __LINE__,
11+
string $class = __CLASS__,
12+
string $dir = __DIR__,
13+
string $namespace = __NAMESPACE__,
14+
string $method = __METHOD__,
15+
string $function = __FUNCTION__,
16+
string $trait = __TRAIT__
17+
): void
18+
{
19+
}
20+
21+
}

0 commit comments

Comments
 (0)