This commit is contained in:
2024-05-20 15:37:46 +03:00
commit 00b7dbd0b7
10404 changed files with 3285853 additions and 0 deletions

View File

@ -0,0 +1,44 @@
<?php declare(strict_types = 1);
/**
* Admin screen data transfer object.
*
* @package query-monitor
*/
class QM_Data_Admin extends QM_Data {
/**
* @var ?WP_Screen
*/
public $current_screen;
/**
* @var string
*/
public $hook_suffix;
/**
* @var array<string, string>
* @phpstan-var array{}|array{
* columns_filter: string,
* sortables_filter: string,
* column_action: string,
* class_name?: string,
* }
*/
public $list_table;
/**
* @var string
*/
public $pagenow;
/**
* @var string
*/
public $taxnow;
/**
* @var string
*/
public $typenow;
}

View File

@ -0,0 +1,73 @@
<?php declare(strict_types = 1);
/**
* Asset data transfer object.
*
* @package query-monitor
*/
class QM_Data_Assets extends QM_Data {
/**
* @var array<string, array<string, array<string, mixed>>>
*/
public $assets;
/**
* @var array<int, string>
*/
public $broken;
/**
* @var array<string, int>
*/
public $counts;
/**
* @var string
*/
public $default_version;
/**
* @var array<int, string>
*/
public $dependencies;
/**
* @var array<int, string>
*/
public $dependents;
/**
* @var array<int, string>
*/
public $footer;
/**
* @var array<int, string>
*/
public $header;
/**
* @var string
*/
public $host;
/**
* @var bool
*/
public $is_ssl;
/**
* @var array<int, string>
*/
public $missing;
/**
* @var array<string, true>
*/
public $missing_dependencies;
/**
* @var string
*/
public $port;
}

View File

@ -0,0 +1,44 @@
<?php declare(strict_types = 1);
/**
* Block editor data transfer object.
*
* @package query-monitor
*/
class QM_Data_Block_Editor extends QM_Data {
/**
* @var array<int, string>
*/
public $all_dynamic_blocks;
/**
* @var bool
*/
public $block_editor_enabled;
/**
* @var bool
*/
public $has_block_context;
/**
* @var bool
*/
public $has_block_timing;
/**
* @var array<int, mixed>|null
*/
public $post_blocks;
/**
* @var bool
*/
public $post_has_blocks;
/**
* @var int
*/
public $total_blocks;
}

View File

@ -0,0 +1,44 @@
<?php declare(strict_types = 1);
/**
* Cache data transfer object.
*
* @package query-monitor
*/
class QM_Data_Cache extends QM_Data {
/**
* @var bool
*/
public $has_object_cache;
/**
* @var bool
*/
public $display_hit_rate_warning;
/**
* @var bool
*/
public $has_opcode_cache;
/**
* @var int
*/
public $cache_hit_percentage;
/**
* @var array<string, mixed>
*/
public $stats;
/**
* @var array<string, bool>
*/
public $object_cache_extensions;
/**
* @var array<string, bool>
*/
public $opcode_cache_extensions;
}

View File

@ -0,0 +1,37 @@
<?php declare(strict_types = 1);
/**
* Cache data transfer object.
*
* @package query-monitor
*/
class QM_Data_Caps extends QM_Data {
/**
* @var array<int, array<string, mixed>>
* @phpstan-var list<array{
* args: list<mixed>,
* filtered_trace: list<array<string, mixed>>,
* component: QM_Component,
* result: bool,
* parts: list<string>,
* name: string,
* user: string,
* }>
*/
public $caps;
/**
* @var array<int, string>
*/
public $parts;
/**
* @var array<int, int>
*/
public $users;
/**
* @var array<string, string>
*/
public $components;
}

View File

@ -0,0 +1,18 @@
<?php declare(strict_types = 1);
/**
* Conditionals data transfer object.
*
* @package query-monitor
*/
class QM_Data_Conditionals extends QM_Data {
/**
* @var array<string, array<int, string>>
* @phpstan-var array{
* true: list<string>,
* false: list<string>,
* na: list<string>,
* }
*/
public $conds;
}

View File

@ -0,0 +1,18 @@
<?php declare(strict_types = 1);
/**
* Database query callers data transfer object.
*
* @package query-monitor
*/
class QM_Data_DB_Callers extends QM_Data {
/**
* @var array<string, array<string, mixed>>
* @phpstan-var array<string, array{
* caller: string,
* ltime: float,
* types: array<string, int>,
* }>
*/
public $times = array();
}

