-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add __get and __call for WP_Query (#220)
* Add __get and __call for WP_Query * Fix wp_query test * Add note about void->null conversion * Fix cs * Fix cs
- Loading branch information
Showing
4 changed files
with
28 additions
and
0 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,23 @@ | ||
<?php | ||
|
||
/** | ||
* Note: | ||
* Starting from PHPStan 1.10.49, void types, including void in unions, are | ||
* transformed into null. | ||
* | ||
* @link https://github.com/phpstan/phpstan-src/pull/2778 | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace PhpStubs\WordPress\Core\Tests; | ||
|
||
use WP_Query; | ||
|
||
use function PHPStan\Testing\assertType; | ||
|
||
$wpQuery = new WP_Query(); | ||
|
||
assertType('bool', $wpQuery->query_vars_changed); | ||
assertType('bool|string', $wpQuery->query_vars_hash); | ||
assertType('null', $wpQuery->init_query_flags()); |
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