Skip to content

Commit

Permalink
Work in progress.
Browse files Browse the repository at this point in the history
  • Loading branch information
dev4press committed May 15, 2022
1 parent d9e8097 commit 4393ee6
Show file tree
Hide file tree
Showing 109 changed files with 1,787 additions and 1,108 deletions.
10 changes: 5 additions & 5 deletions core/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function debugpress_error_log( $object ) {
* @param string $title Optional title to associate with the stored object
* @param false $sql If the stored object SQL string, it will be rendered as formatted SQL
*/
function debugpress_store_object( $object, $title = '', $sql = false ) {
function debugpress_store_object( $object, string $title = '', bool $sql = false ) {
debugpress_tracker()->log( $object, $title, $sql );
}

Expand All @@ -34,7 +34,7 @@ function debugpress_store_object( $object, $title = '', $sql = false ) {
* @param string $plugin_file Name of the plugin as identified by WordPress, relative path to plugin main file
* @param array $data Data to show on the Plugins page
*/
function debugpress_store_for_plugin( $plugin_file, $data = array() ) {
function debugpress_store_for_plugin( string $plugin_file, array $data = array() ) {
debugpress_tracker()->plugin( $plugin_file, $data );
}

Expand Down Expand Up @@ -74,7 +74,7 @@ function_exists( 'classicpress_version_short' );
*
* @return string formatted string
*/
function debugpress_format_size( $size, $decimal = 2, $sep = ' ' ) : string {
function debugpress_format_size( $size, int $decimal = 2, string $sep = ' ' ) : string {
$units = array( 'B', 'KB', 'MB', 'GB', 'TB', 'PB' );

$size = max( $size, 0 );
Expand Down Expand Up @@ -107,7 +107,7 @@ function debugpress_strleft( string $input, string $modifier ) {
*
* @return string|string[]|null
*/
function debugpress_str_replace_first( $from, $to, $subject ) {
function debugpress_str_replace_first( string $from, string $to, string $subject ) {
return preg_replace( '/' . preg_quote( $from, '/' ) . '/', $to, $subject, 1 );
}

Expand All @@ -119,7 +119,7 @@ function debugpress_str_replace_first( $from, $to, $subject ) {
*
* @return string pretty printed output
*/
function debugpress_rs( $value, $echo = true ) : string {
function debugpress_rs( $value, bool $echo = true ) : string {
$result = '';

if ( is_bool( $value ) ) {
Expand Down
2 changes: 1 addition & 1 deletion core/main/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -292,4 +292,4 @@ public function build_stats( $key = 'wp_footer' ) : string {

return $gd;
}
}
}
2 changes: 1 addition & 1 deletion core/panel/Queries.php
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ private function _parse_callers( $calls, $qi, &$j ) {
$total = count( $calls );
$last = $calls[ $total - 1 ];

if ( strpos( $last, 'd4p_wpdb_core' ) === 0 || ( strpos( $last, 'Dev4Press' ) === 0 && strpos($last, '\Core\Plugins\DBLite') > 0 ) ) {
if ( strpos( $last, 'd4p_wpdb_core' ) === 0 || ( strpos( $last, 'Dev4Press' ) === 0 && strpos( $last, '\Core\Plugins\DBLite' ) > 0 ) ) {
$last = $calls[ $total - 2 ];
}

Expand Down
2 changes: 1 addition & 1 deletion core/printer/kint/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

require_once __DIR__ . '/composer/autoload_real.php';

return ComposerAutoloaderInitcd5a2e263a1473cfff2851eb73f6d68d::getLoader();
return ComposerAutoloaderInitca51731135e08eb5dc8e6d831f11e177::getLoader();
6 changes: 3 additions & 3 deletions core/printer/kint/composer/InstalledVersions.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ class InstalledVersions
),
'kint-php/kint' =>
array (
'pretty_version' => '3.3',
'version' => '3.3.0.0',
'pretty_version' => '4.1.2',
'version' => '4.1.2.0',
'aliases' =>
array (
),
'reference' => '335ac1bcaf04d87df70d8aa51e8887ba2c6d203b',
'reference' => 'fa53c4333cda79dc9cb002cfa029abe994d0ae00',
),
),
);
Expand Down
14 changes: 7 additions & 7 deletions core/printer/kint/composer/autoload_real.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// autoload_real.php @generated by Composer

class ComposerAutoloaderInitcd5a2e263a1473cfff2851eb73f6d68d
class ComposerAutoloaderInitca51731135e08eb5dc8e6d831f11e177
{
private static $loader;

Expand All @@ -22,15 +22,15 @@ public static function getLoader()
return self::$loader;
}

spl_autoload_register(array('ComposerAutoloaderInitcd5a2e263a1473cfff2851eb73f6d68d', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInitca51731135e08eb5dc8e6d831f11e177', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
spl_autoload_unregister(array('ComposerAutoloaderInitcd5a2e263a1473cfff2851eb73f6d68d', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInitca51731135e08eb5dc8e6d831f11e177', 'loadClassLoader'));

$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
if ($useStaticLoader) {
require __DIR__ . '/autoload_static.php';

call_user_func(\Composer\Autoload\ComposerStaticInitcd5a2e263a1473cfff2851eb73f6d68d::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInitca51731135e08eb5dc8e6d831f11e177::getInitializer($loader));
} else {
$map = require __DIR__ . '/autoload_namespaces.php';
foreach ($map as $namespace => $path) {
Expand All @@ -51,19 +51,19 @@ public static function getLoader()
$loader->register(true);

if ($useStaticLoader) {
$includeFiles = Composer\Autoload\ComposerStaticInitcd5a2e263a1473cfff2851eb73f6d68d::$files;
$includeFiles = Composer\Autoload\ComposerStaticInitca51731135e08eb5dc8e6d831f11e177::$files;
} else {
$includeFiles = require __DIR__ . '/autoload_files.php';
}
foreach ($includeFiles as $fileIdentifier => $file) {
composerRequirecd5a2e263a1473cfff2851eb73f6d68d($fileIdentifier, $file);
composerRequireca51731135e08eb5dc8e6d831f11e177($fileIdentifier, $file);
}

return $loader;
}
}

function composerRequirecd5a2e263a1473cfff2851eb73f6d68d($fileIdentifier, $file)
function composerRequireca51731135e08eb5dc8e6d831f11e177($fileIdentifier, $file)
{
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
require $file;
Expand Down
8 changes: 4 additions & 4 deletions core/printer/kint/composer/autoload_static.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Composer\Autoload;

class ComposerStaticInitcd5a2e263a1473cfff2851eb73f6d68d
class ComposerStaticInitca51731135e08eb5dc8e6d831f11e177
{
public static $files = array (
'3917c79c5052b270641b5a200963dbc2' => __DIR__ . '/..' . '/kint-php/kint/init.php',
Expand All @@ -31,9 +31,9 @@ class ComposerStaticInitcd5a2e263a1473cfff2851eb73f6d68d
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInitcd5a2e263a1473cfff2851eb73f6d68d::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitcd5a2e263a1473cfff2851eb73f6d68d::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInitcd5a2e263a1473cfff2851eb73f6d68d::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInitca51731135e08eb5dc8e6d831f11e177::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitca51731135e08eb5dc8e6d831f11e177::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInitca51731135e08eb5dc8e6d831f11e177::$classMap;

}, null, ClassLoader::class);
}
Expand Down
76 changes: 76 additions & 0 deletions core/printer/kint/composer/installed.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{
"packages": [
{
"name": "kint-php/kint",
"version": "4.1.2",
"version_normalized": "4.1.2.0",
"source": {
"type": "git",
"url": "https://github.com/kint-php/kint.git",
"reference": "fa53c4333cda79dc9cb002cfa029abe994d0ae00"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/kint-php/kint/zipball/fa53c4333cda79dc9cb002cfa029abe994d0ae00",
"reference": "fa53c4333cda79dc9cb002cfa029abe994d0ae00",
"shasum": ""
},
"require": {
"php": ">=5.6"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.0",
"phpspec/prophecy-phpunit": "^2",
"phpunit/phpunit": "^9.0",
"seld/phar-utils": "^1.0",
"symfony/finder": "^3.0 || ^4.0 || ^5.0",
"vimeo/psalm": "^4.0"
},
"suggest": {
"kint-php/kint-helpers": "Provides extra helper functions",
"kint-php/kint-twig": "Provides d() and s() functions in twig templates"
},
"time": "2022-02-22T20:32:24+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
"files": [
"init.php"
],
"psr-4": {
"Kint\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Jonathan Vollebregt",
"homepage": "https://github.com/jnvsor"
},
{
"name": "Contributors",
"homepage": "https://github.com/kint-php/kint/graphs/contributors"
}
],
"description": "Kint - debugging tool for PHP developers",
"homepage": "https://kint-php.github.io/kint/",
"keywords": [
"debug",
"kint",
"php"
],
"support": {
"issues": "https://github.com/kint-php/kint/issues",
"source": "https://github.com/kint-php/kint/tree/4.1.2"
},
"install-path": "../kint-php/kint"
}
],
"dev": true,
"dev-package-names": [
"kint-php/kint"
]
}
6 changes: 3 additions & 3 deletions core/printer/kint/composer/installed.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
),
'kint-php/kint' =>
array (
'pretty_version' => '3.3',
'version' => '3.3.0.0',
'pretty_version' => '4.1.2',
'version' => '4.1.2.0',
'aliases' =>
array (
),
'reference' => '335ac1bcaf04d87df70d8aa51e8887ba2c6d203b',
'reference' => 'fa53c4333cda79dc9cb002cfa029abe994d0ae00',
),
),
);
8 changes: 3 additions & 5 deletions core/printer/kint/kint-php/kint/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Kint - debugging helper for PHP developers

[![](https://travis-ci.org/kint-php/kint.svg?branch=master)](https://travis-ci.org/kint-php/kint)

![Screenshot](https://kint-php.github.io/kint/images/intro.png)

## What am I looking at?
Expand Down Expand Up @@ -36,7 +34,6 @@ Kint::dump($GLOBALS, $_SERVER); // pass any number of parameters
d($GLOBALS, $_SERVER); // or simply use d() as a shorthand

Kint::trace(); // Debug backtrace
d(1); // Debug backtrace shorthand

s($GLOBALS); // Basic output mode

Expand All @@ -51,7 +48,6 @@ d('Get off my lawn!'); // Debugs no longer have any effect
* Kint is enabled by default, set `Kint::$enabled_mode = false;` to turn it completely off.
The best practice is to enable Kint in a development environment only - so even if you accidentally leave a dump in production, no one will know.
* See the buttons on the right of the output? Click them to open a new tab, show the access path for the value, or show a search box.
* To see the output where you called Kint instead of the docked toolbar at the bottom of the page add the line `Kint\Renderer\RichRenderer::$folder = false;` right after you include Kint.
* There are a couple of real-time modifiers you can use:
* `~d($var)` this call will output in plain text format.
* `+d($var)` will disregard depth level limits and output everything.
Expand All @@ -63,6 +59,8 @@ d('Get off my lawn!'); // Debugs no longer have any effect
* Triple clicking the <kbd>+</kbd> sign in will open/close everything on the page.
* Add heavy classes to the blacklist to improve performance:
`Kint\Parser\BlacklistPlugin::$shallow_blacklist[] = 'Psr\Container\ContainerInterface';`
* To see the output in a docked toolbar at the bottom of the page:
`Kint\Renderer\RichRenderer::$folder = true;`
* To change display theme, use `Kint\Renderer\RichRenderer::$theme = 'theme.css';`. You can pass the absolute path to a CSS file, or use one of the built in themes:
* `original.css` (default)
* `solarized.css`
Expand All @@ -75,7 +73,7 @@ d('Get off my lawn!'); // Debugs no longer have any effect
## Authors

[**Jonathan Vollebregt** (jnvsor)](https://github.com/jnvsor)
[**Rokas Šleinius** (raveren)](https://github.com/raveren)
[Contributors](https://github.com/kint-php/kint/graphs/contributors)

## License

Expand Down
74 changes: 74 additions & 0 deletions core/printer/kint/kint-php/kint/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
{
"name": "kint-php/kint",
"description": "Kint - debugging tool for PHP developers",
"keywords": ["kint", "php", "debug"],
"type": "library",
"homepage": "https://kint-php.github.io/kint/",
"license": "MIT",
"authors": [
{
"name": "Jonathan Vollebregt",
"homepage": "https://github.com/jnvsor"
},
{
"name": "Contributors",
"homepage": "https://github.com/kint-php/kint/graphs/contributors"
}
],
"require": {
"php": ">=5.6"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.0",
"phpunit/phpunit": "^9.0",
"phpspec/prophecy-phpunit": "^2",
"symfony/finder": "^3.0 || ^4.0 || ^5.0",
"seld/phar-utils": "^1.0",
"vimeo/psalm": "^4.0"
},
"autoload": {
"files": ["init.php"],
"psr-4": {
"Kint\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Kint\\Test\\": "tests/"
}
},
"config": {
"platform": {
"php": "7.4"
}
},
"scripts": {
"post-update-cmd": "npm ci",
"post-install-cmd": "@post-update-cmd",
"clean": [
"rm -rf resources/compiled/",
"rm -rf build/"
],
"format": [
"@format:php",
"@format:js",
"@format:sass"
],
"format:php": "php-cs-fixer fix",
"format:js": "npm run format:js",
"format:sass": "npm run format:sass",
"build": [
"@build:sass",
"@build:js",
"@build:php"
],
"build:sass": "npm run build:sass",
"build:js": "npm run build:js",
"build:php": "php ./build.php",
"analyze": "psalm --show-info=false"
},
"suggest": {
"kint-php/kint-helpers": "Provides extra helper functions",
"kint-php/kint-twig": "Provides d() and s() functions in twig templates"
}
}
Loading

0 comments on commit 4393ee6

Please sign in to comment.