View File

@ -0,0 +1,18 @@
<?php declare(strict_types = 1);
/**
* Database query components data transfer object.
*
* @package query-monitor
*/
class QM_Data_DB_Components extends QM_Data {
/**
* @var array<string, array<string, mixed>>
* @phpstan-var array<string, array{
* ltime: float,
* types: array<string, int>,
* component: string,
* }>
*/
public $times;
}

View File

@ -0,0 +1,38 @@
<?php declare(strict_types = 1);
/**
* Duplicate database queries data transfer object.
*
* @package query-monitor
*/
class QM_Data_DB_Dupes extends QM_Data {
/**
* @var int
*/
public $total_qs;
/**
* @var array<string, array<string, int>>
*/
public $dupe_sources;
/**
* @var array<string, array<string, int>>
*/
public $dupe_callers;
/**
* @var array<string, array<string, int>>
*/
public $dupe_components;
/**
* @var array<string, array<int, int>>
*/
public $dupes;
/**
* @var array<string, float>
*/
public $dupe_times;
}

View File

@ -0,0 +1,48 @@
<?php declare(strict_types = 1);
/**
* Database queries data transfer object.
*
* @package query-monitor
*/
class QM_Data_DB_Queries extends QM_Data {
/**
* @var int
*/
public $total_qs;
/**
* @var float
*/
public $total_time;
/**
* @var array<int, array<string, mixed>>
*/
public $errors;
/**
* @var ?array<int, array<string, mixed>>
*/
public $expensive;
/**
* @var ?stdClass
*/
public $wpdb;
/**
* @var ?array<string, array<string, mixed>>
* @phpstan-var ?array<string, array{
* caller: string,
* ltime: float,
* types: array<string, int>,
* }>
*/
public $times = array();
/**
* @var ?array<string, array<int, int>>
*/
public $dupes;
}

View File

@ -0,0 +1,19 @@
<?php declare(strict_types = 1);
/**
* Doing it Wrong data transfer object.
*
* @package query-monitor
*/
class QM_Data_Doing_It_Wrong extends QM_Data {
/**
* @var array<int, array<string, mixed>>
* @phpstan-var array<int, array{
* hook: string,
* filtered_trace: list<array<string, mixed>>,
* message: string,
* component: QM_Component,
* }>
*/
public $actions;
}

View File

@ -0,0 +1,68 @@
<?php declare(strict_types = 1);
/**
* Environment data transfer object.
*
* @package query-monitor
*/
class QM_Data_Environment extends QM_Data {
/**
* @TODO data class
* @var array<string, mixed>
* @phpstan-var array{
* variables: array<string, string|null>,
* version: string|false,
* sapi: string|false,
* user: string,
* old: bool,
* extensions: array<string, string>,
* error_reporting: int,
* error_levels: array<string, bool>,
* }
*/
public $php;
/**
* @TODO data class
* @var array<string, mixed>
* @phpstan-var array{
* info: array{
* server-version: string,
* extension: string|null,
* client-version: string|null,
* user: string,
* host: string,
* database: string,
* },
* vars: array<string, bool|string>,
* variables: list<stdClass>,
* }
*/
public $db;
/**
* @TODO data class
* @var array<string, mixed>
* @phpstan-var array{
* version: string,
* environment_type?: string,
* development_mode?: string,
* constants: array<string, string>,
* }>
*/
public $wp;
/**
* @TODO data class
* @var array<string, mixed>
* @phpstan-var array{
* name: string,
* version: string|null,
* address: string|null,
* host: string|null,
* OS: string|null,
* arch: string|null,
* }>
*/
public $server;
}

View File

@ -0,0 +1,10 @@
<?php declare(strict_types = 1);
/**
* Fallback data transfer object for third-party collectors that don't extend
* the new QM_DataCollector class.
*
* @package query-monitor
*/
#[AllowDynamicProperties]
class QM_Data_Fallback extends QM_Data {}

View File

