Skip to content

Commit 8cbbd32

Browse files
Fix
1 parent 8ba587e commit 8cbbd32

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

src/Analyser/TypeSpecifierFactory.php

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use PHPStan\Broker\BrokerFactory;
66
use PHPStan\DependencyInjection\Container;
77
use PHPStan\Node\Printer\ExprPrinter;
8+
use PHPStan\Php\PhpVersion;
89
use PHPStan\Reflection\ReflectionProvider;
910
use function array_merge;
1011

@@ -24,6 +25,7 @@ public function create(): TypeSpecifier
2425
$typeSpecifier = new TypeSpecifier(
2526
$this->container->getByType(ExprPrinter::class),
2627
$this->container->getByType(ReflectionProvider::class),
28+
$this->container->getByType(PhpVersion::class),
2729
$this->container->getServicesByTag(self::FUNCTION_TYPE_SPECIFYING_EXTENSION_TAG),
2830
$this->container->getServicesByTag(self::METHOD_TYPE_SPECIFYING_EXTENSION_TAG),
2931
$this->container->getServicesByTag(self::STATIC_METHOD_TYPE_SPECIFYING_EXTENSION_TAG),

src/Rules/Functions/RandomIntParametersRule.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@ final class RandomIntParametersRule implements Rule
2525
public function __construct(
2626
private ReflectionProvider $reflectionProvider,
2727
private PhpVersion $phpVersion,
28-
private bool $reportMaybes
29-
) {
28+
private bool $reportMaybes,
29+
)
30+
{
3031
}
3132

3233
public function getNodeType(): string

tests/PHPStan/Rules/Functions/RandomIntParametersRuleTest.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace PHPStan\Rules\Functions;
44

5+
use PHPStan\Php\PhpVersion;
56
use PHPStan\Rules\Rule;
67
use PHPStan\Testing\RuleTestCase;
78
use const PHP_INT_SIZE;
@@ -14,7 +15,7 @@ class RandomIntParametersRuleTest extends RuleTestCase
1415

1516
protected function getRule(): Rule
1617
{
17-
return new RandomIntParametersRule($this->createReflectionProvider(), true);
18+
return new RandomIntParametersRule($this->createReflectionProvider(), new PhpVersion(80000), true);
1819
}
1920

2021
public function testFile(): void

0 commit comments

Comments
 (0)