Skip to content

Commit 963887b

Browse files
authored
Update examples (#279)
1 parent 91d6888 commit 963887b

6 files changed

+2
-57
lines changed

examples/composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
"name": "company/wordpress-project",
33
"description": "WordPress project.",
44
"require": {
5-
"php": "^7.1"
5+
"php": "^7.4 || ^8.0"
66
},
77
"require-dev": {
8-
"szepeviktor/phpstan-wordpress": "^0.6.0"
8+
"szepeviktor/phpstan-wordpress": "^2.0"
99
},
1010
"config": {
1111
"optimize-autoloader": true

examples/fix-callable.php

Lines changed: 0 additions & 9 deletions
This file was deleted.

examples/fix-parse_url.php

Lines changed: 0 additions & 7 deletions
This file was deleted.

examples/fix-wpdb.php

Lines changed: 0 additions & 7 deletions
This file was deleted.

examples/impure-have-functions.stub

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,5 @@
11
<?php
22

3-
/**
4-
* Whether current WordPress query has results to loop over.
5-
*
6-
* @return bool
7-
* @phpstan-impure
8-
*/
9-
function have_posts()
10-
{
11-
}
12-
13-
class WP_Query
14-
{
15-
/**
16-
* Determines whether there are more posts available in the loop.
17-
*
18-
* @return bool True if posts are available, false if end of loop.
19-
* @phpstan-impure
20-
*/
21-
public function have_posts()
22-
{
23-
}
24-
}
25-
263
/**
274
* ACF have_rows()
285
*

examples/phpstan-full.neon

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,6 @@ parameters:
2626
ignoreErrors:
2727
# Uses func_get_args()
2828
- '#^Function apply_filters(_ref_array)? invoked with [34567] parameters, 2 required\.$#'
29-
# Fixed in WordPress 5.3
30-
#- '#^Function do_action(_ref_array)? invoked with [3456] parameters, 1-2 required\.$#'
31-
#- '#^Function current_user_can invoked with 2 parameters, 1 required\.$#'
32-
#- '#^Function add_query_arg invoked with [123] parameters?, 0 required\.$#'
33-
#- '#^Function wp_sprintf invoked with [23456] parameters, 1 required\.$#'
34-
#- '#^Function add_post_type_support invoked with [345] parameters, 2 required\.$#'
35-
#- '#^Function ((get|add)_theme_support|current_theme_supports) invoked with [2345] parameters, 1 required\.$#'
36-
# Fixed in WordPress 5.2 - https://core.trac.wordpress.org/ticket/43304
37-
#- '/^Parameter #2 \$deprecated of function load_plugin_textdomain expects string, false given\.$/'
3829
# WP-CLI accepts a class name as callable
3930
- '/^Parameter #2 \$callable of static method WP_CLI::add_command\(\) expects callable\(\): mixed, \S+ given\.$/'
4031
# Please consider commenting ignores: issue URL or reason for ignoring

0 commit comments

Comments
 (0)