diff --git a/psalm.xml.dist b/psalm.xml.dist
index 44f67aa..2224d90 100755
--- a/psalm.xml.dist
+++ b/psalm.xml.dist
@@ -11,6 +11,7 @@
+
diff --git a/src/VersionUtils.php b/src/VersionUtils.php
index c9a21d0..9f89ecd 100644
--- a/src/VersionUtils.php
+++ b/src/VersionUtils.php
@@ -8,6 +8,7 @@
abstract class VersionUtils
{
+ /** @param "!="|"<"|"<="|"<>"|"="|"=="|">"|">=" $op */
public static function packageVersionIs(string $package, string $op, string $ref): bool
{
try {
diff --git a/tests/acceptance/Prophecy.feature b/tests/acceptance/Prophecy.feature
index 7fc69c6..5188c85 100644
--- a/tests/acceptance/Prophecy.feature
+++ b/tests/acceptance/Prophecy.feature
@@ -33,7 +33,7 @@ Feature: Prophecy
{
/** @return void */
public function testSomething() {
- $argument = Argument::that(function () {
+ $_argument = Argument::that(function () {
return true;
});
}
@@ -49,7 +49,7 @@ Feature: Prophecy
{
/** @return void */
public function testSomething() {
- $argument = Argument::that(function (int $i) {
+ $_argument = Argument::that(function (int $i) {
return $i > 0;
});
}
@@ -65,7 +65,7 @@ Feature: Prophecy
{
/** @return void */
public function testSomething() {
- $argument = Argument::that(function (int $i, int $j, int $k) {
+ $_argument = Argument::that(function (int $i, int $j, int $k) {
return ($i + $j + $k) > 0;
});
}
@@ -81,7 +81,7 @@ Feature: Prophecy
{
/** @return void */
public function testSomething() {
- $argument = Argument::that(function (): string {
+ $_argument = Argument::that(function (): string {
return 'hello';
});
}
@@ -89,8 +89,8 @@ Feature: Prophecy
"""
When I run Psalm
Then I see these errors
- | Type | Message |
- | InvalidScalarArgument | /Argument 1 of Prophecy\\Argument::that expects callable\(mixed...\):bool, (pure-)?Closure\(\):string\(hello\) provided/ |
+ | Type | Message |
+ | InvalidScalarArgument | /Argument 1 of Prophecy\\Argument::that expects callable\(mixed...\):bool, (pure-)?Closure\(\):(string\(hello\)\|"hello") provided/ |
And I see no other errors
Scenario: prophesize() provided by ProphecyTrait is generic