Skip to content

Commit

Permalink
DomPlugin: Add PHP 8.5 special case handling
Browse files Browse the repository at this point in the history
  • Loading branch information
jnvsor committed Jan 1, 2025
1 parent 2fb169b commit 53abc90
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
Binary file modified build/kint.phar
Binary file not shown.
1 change: 1 addition & 0 deletions init.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
17 changes: 9 additions & 8 deletions src/Parser/DomPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ class DomPlugin extends AbstractPlugin implements PluginBeginInterface
'childElementCount' => KINT_PHP80,
'previousElementSibling' => KINT_PHP80,
'nextElementSibling' => KINT_PHP80,
'outerHTML' => !KINT_PHP85,
];

/**
Expand Down Expand Up @@ -463,15 +464,15 @@ public static function getKnownProperties(object $var): array
if ($var instanceof DOMElement) {
$known_properties += self::DOMELEMENT_PROPS;
}
}

foreach (self::DOM_VERSIONS as $key => $val) {
/**
* @psalm-var bool $val
* Psalm bug #4509
*/
if (false === $val) {
unset($known_properties[$key]); // @codeCoverageIgnore
}
foreach (self::DOM_VERSIONS as $key => $val) {
/**
* @psalm-var bool $val
* Psalm bug #4509
*/
if (false === $val) {
unset($known_properties[$key]); // @codeCoverageIgnore
}
}

Expand Down

0 comments on commit 53abc90

Please sign in to comment.