Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentLanglet committed Sep 25, 2024
1 parent 8ba587e commit 8cbbd32
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/Analyser/TypeSpecifierFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use PHPStan\Broker\BrokerFactory;
use PHPStan\DependencyInjection\Container;
use PHPStan\Node\Printer\ExprPrinter;
use PHPStan\Php\PhpVersion;
use PHPStan\Reflection\ReflectionProvider;
use function array_merge;

Expand All @@ -24,6 +25,7 @@ public function create(): TypeSpecifier
$typeSpecifier = new TypeSpecifier(
$this->container->getByType(ExprPrinter::class),
$this->container->getByType(ReflectionProvider::class),
$this->container->getByType(PhpVersion::class),
$this->container->getServicesByTag(self::FUNCTION_TYPE_SPECIFYING_EXTENSION_TAG),
$this->container->getServicesByTag(self::METHOD_TYPE_SPECIFYING_EXTENSION_TAG),
$this->container->getServicesByTag(self::STATIC_METHOD_TYPE_SPECIFYING_EXTENSION_TAG),
Expand Down
5 changes: 3 additions & 2 deletions src/Rules/Functions/RandomIntParametersRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ final class RandomIntParametersRule implements Rule
public function __construct(
private ReflectionProvider $reflectionProvider,
private PhpVersion $phpVersion,
private bool $reportMaybes
) {
private bool $reportMaybes,
)
{
}

public function getNodeType(): string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace PHPStan\Rules\Functions;

use PHPStan\Php\PhpVersion;
use PHPStan\Rules\Rule;
use PHPStan\Testing\RuleTestCase;
use const PHP_INT_SIZE;
Expand All @@ -14,7 +15,7 @@ class RandomIntParametersRuleTest extends RuleTestCase

protected function getRule(): Rule
{
return new RandomIntParametersRule($this->createReflectionProvider(), true);
return new RandomIntParametersRule($this->createReflectionProvider(), new PhpVersion(80000), true);
}

public function testFile(): void
Expand Down

0 comments on commit 8cbbd32

Please sign in to comment.