Skip to content

Commit

Permalink
Merge pull request #28 from dbrekelmans/support-safe-2
Browse files Browse the repository at this point in the history
Support safe ^2.0
  • Loading branch information
dbrekelmans authored Jan 17, 2022
2 parents 71bd8c1 + 887be75 commit 8a7b88e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
"require": {
"php": "^7.1 || ^8.0",
"phpstan/phpstan": "^1.0",
"thecodingmachine/safe": "^1.0"
"thecodingmachine/safe": "^1.0 || ^2.0"
},
"require-dev": {
"phpunit/phpunit": "^7.5.2",
"phpunit/phpunit": "^7.5.2 || ^8.0",
"php-coveralls/php-coveralls": "^2.1",
"squizlabs/php_codesniffer": "^3.4"
},
Expand Down
12 changes: 5 additions & 7 deletions tests/Rules/CallMethodRuleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use PHPStan\Php\PhpVersion;
use PHPStan\Rules\FunctionCallParametersCheck;
use PHPStan\Rules\Methods\CallMethodsRule;
use PHPStan\Rules\Methods\MethodCallCheck;
use PHPStan\Rules\NullsafeCheck;
use PHPStan\Rules\PhpDoc\UnresolvableTypeHelper;
use PHPStan\Rules\Rule;
Expand All @@ -16,14 +17,11 @@ class CallMethodRuleTest extends RuleTestCase
{
protected function getRule(): Rule
{
$broker = $this->createBroker();
$ruleLevelHelper = new RuleLevelHelper($broker, true, true, true, false);
$reflectionProvider = $this->createReflectionProvider();
$ruleLevelHelper = new RuleLevelHelper($reflectionProvider, true, true, true, false);
return new CallMethodsRule(
$broker,
new FunctionCallParametersCheck($ruleLevelHelper, new NullsafeCheck(), new PhpVersion(PHP_VERSION_ID), new UnresolvableTypeHelper(), true, false, false, false),
$ruleLevelHelper,
true,
true
new MethodCallCheck($reflectionProvider, $ruleLevelHelper, true, true),
new FunctionCallParametersCheck($ruleLevelHelper, new NullsafeCheck(), new PhpVersion(PHP_VERSION_ID), new UnresolvableTypeHelper(), true, false, false, false)
);
}

Expand Down

0 comments on commit 8a7b88e

Please sign in to comment.