@ -0,0 +1,37 @@
<?php declare(strict_types = 1);
/**
* Hooks data transfer object.
*
* @package query-monitor
*/
class QM_Data_Hooks extends QM_Data {
/**
* @var array<int, array<string, mixed>>
* @phpstan-var list<array{
* name: string,
* actions: list<array{
* priority: int,
* callback: array<string, mixed>,
* }>,
* parts: list<string>,
* components: array<string, string>,
* }>
*/
public $hooks;
/**
* @var array<int, string>
*/
public $parts;
/**
* @var array<string, string>
*/
public $components;
/**
* @var bool
*/
public $all_hooks;
}

View File

@ -0,0 +1,40 @@
<?php declare(strict_types = 1);
/**
* HTTP data transfer object.
*
* @package query-monitor
*/
class QM_Data_HTTP extends QM_Data {
/**
* @var array<string, array<string, mixed>>
* @phpstan-var array<string, array{
* args: array<string, mixed>,
* component: QM_Component,
* filtered_trace: list<array<string, mixed>>,
* info: array<string, mixed>|null,
* host: string,
* local: bool,
* ltime: float,
* redirected_to: string|null,
* response: mixed[]|WP_Error,
* type: string,
* url: string,
* }>
*/
public $http;
/**
* @var float
*/
public $ltime;
/**
* @var array<string, array<int, string>>
* @phpstan-var array{
* alert?: list<string>,
* warning?: list<string>,
* }
*/
public $errors;
}

View File

@ -0,0 +1,56 @@
<?php declare(strict_types = 1);
/**
* Languages data transfer object.
*
* @package query-monitor
*/
class QM_Data_Languages extends QM_Data {
/**
* @var array<string, array<string, array<string, mixed>>>
* @phpstan-var array<string, array<string, array{
* caller: mixed,
* domain: string,
* file: string|false,
* found: int|false,
* handle: string|null,
* type: 'gettext'|'jed',
* }>>
*/
public $languages;
/**
* @var string
*/
public $locale;
/**
* @var string
*/
public $user_locale;
/**
* @var string
*/
public $determined_locale;
/**
* @var string
*/
public $language_attributes;
/**
* @var string
*/
public $mlp_language;
/**
* @var string
*/
public $pll_language;
/**
* @var int
*/
public $total_size;
}

View File

@ -0,0 +1,30 @@
<?php declare(strict_types = 1);
/**
* Logger data transfer object.
*
* @package query-monitor
*/
class QM_Data_Logger extends QM_Data {
/**
* @var array<string, int>
* @phpstan-var array<QM_Collector_Logger::*, int>
*/
public $counts;
/**
* @var array<int, array<string, mixed>>
* @phpstan-var list<array{
* message: string,
* filtered_trace: mixed[],
* component: QM_Component,
* level: QM_Collector_Logger::*,
* }>
*/
public $logs;
/**
* @var array<string, string>
*/
public $components;
}

View File

@ -0,0 +1,19 @@
<?php declare(strict_types = 1);
/**
* Multisite data transfer object.
*
* @package query-monitor
*/
class QM_Data_Multisite extends QM_Data {
/**
* @var array<int, array<string, mixed>>
* @phpstan-var list<array{
* new: int,
* prev: int,
* to: bool,
* trace: QM_Backtrace,
* }>
*/
public $switches;
}

View File

@ -0,0 +1,69 @@
<?php declare(strict_types = 1);
/**
* Overview data transfer object.
*
* @package query-monitor
*/
class QM_Data_Overview extends QM_Data {
/**
* @var ?float
*/
public $time_taken;
/**
* @var int
*/
public $time_limit;
/**
* @var float
*/
public $time_start;
/**
* @var int|float
*/
public $time_usage;
/**
* @var int
*/
public $memory;
/**
* @var float
*/
public $memory_limit;
/**
* @var int|float
*/
public $memory_usage;
/**
* @var ?array<string, mixed>
*/
public $current_user;
/**
* @var ?array<string, mixed>
*/
public $switched_user;
/**
* @var bool
*/
public $display_time_usage_warning;
/**
* @var bool
*/
public $display_memory_usage_warning;
/**
* @var bool
*/
public $is_admin;
}

View File

