Skip to content

Commit bf92684

Browse files
Add theme constants to config to address constant.notFound errors
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent d3dd8ec commit bf92684

3 files changed

Lines changed: 16 additions & 48 deletions

File tree

tests/phpstan/base.neon

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,22 @@ parameters:
2525
- ALLOW_SUBDIRECTORY_INSTALL
2626
- AUTH_SALT
2727
- AUTOMATIC_UPDATER_DISABLED
28+
- BACKGROUND_COLOR
29+
- BACKGROUND_IMAGE
2830
- COOKIEPATH
2931
- CUSTOM_TAGS
3032
- DISALLOW_FILE_EDIT
3133
- DISALLOW_UNFILTERED_HTML
3234
- EMPTY_TRASH_DAYS
3335
- ENFORCE_GZIP
3436
- FORCE_SSL_LOGIN
37+
- HEADER_IMAGE
38+
- HEADER_IMAGE_HEIGHT
39+
- HEADER_IMAGE_WIDTH
40+
- HEADER_TEXTCOLOR
3541
- MEDIA_TRASH
3642
- MULTISITE
43+
- NO_HEADER_TEXT
3744
- NOBLOGREDIRECT
3845
- SAVEQUERIES
3946
- SCRIPT_DEBUG

tests/phpstan/baseline.php

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -49,36 +49,6 @@
4949
'count' => 1,
5050
'path' => __DIR__ . '/../../src/wp-admin/themes.php',
5151
];
52-
$ignoreErrors[] = [
53-
'message' => '#^Constant HEADER_IMAGE_HEIGHT not found\\.$#',
54-
'identifier' => 'constant.notFound',
55-
'count' => 1,
56-
'path' => __DIR__ . '/../../src/wp-content/themes/twentyeleven/functions.php',
57-
];
58-
$ignoreErrors[] = [
59-
'message' => '#^Constant HEADER_IMAGE_WIDTH not found\\.$#',
60-
'identifier' => 'constant.notFound',
61-
'count' => 1,
62-
'path' => __DIR__ . '/../../src/wp-content/themes/twentyeleven/functions.php',
63-
];
64-
$ignoreErrors[] = [
65-
'message' => '#^Constant HEADER_TEXTCOLOR not found\\.$#',
66-
'identifier' => 'constant.notFound',
67-
'count' => 2,
68-
'path' => __DIR__ . '/../../src/wp-content/themes/twentyeleven/functions.php',
69-
];
70-
$ignoreErrors[] = [
71-
'message' => '#^Constant HEADER_IMAGE_WIDTH not found\\.$#',
72-
'identifier' => 'constant.notFound',
73-
'count' => 1,
74-
'path' => __DIR__ . '/../../src/wp-content/themes/twentyeleven/header.php',
75-
];
76-
$ignoreErrors[] = [
77-
'message' => '#^Constant HEADER_IMAGE_WIDTH not found\\.$#',
78-
'identifier' => 'constant.notFound',
79-
'count' => 1,
80-
'path' => __DIR__ . '/../../src/wp-content/themes/twentyeleven/showcase.php',
81-
];
8252
$ignoreErrors[] = [
8353
'message' => '#^Function twentyseventeen_edit_link invoked with 1 parameter, 0 required\\.$#',
8454
'identifier' => 'arguments.count',
@@ -97,24 +67,6 @@
9767
'count' => 1,
9868
'path' => __DIR__ . '/../../src/wp-content/themes/twentyseventeen/template-parts/page/content-page.php',
9969
];
100-
$ignoreErrors[] = [
101-
'message' => '#^Constant HEADER_IMAGE_HEIGHT not found\\.$#',
102-
'identifier' => 'constant.notFound',
103-
'count' => 1,
104-
'path' => __DIR__ . '/../../src/wp-content/themes/twentyten/functions.php',
105-
];
106-
$ignoreErrors[] = [
107-
'message' => '#^Constant HEADER_IMAGE_WIDTH not found\\.$#',
108-
'identifier' => 'constant.notFound',
109-
'count' => 1,
110-
'path' => __DIR__ . '/../../src/wp-content/themes/twentyten/functions.php',
111-
];
112-
$ignoreErrors[] = [
113-
'message' => '#^Constant HEADER_IMAGE_WIDTH not found\\.$#',
114-
'identifier' => 'constant.notFound',
115-
'count' => 1,
116-
'path' => __DIR__ . '/../../src/wp-content/themes/twentyten/header.php',
117-
];
11870
$ignoreErrors[] = [
11971
'message' => '#^Function wp_cache_switch_to_blog_fallback invoked with 1 parameter, 0 required\\.$#',
12072
'identifier' => 'arguments.count',

tests/phpstan/bootstrap.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,3 +93,12 @@
9393
define( 'FS_TIMEOUT', 1 );
9494
define( 'FS_CHMOD_DIR', 1 );
9595
define( 'FS_CHMOD_FILE', 1 );
96+
97+
// Theme constants referenced in add_theme_support().
98+
define( 'NO_HEADER_TEXT', false );
99+
define( 'HEADER_IMAGE_WIDTH', 0 );
100+
define( 'HEADER_IMAGE_HEIGHT', 0 );
101+
define( 'HEADER_TEXTCOLOR', '' );
102+
define( 'HEADER_IMAGE', '' );
103+
define( 'BACKGROUND_COLOR', '' );
104+
define( 'BACKGROUND_IMAGE', '' );

0 commit comments

Comments
 (0)