From d99eb893a0ec96dc9f5f0211da3cecc27c8eb7cd Mon Sep 17 00:00:00 2001 From: Jonathan Vollebregt Date: Wed, 1 Jan 2025 22:37:28 +0100 Subject: [PATCH] DomPlugin: Add PHP 8.5 special case handling --- build/kint.phar | Bin 575067 -> 575566 bytes init.php | 1 + src/Parser/DomPlugin.php | 15 +++++++++++++++ 3 files changed, 16 insertions(+) diff --git a/build/kint.phar b/build/kint.phar index 780896ff11806a8ab2fb413182bebb336d9a6f76..8ef96e4c7279ea94ee69973ca6c9ae9af354debc 100644 GIT binary patch delta 279 zcmccJqkL|H@&+|lfe3B}hK7AQG9Y@Mu7UbyGuGRz0y|wHq99saZ^gUKirjVzlW%JY zF`7;`&{knIZ4T9L57lPe9;(gs=`eGCX~}e*_e}27-!-wYPrvh?iIX|rFL?UL&rISH zK)KW+j}TuUbp=~H1#eHkkoW+P01MOUAKx(5Zh!Qi>ALRp4J}M!(+|91VPkXg_XX3TBE9PJ-unSq!Eh*^P{4T#yde~{%+Ug6>6ZSrsiqt(NN zYjGS)_fI*(Z&7;k+Rv%`9iKP!F7M}^^`f97qMmJjVH6KW6d( delta 221 zcmX>%LHTx%@&+|l0Wod{hK7AQG9X&~xTw`;GuGRz0vs+7Q4oFEWnS-QMQ%HV=7rkr z3$+=yFVtpwad`Uj_e?s|`I{Jprhk~s&NBT0Cx^gvI~iu)=?<@%Y_?DOz;s=A`T<@h z&guNU?4r}<{QG5wrud)2TUUei zc;?@3Om1Ds^mWFUWlJrCbC#quc}rh^!!Ru{Lwc5D>7Kde3(kB0_-Q~3pzwnt& Ng)9sV4DL?8P5?F5Q_=tc diff --git a/init.php b/init.php index 6d7c48423..60e58f667 100644 --- a/init.php +++ b/init.php @@ -44,6 +44,7 @@ \define('KINT_PHP82', \version_compare(PHP_VERSION, '8.2') >= 0); \define('KINT_PHP83', \version_compare(PHP_VERSION, '8.3') >= 0); \define('KINT_PHP84', \version_compare(PHP_VERSION, '8.4') >= 0); +\define('KINT_PHP85', \version_compare(PHP_VERSION, '8.5') >= 0); // Dynamic default settings if (\strlen((string) \ini_get('xdebug.file_link_format')) > 0) { diff --git a/src/Parser/DomPlugin.php b/src/Parser/DomPlugin.php index d12e2f4cc..358c0b917 100644 --- a/src/Parser/DomPlugin.php +++ b/src/Parser/DomPlugin.php @@ -102,9 +102,14 @@ class DomPlugin extends AbstractPlugin implements PluginBeginInterface 'previousElementSibling' => true, 'nextElementSibling' => true, 'innerHTML' => false, + 'outerHTML' => false, 'substitutedNodeValue' => false, ]; + public const DOM_NS_VERSIONS = [ + 'outerHTML' => KINT_PHP85, + ]; + /** * @psalm-var non-empty-array Property names to readable status */ @@ -458,6 +463,16 @@ public static function getKnownProperties(object $var): array if ($var instanceof Attr || $var instanceof CharacterData) { $known_properties['nodeValue'] = false; } + + foreach (self::DOM_NS_VERSIONS as $key => $val) { + /** + * @psalm-var bool $val + * Psalm bug #4509 + */ + if (false === $val) { + unset($known_properties[$key]); // @codeCoverageIgnore + } + } } else { $known_properties = self::DOMNODE_PROPS; if ($var instanceof DOMElement) {