Skip to content

Instantly share code, notes, and snippets.

@dieppon
Last active February 28, 2023 11:31
Show Gist options
  • Save dieppon/bfd57f1765260eff2e76da5da7ee0c26 to your computer and use it in GitHub Desktop.
Save dieppon/bfd57f1765260eff2e76da5da7ee0c26 to your computer and use it in GitHub Desktop.
diff --git a/kint-debugger.php b/kint-debugger.php
index fcb653b..bb3ab5d 100755
--- a/kint-debugger.php
+++ b/kint-debugger.php
@@ -6,7 +6,7 @@
* Version: 1.2
* Author: Brian Fegter, Chris Dillon
* Author URI: https://strongplugins.com
- * Requires: 2.5 or higher
+ * Requires: 5.0
* License: Dual license GPL-2.0+ & MIT (Kint is licensed MIT)
*
* Copyright 2012-2019 Brian Fegter (brian@fegter.com), Chris Wallace (chris@liftux.com), Chris Dillon (chris@strongwp.com)
diff --git a/readme.txt b/readme.txt
index d0450d7..cbbcafb 100644
--- a/readme.txt
+++ b/readme.txt
@@ -2,8 +2,8 @@
Contributors: misternifty, chriswallace, cdillon27
Tags: debug, debugger, kint, print_r, var_dump, backtrace, debug_backtrace, trace, developer, debug bar, adopt-me
Requires at least: 2.5
-Tested up to: 5.0
-Stable tag: 1.2
+Tested up to: 5.6
+Stable tag: 2.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
@@ -11,6 +11,8 @@ Dump variables and traces in an organized and interactive display. Integrates se
== Description ==
+Updated for PHP 8.0
+
> This plugin is up for adoption.
**Kint Debugger** is a simple wrapper for [Kint](https://github.com/raveren/kint), a debugging tool to output information about variables and traces in a styled, collapsible format that makes understanding deep arrays and objects easier.
diff --git a/vendor/kint/inc/kintParser.class.php b/vendor/kint/inc/kintParser.class.php
index 48153dc..400fb14 100644
--- a/vendor/kint/inc/kintParser.class.php
+++ b/vendor/kint/inc/kintParser.class.php
@@ -460,9 +460,9 @@ abstract class kintParser extends kintVariableData
* These prepended values have null bytes on either side.
* http://www.php.net/manual/en/language.types.array.php#language.types.array.casting
*/
- if ( $key{0} === "\x00" ) {
+ if ( $key[0] === "\x00" ) {
- $access = $key{1} === "*" ? "protected" : "private";
+ $access = $key[1] === "*" ? "protected" : "private";
// Remove the access level from the variable name
$key = substr( $key, strrpos( $key, "\x00" ) + 1 );
diff --git a/vendor/kint/parsers/custom/classmethods.php b/vendor/kint/parsers/custom/classmethods.php
index 953318d..3615ab2 100644
--- a/vendor/kint/parsers/custom/classmethods.php
+++ b/vendor/kint/parsers/custom/classmethods.php
@@ -27,11 +27,13 @@ class Kint_Parsers_ClassMethods extends kintParser
foreach ( $method->getParameters() as $param ) {
$paramString = '';
- if ( $param->isArray() ) {
+ if ( $param->getType() && $param->getType()->getName() === 'array' ) {
$paramString .= 'array ';
} else {
try {
- if ( $paramClassName = $param->getClass() ) {
+ if ( $paramClassName = $param->getType() && !$param->getType()->isBuiltin()
+ ? new ReflectionClass($param->getType()->getName())
+ : null ) {
$paramString .= $paramClassName->name . ' ';
}
} catch ( ReflectionException $e ) {
diff --git a/vendor/kint/parsers/custom/color.php b/vendor/kint/parsers/custom/color.php
index 5ca44d8..de5522c 100644
--- a/vendor/kint/parsers/custom/color.php
+++ b/vendor/kint/parsers/custom/color.php
@@ -82,7 +82,7 @@ class Kint_Parsers_Color extends kintParser
$color = self::$_css3Named[ $color ];
}
- if ( $color{0} === '#' ) {
+ if ( $color[0] === '#' ) {
$variants['hex'] = $color;
$color = substr( $color, 1 );
if ( strlen( $color ) === 6 ) {
diff --git a/vendor/kint/parsers/custom/json.php b/vendor/kint/parsers/custom/json.php
index f752a21..0a57864 100644
--- a/vendor/kint/parsers/custom/json.php
+++ b/vendor/kint/parsers/custom/json.php
@@ -6,7 +6,7 @@ class Kint_Parsers_Json extends kintParser
{
if ( !KINT_PHP53
|| !is_string( $variable )
- || !isset( $variable{0} ) || ( $variable{0} !== '{' && $variable{0} !== '[' )
+ || !isset( $variable[0] ) || ( $variable[0] !== '{' && $variable[0] !== '[' )
|| ( $json = json_decode( $variable, true ) ) === null
) return false;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment