-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade phpstan and psalm, add stubs for \Pgsql\* classes in PHP < 8.1
Also prevent psalm from analyzing the actual constant used for tests configuration by feeding it a stub instead, see vimeo/psalm#4024
- Loading branch information
1 parent
35d7922
commit 2932de4
Showing
6 changed files
with
45 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
/** | ||
* Stubs for resource replacing classes introduced in PHP 8.1 | ||
*/ | ||
|
||
namespace Pgsql; | ||
|
||
if (\PHP_VERSION_ID < 80100) { | ||
final class Connection | ||
{ | ||
} | ||
|
||
final class Result | ||
{ | ||
} | ||
|
||
final class Lob | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?php | ||
|
||
// This should prevent psalm from ASSuming something about the constant's value. | ||
// Until https://github.com/vimeo/psalm/issues/4024 is implemented | ||
define('TESTS_SAD_SPIRIT_PG_WRAPPER_CONNECTION_STRING', mt_rand(1, 10) > 5 ? 'a string' : false); |