Commit ab8823afcf5 for woocommerce
commit ab8823afcf5daf4aa8c26e77d54db604afc88d12
Author: Ján Mikláš <neosinner@gmail.com>
Date: Mon Nov 2 12:21:55 2026 +0100
[Email Editor] Update PHPStan to 2.3.4 (#70443)
* ci(email-editor): run PHPStan on task changes
* chore(email-editor): update PHPStan to 2.3.4
* docs: add PHPStan update changelog
* fix(email-editor): drop PHPStan baseline for border shorthand
The count checks in expand_shorthand_value() already guarantee each
offset exists, so the `?? ''` fallbacks were dead code that PHPStan 2.3
flags as nullCoalesce.offset. Remove them and the baseline that
ignored the errors.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NM9YXvCCu5ooKLFy6X7VFf
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
diff --git a/packages/php/email-editor/changelog/update-phpstan-2-3-4 b/packages/php/email-editor/changelog/update-phpstan-2-3-4
new file mode 100644
index 00000000000..c0d965ec065
--- /dev/null
+++ b/packages/php/email-editor/changelog/update-phpstan-2-3-4
@@ -0,0 +1,3 @@
+Significance: patch
+Type: dev
+Comment: Update PHPStan to 2.3.4 for faster static analysis; no production change.
diff --git a/packages/php/email-editor/package.json b/packages/php/email-editor/package.json
index 3adf9878f2a..f3a94997f3e 100644
--- a/packages/php/email-editor/package.json
+++ b/packages/php/email-editor/package.json
@@ -62,7 +62,9 @@
"testType": "static:analysis",
"command": "phpstan:php7",
"changes": [
- "**/*.php"
+ "**/*.php",
+ "**/*.neon",
+ "tasks/phpstan/**"
],
"events": [
"pull_request",
@@ -74,7 +76,9 @@
"testType": "static:analysis",
"command": "phpstan:php8",
"changes": [
- "**/*.php"
+ "**/*.php",
+ "**/*.neon",
+ "tasks/phpstan/**"
],
"events": [
"pull_request",
diff --git a/packages/php/email-editor/src/Engine/Renderer/ContentRenderer/Postprocessors/class-border-style-postprocessor.php b/packages/php/email-editor/src/Engine/Renderer/ContentRenderer/Postprocessors/class-border-style-postprocessor.php
index 58f717809aa..f0e63a598bb 100644
--- a/packages/php/email-editor/src/Engine/Renderer/ContentRenderer/Postprocessors/class-border-style-postprocessor.php
+++ b/packages/php/email-editor/src/Engine/Renderer/ContentRenderer/Postprocessors/class-border-style-postprocessor.php
@@ -185,34 +185,34 @@ class Border_Style_Postprocessor implements Postprocessor {
$count = count( $values );
if ( 4 === $count ) {
return array(
- 'top' => $values[0] ?? '',
- 'right' => $values[1] ?? '',
- 'bottom' => $values[2] ?? '',
- 'left' => $values[3] ?? '',
+ 'top' => $values[0],
+ 'right' => $values[1],
+ 'bottom' => $values[2],
+ 'left' => $values[3],
);
}
if ( 3 === $count ) {
return array(
- 'top' => $values[0] ?? '',
- 'right' => $values[1] ?? '',
- 'bottom' => $values[2] ?? '',
- 'left' => $values[1] ?? '',
+ 'top' => $values[0],
+ 'right' => $values[1],
+ 'bottom' => $values[2],
+ 'left' => $values[1],
);
}
if ( 2 === $count ) {
return array(
- 'top' => $values[0] ?? '',
- 'right' => $values[1] ?? '',
- 'bottom' => $values[0] ?? '',
- 'left' => $values[1] ?? '',
+ 'top' => $values[0],
+ 'right' => $values[1],
+ 'bottom' => $values[0],
+ 'left' => $values[1],
);
}
if ( 1 === $count ) {
return array(
- 'top' => $values[0] ?? '',
- 'right' => $values[0] ?? '',
- 'bottom' => $values[0] ?? '',
- 'left' => $values[0] ?? '',
+ 'top' => $values[0],
+ 'right' => $values[0],
+ 'bottom' => $values[0],
+ 'left' => $values[0],
);
}
diff --git a/packages/php/email-editor/tasks/phpstan/composer.json b/packages/php/email-editor/tasks/phpstan/composer.json
index 21fff21be47..b3695c34330 100644
--- a/packages/php/email-editor/tasks/phpstan/composer.json
+++ b/packages/php/email-editor/tasks/phpstan/composer.json
@@ -6,7 +6,7 @@
"php": ">=7.4"
},
"require-dev": {
- "phpstan/phpstan": "^2.1",
+ "phpstan/phpstan": "^2.3.4",
"phpstan/phpstan-phpunit": "^2.0",
"php-stubs/woocommerce-stubs": "^9.8",
"php-stubs/wordpress-tests-stubs": "^6.8",
diff --git a/packages/php/email-editor/tasks/phpstan/composer.lock b/packages/php/email-editor/tasks/phpstan/composer.lock
index 6bc05d35349..43472976d44 100644
--- a/packages/php/email-editor/tasks/phpstan/composer.lock
+++ b/packages/php/email-editor/tasks/phpstan/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "d31cb7abe157c46b44dc2a2688685a91",
+ "content-hash": "5c5244364c362fbac003828d7df12608",
"packages": [],
"packages-dev": [
{
@@ -144,16 +144,11 @@
},
{
"name": "phpstan/phpstan",
- "version": "2.1.17",
- "source": {
- "type": "git",
- "url": "https://github.com/phpstan/phpstan.git",
- "reference": "89b5ef665716fa2a52ecd2633f21007a6a349053"
- },
+ "version": "2.3.4",
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpstan/phpstan/zipball/89b5ef665716fa2a52ecd2633f21007a6a349053",
- "reference": "89b5ef665716fa2a52ecd2633f21007a6a349053",
+ "url": "https://api.github.com/repos/phpstan/phpstan/zipball/f20ce6f3c82556cfcfc086b152445a12d1d64fff",
+ "reference": "f20ce6f3c82556cfcfc086b152445a12d1d64fff",
"shasum": ""
},
"require": {
@@ -176,6 +171,17 @@
"license": [
"MIT"
],
+ "authors": [
+ {
+ "name": "Ondřej Mirtes"
+ },
+ {
+ "name": "Markus Staab"
+ },
+ {
+ "name": "Vincent Langlet"
+ }
+ ],
"description": "PHPStan - PHP Static Analysis Tool",
"keywords": [
"dev",
@@ -198,7 +204,7 @@
"type": "github"
}
],
- "time": "2025-05-21T20:55:28+00:00"
+ "time": "2026-10-28T22:38:53+00:00"
},
{
"name": "phpstan/phpstan-phpunit",
@@ -328,5 +334,5 @@
"platform-overrides": {
"php": "7.4"
},
- "plugin-api-version": "2.6.0"
+ "plugin-api-version": "2.9.0"
}