Skip to content

Commit

Permalink
fix failed test with phpstan 1.10.15
Browse files Browse the repository at this point in the history
  • Loading branch information
schlndh committed Jun 2, 2023
1 parent 3f82e50 commit 5ad8c44
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
"require": {
"php": "^8.1",
"ext-mbstring": "*",
"phpstan/phpstan": "^1.10.12"
"phpstan/phpstan": "^1.10.15"
},
"require-dev": {
"ext-mysqli": "*",
"phpunit/phpunit": "^9.5",
"squizlabs/php_codesniffer": "^3.7",
"slevomat/coding-standard": "~8.11.0",
"slevomat/coding-standard": "~8.12.0",
"phpstan/phpstan-phpunit": "^1.1",
"phpstan/phpstan-deprecation-rules": "^1.1",
"phpstan/phpstan-strict-rules": "^1.5"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ public function testFetchObject(): void
$row = $result->fetch_object(CustomUniversalObjectCrate::class);

if (function_exists('assertType')) {
// The class needs to be registered in universalObjectCratesClasses
// This class is registered in universalObjectCratesClasses
assertType('(' . CustomUniversalObjectCrate::class . '&object{id: string, val: int})|false|null', $row);
}

Expand All @@ -728,9 +728,8 @@ public function testFetchObject(): void
$row = $result->fetch_object(CustomResultClass::class);

if (function_exists('assertType')) {
// This class is not registered in universalObjectCratesClasses, so we can't intersect it with object
// shape.
assertType(CustomResultClass::class . '|false|null', $row);
// This class is NOT registered in universalObjectCratesClasses
assertType('(' . CustomResultClass::class . '&object{id: string, val: int})|false|null', $row);
}

if ($row === null) {
Expand Down

0 comments on commit 5ad8c44

Please sign in to comment.