@ -0,0 +1,45 @@
<?php declare(strict_types = 1);
/**
* PHP errors data transfer object.
*
* @package query-monitor
*/
/**
* @phpstan-type errorObject array{
* errno: int,
* type: string,
* message: string,
* file: string|null,
* filename: string,
* line: int|null,
* filtered_trace: list<array<string, mixed>>|null,
* component: QM_Component,
* calls: int,
* }
* @phpstan-type errorObjects array<string, array<string, errorObject>>
*/
class QM_Data_PHP_Errors extends QM_Data {
/**
* @var array<string, string>
*/
public $components;
/**
* @var array<string, array<string, array<string, mixed>>>
* @phpstan-var errorObjects
*/
public $errors;
/**
* @var array<string, array<string, array<string, mixed>>>
* @phpstan-var errorObjects
*/
public $suppressed;
/**
* @var array<string, array<string, array<string, mixed>>>
* @phpstan-var errorObjects
*/
public $silenced;
}

View File

@ -0,0 +1,18 @@
<?php declare(strict_types = 1);
/**
* Raw request data transfer object.
*
* @package query-monitor
*/
class QM_Data_Raw_Request extends QM_Data {
/**
* @var array<string, mixed>
*/
public $request;
/**
* @var array<string, mixed>
*/
public $response;
}

View File

@ -0,0 +1,23 @@
<?php declare(strict_types = 1);
/**
* Redirect data transfer object.
*
* @package query-monitor
*/
class QM_Data_Redirect extends QM_Data {
/**
* @var ?QM_Backtrace
*/
public $trace;
/**
* @var ?string
*/
public $location;
/**
* @var ?int
*/
public $status;
}

View File

@ -0,0 +1,52 @@
<?php declare(strict_types = 1);
/**
* Request data transfer object.
*
* @package query-monitor
*/
class QM_Data_Request extends QM_Data {
/**
* @var array<string, mixed>
* @phpstan-var array{
* title: string,
* data: WP_User|false,
* }
*/
public $user;
/**
* @var array<string, array<string, mixed>>
*/
public $multisite;
/**
* @var array<string, mixed>
*/
public $request;
/**
* @var array<string, mixed>
*/
public $qvars;
/**
* @var array<string, mixed>
*/
public $plugin_qvars;
/**
* @var array<string, mixed>
*/
public $queried_object;
/**
* @var string
*/
public $request_method;
/**
* @var array<string, string>
*/
public $matching_rewrites;
}

View File

@ -0,0 +1,99 @@
<?php declare(strict_types = 1);
/**
* Theme data transfer object.
*
* @package query-monitor
*/
class QM_Data_Theme extends QM_Data {
/**
* @var bool
*/
public $is_child_theme;
/**
* @var string
*/
public $stylesheet_theme_json;
/**
* @var string
*/
public $template_theme_json;
/**
* @var WP_Block_Template|null
*/
public $block_template;
/**
* @var array<string, string>
*/
public $theme_dirs;
/**
* @var array<string, string>
*/
public $theme_folders;
/**
* @var string
*/
public $stylesheet;
/**
* @var string
*/
public $template;
/**
* @var string
*/
public $theme_template_file;
/**
* @var string
*/
public $template_path;
/**
* @var ?string
*/
public $template_file;
/**
* @var ?array<int, string>
*/
public $template_hierarchy;
/**
* @var ?array<int, string>
*/
public $timber_files;
/**
* @var ?array<int, string>
*/
public $body_class;
/**
* @var array<string|int, string>
*/
public $template_parts;
/**
* @var array<string|int, string>
*/
public $theme_template_parts;
/**
* @var array<string|int, int>
*/
public $count_template_parts;
/**
* @var array<int, array<string, mixed>>
*/
public $unsuccessful_template_parts;
}

View File

@ -0,0 +1,18 @@
<?php declare(strict_types = 1);
/**
* Timing data transfer object.
*
* @package query-monitor
*/
class QM_Data_Timing extends QM_Data {
/**
* @var array<int, array<string, mixed>>
*/
public $warning;
/**
* @var array<int, array<string, mixed>>
*/
public $timing;
}

View File

@ -0,0 +1,28 @@
<?php declare(strict_types = 1);
/**
* Transients data transfer object.
*
* @package query-monitor
*/
class QM_Data_Transients extends QM_Data {
/**
* @var array<int, array{
* name: string,
* filtered_trace: mixed[],
* component: QM_Component,
* type: string,
* value: mixed,
* expiration: int,
* exp_diff: string,
* size: int,
* size_formatted: string,
* }>
*/
public $trans = array();
/**
* @var bool
*/
public $has_type;
}