Skip to content

Commit

Permalink
Fix unknown constants as default parameter values
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Aug 2, 2020
1 parent 353cb01 commit d3044ee
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"nette/utils": "dev-master as 3.1.99",
"nikic/php-parser": "4.7.0",
"ondram/ci-detector": "^3.4.0",
"ondrejmirtes/better-reflection": "4.3.21",
"ondrejmirtes/better-reflection": "4.3.22",
"phpdocumentor/reflection-docblock": "4.3.4",
"phpstan/phpdoc-parser": "^0.4.8",
"react/child-process": "^0.6.1",
Expand Down
9 changes: 9 additions & 0 deletions tests/PHPStan/Rules/Methods/OverridingMethodRuleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -342,4 +342,13 @@ public function testBug3478(): void
$this->analyse([__DIR__ . '/data/bug-3478.php'], []);
}

public function testBug3629(): void
{
if (!self::$useStaticReflectionProvider) {
$this->markTestSkipped('Test require static reflection.');
}
$this->phpVersionId = PHP_VERSION_ID;
$this->analyse([__DIR__ . '/data/bug-3629.php'], []);
}

}
11 changes: 11 additions & 0 deletions tests/PHPStan/Rules/Methods/data/bug-3629.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

namespace Bug3629;

class HelloWorld extends \Thread
{
public function start(int $options = PTHREADS_INHERIT_ALL)
{
return parent::start($options);
}
}

0 comments on commit d3044ee

Please sign in to comment.