Skip to content

Commit 2a5bc34

Browse files
committed
style(core): update baseline
1 parent 938310b commit 2a5bc34

File tree

5 files changed

+6
-43
lines changed

5 files changed

+6
-43
lines changed

phpstan-baseline.neon

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,6 @@ parameters:
3030
count: 2
3131
path: src/Optimization/WPQuery.php
3232

33-
-
34-
message: "#^Parameter \\#1 \\$maybeint of function absint expects array\\|bool\\|float\\|int\\|resource\\|string\\|null, mixed given\\.$#"
35-
count: 2
36-
path: src/Optimization/WPQuery.php
37-
3833
-
3934
message: "#^Call to function is_array\\(\\) with array\\{file\\: string, width\\: int, height\\: int, mime\\-type\\: string\\} will always evaluate to true\\.$#"
4035
count: 1

psalm-baseline.xml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
<code><![CDATA[$file]]></code>
1414
</PossiblyInvalidOperand>
1515
<RiskyTruthyFalsyComparison>
16+
<code><![CDATA[empty( $dependency->src )]]></code>
1617
<code><![CDATA[empty( $file )]]></code>
1718
<code><![CDATA[empty( $rootDir )]]></code>
1819
</RiskyTruthyFalsyComparison>
@@ -159,11 +160,6 @@
159160
<code><![CDATA[public function load(): void {]]></code>
160161
</MissingOverrideAttribute>
161162
</file>
162-
<file src="src/Utils/ResourceHints.php">
163-
<MissingOverrideAttribute>
164-
<code><![CDATA[public function load(): void {]]></code>
165-
</MissingOverrideAttribute>
166-
</file>
167163
<file src="src/helper.php">
168164
<MixedAssignment>
169165
<code><![CDATA[$post]]></code>

psalm.xml

Lines changed: 2 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -20,39 +20,6 @@
2020
</ignoreFiles>
2121
</projectFiles>
2222

23-
<issueHandlers>
24-
<TooManyArguments>
25-
<errorLevel type="suppress">
26-
<referencedFunction name="apply_filters"/>
27-
</errorLevel>
28-
</TooManyArguments>
29-
<MissingClosureParamType>
30-
<errorLevel type="suppress">
31-
<directory name="src"/>
32-
</errorLevel>
33-
</MissingClosureParamType>
34-
<MixedReturnStatement>
35-
<errorLevel type="suppress">
36-
<file name="src/helper.php"/>
37-
</errorLevel>
38-
</MixedReturnStatement>
39-
<MixedArgumentTypeCoercion>
40-
<errorLevel type="suppress">
41-
<file name="src/Optimization/Update.php"/>
42-
</errorLevel>
43-
</MixedArgumentTypeCoercion>
44-
<MissingFile>
45-
<errorLevel type="suppress">
46-
<file name="src/Optimization/Update.php"/>
47-
</errorLevel>
48-
</MissingFile>
49-
<DuplicateFunction>
50-
<errorLevel type="suppress">
51-
<file name="src/helper.php"/>
52-
</errorLevel>
53-
</DuplicateFunction>
54-
</issueHandlers>
55-
5623
<stubs>
5724
<file name="vendor/php-stubs/wordpress-stubs/wordpress-stubs.php" preloadClasses="true"/>
5825
</stubs>
@@ -62,5 +29,7 @@
6229
<var name="wp_rewrite" type="\WP_Rewrite"/>
6330
<var name="wp_version" type="string"/>
6431
<var name="ABSPATH" type="string"/>
32+
<var name="WPINC" type="string"/>
33+
<var name="SCRIPT_DEBUG" type="boolean"/>
6534
</globals>
6635
</psalm>

src/Optimization/Enqueue.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ public static function setScriptVersion( string $scriptSrc, string $handle ): st
6868
public static function jqueryFromCdn(): void {
6969
$registered = wp_scripts()->registered;
7070

71+
/** @psalm-suppress TypeDoesNotContainType */
7172
$suffix = SCRIPT_DEBUG ? '' : '.min';
7273

7374
$jqCore = $registered['jquery-core'];
@@ -85,6 +86,7 @@ public static function jqueryFromCdn(): void {
8586
continue;
8687
}
8788

89+
/** @psalm-suppress UndefinedConstant */
8890
if ( ! str_contains( $dependency->src, '/'.WPINC.'/' ) ) {
8991
continue;
9092
}

src/Optimization/Update.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,7 @@ private static function preSiteTransientUpdatePlugins(): object {
420420
if ( null === $pluginsList ) {
421421
// Add our plugin file if we don't have it.
422422
if ( ! \function_exists( 'get_plugins' ) ) {
423+
/** @psalm-suppress MissingFile */
423424
require_once ABSPATH.'wp-admin/includes/plugin.php';
424425
}
425426

0 commit comments

Comments
 (0)