Skip to content

Commit

Permalink
chore: update Kint to 5.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
kenjis committed Apr 27, 2024
1 parent 747108f commit 213fd50
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 6 deletions.
10 changes: 8 additions & 2 deletions system/ThirdParty/Kint/Parser/FsPathPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
use Kint\Zval\Representation\SplFileInfoRepresentation;
use Kint\Zval\Value;
use SplFileInfo;
use TypeError;

class FsPathPlugin extends AbstractPlugin
{
Expand Down Expand Up @@ -59,8 +60,13 @@ public function parse(&$var, Value &$o, int $trigger): void
return;
}

if (!@\file_exists($var)) {
return;
try {
if (!@\file_exists($var)) {
return;
}
} catch (TypeError $e) {// @codeCoverageIgnore
// Only possible in PHP 7
return; // @codeCoverageIgnore
}

if (\in_array($var, self::$blacklist, true)) {
Expand Down
3 changes: 2 additions & 1 deletion system/ThirdParty/Kint/Parser/MysqliPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ public function parse(&$var, Value &$o, int $trigger): void
foreach ($o->value->contents as $key => $obj) {
if (isset($this->connected_readable[$obj->name])) {
if (!$connected) {
continue;
// No failed connections after PHP 8.1
continue; // @codeCoverageIgnore
}
} elseif (isset($this->empty_readable[$obj->name])) {
// No failed connections after PHP 8.1
Expand Down
4 changes: 3 additions & 1 deletion system/ThirdParty/Kint/Zval/BlobValue.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,9 @@ public static function detectEncoding(string $string)
if (\function_exists('iconv')) {
foreach (self::$legacy_encodings as $encoding) {
// Iconv detection works by triggering
// "Detected an illegal character in input string" warnings
// "Detected an illegal character in input string" notices
// This notice does not become a TypeError with strict_types
// so we don't have to wrap this in a try catch
if (@\iconv($encoding, $encoding, $string) === $string) {
return $encoding;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function __construct(SplFileInfo $fileInfo)
}
} catch (RuntimeException $e) {
if (false === \strpos($e->getMessage(), ' open_basedir ')) {
throw $e;
throw $e; // @codeCoverageIgnore
}
}

Expand Down
2 changes: 1 addition & 1 deletion system/ThirdParty/Kint/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
if (false !== \ini_get('xdebug.file_link_format')) {
Kint::$file_link_format = \ini_get('xdebug.file_link_format');
}
if (isset($_SERVER['DOCUMENT_ROOT'])) {
if (isset($_SERVER['DOCUMENT_ROOT']) && false === \strpos($_SERVER['DOCUMENT_ROOT'], "\0")) {
Kint::$app_root_dirs = [
$_SERVER['DOCUMENT_ROOT'] => '<ROOT>',
];
Expand Down

0 comments on commit 213fd50

Please sign in to comment.