Skip to content

Commit a7b9bdd

Browse files
committed
* bump jquery url to 3.7.1
* fix iterating over cases * compatibility with PHPDebugConsole 3.2
1 parent e98b749 commit a7b9bdd

8 files changed

Lines changed: 110 additions & 86 deletions

File tree

src/WampClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function __construct(Debug $debug, $cfg = array())
3737
$this->debug = $debug;
3838
$this->request = $debug->serverRequest;
3939
$this->cfg = \array_merge(array(
40-
'jquery' => '//ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js',
40+
'jquery' => '//ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js',
4141
'bootstrapJs' => '//stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js',
4242
'bootstrapCss' => '//stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css',
4343
'filepathScript' => __DIR__ . '/js/main.min.js',

src/js/main.js

Lines changed: 54 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -2836,6 +2836,7 @@
28362836
objClassName : abs.className,
28372837
phpDocOutput : abs.cfgFlags & this.valDumper.objectDumper.PHPDOC_OUTPUT,
28382838
}, cfg);
2839+
delete abs[what].__debug_key_order__;
28392840
if (cfg.groupByInheritance === false) {
28402841
return this.dumpItemsFiltered(abs[what], cfg)
28412842
}
@@ -2931,11 +2932,11 @@
29312932

29322933
Cases.prototype.dump = function (abs) {
29332934
var cfg = {
2934-
attributeOutput : abs.cfgFlags & this.CASE_ATTRIBUTE_OUTPUT,
2935-
collect : abs.cfgFlags & this.CASE_COLLECT,
2935+
attributeOutput : abs.cfgFlags & this.valDumper.objectDumper.CASE_ATTRIBUTE_OUTPUT,
2936+
collect : abs.cfgFlags & this.valDumper.objectDumper.CASE_COLLECT,
29362937
groupByInheritance : false,
2937-
output : abs.cfgFlags & this.CASE_OUTPUT,
2938-
phpDocOutput : abs.cfgFlags & this.PHPDOC_OUTPUT,
2938+
output : abs.cfgFlags & this.valDumper.objectDumper.CASE_OUTPUT,
2939+
phpDocOutput : abs.cfgFlags & this.valDumper.objectDumper.PHPDOC_OUTPUT,
29392940
};
29402941
if (abs.implementsList.indexOf('UnitEnum') < 0) {
29412942
return ''
@@ -2946,7 +2947,7 @@
29462947
if (!cfg.collect) {
29472948
return '<dt class="cases">cases <i>not collected</i></dt>'
29482949
}
2949-
if (abs.cases.length === 0) {
2950+
if (Object.keys(abs.cases).length < 1) {
29502951
return '<dt class="cases"><i>no cases!</i></dt>'
29512952
}
29522953
return '<dt class="cases">cases</dt>' +
@@ -2958,10 +2959,10 @@
29582959
? info.desc
29592960
: null;
29602961
var $element = $$1('<div></div>')
2961-
.html('<span class="t_identifier">' + key + '</span>' +
2962-
(info.value !== null
2962+
.html('<span class="t_identifier">' + name + '</span>' +
2963+
(info.value !== this.valDumper.UNDEFINED
29632964
? ' <span class="t_operator">=</span> ' +
2964-
self.dumper.dump(info.value)
2965+
this.valDumper.dump(info.value)
29652966
: ''
29662967
)
29672968
);
@@ -3011,7 +3012,7 @@
30113012
if (!cfg.collect) {
30123013
return '<dt class="constants">constants <i>not collected</i></dt>'
30133014
}
3014-
if (!abs.constants.length) {
3015+
if (Object.keys(abs.constants).length < 1) {
30153016
return ''
30163017
}
30173018
return '<dt class="constants">constants</dt>' +
@@ -3073,6 +3074,9 @@
30733074
if (info.phpDoc && info.phpDoc.deprecated) {
30743075
$element.attr('data-deprecated-desc', info.phpDoc.deprecated[0].desc);
30753076
}
3077+
if (cfg.phpDocOutput && info.phpDoc && info.phpDoc.throws) {
3078+
$element.attr('data-throws', JSON.stringify(info.phpDoc.throws));
3079+
}
30763080
};
30773081

30783082
Methods.prototype.dump = function (abs) {
@@ -3134,15 +3138,15 @@
31343138
};
31353139

31363140
Methods.prototype.dumpName = function (name, info, cfg) {
3137-
var title = cfg.phpDocOutput
3138-
? (info.phpDoc.summary +
3139-
(cfg.methodDescOutput
3140-
? "\n\n" + info.phpDoc.desc
3141-
: ''
3142-
)).trim()
3143-
: '';
3141+
var titleParts = [
3142+
info.phpDoc.summary || '',
3143+
cfg.methodDescOutput
3144+
? info.phpDoc.desc || ''
3145+
: '',
3146+
];
3147+
var title = titleParts.join("\n\n").trim();
31443148
return ' <span class="t_identifier"' +
3145-
(title !== ''
3149+
(cfg.phpDocOutput && title !== ''
31463150
? ' title="' + title.escapeHtml() + '"'
31473151
: ''
31483152
) +
@@ -3215,7 +3219,7 @@
32153219
Methods.prototype.dumpStaticVars = function (info, cfg) {
32163220
var self = this;
32173221
var html = '';
3218-
if (!cfg.staticVarOutput || info.staticVars.length < 0) {
3222+
if (!cfg.staticVarOutput || info.staticVars.length < 1) {
32193223
return ''
32203224
}
32213225
html = '<h3>static variables</h3>';
@@ -3444,34 +3448,11 @@
34443448

34453449
DumpObject.prototype.dump = function (abs) {
34463450
// console.info('dumpObject', abs)
3447-
var classDefinition;
34483451
var html = '';
3449-
var i = 0;
3450-
var count;
34513452
var strClassname = '';
3452-
var noInherit = ['attributes', 'cases', 'constants', 'methods', 'properties'];
34533453
var dumpOpts = this.dumper.getDumpOpts();
34543454
try {
3455-
classDefinition = this.dumper.getClassDefinition(abs.classDefinition);
3456-
if (abs.isRecursion || abs.isExcluded) {
3457-
for (i = 0; i < noInherit.length; i++) {
3458-
classDefinition[noInherit[i]] = {};
3459-
}
3460-
}
3461-
abs = JSON.parse(JSON.stringify(mergeWith_1({}, classDefinition, abs, function (objValue, srcValue) {
3462-
if (objValue === null || srcValue === null) {
3463-
return
3464-
}
3465-
if (typeof srcValue === 'object' && typeof objValue === 'object' && Object.keys(objValue).length === 0) {
3466-
return srcValue
3467-
}
3468-
})));
3469-
for (i = 0, count = noInherit.length; i < count; i++) {
3470-
if (Object.keys(abs[noInherit[i]]).length < 2) {
3471-
continue
3472-
}
3473-
abs[noInherit[i]] = sort(abs[noInherit[i]], abs.sort);
3474-
}
3455+
abs = this.mergeInherited(abs);
34753456
if (typeof abs.cfgFlags === 'undefined') {
34763457
abs.cfgFlags = 0x1FFFFFF & ~this.BRIEF;
34773458
}
@@ -3776,6 +3757,37 @@
37763757
return '<span class="t_type">' + type + '</span>'
37773758
};
37783759

3760+
DumpObject.prototype.mergeInherited = function (abs) {
3761+
var count;
3762+
var i = 0;
3763+
var inherited;
3764+
var noInherit = ['attributes', 'cases', 'constants', 'methods', 'properties'];
3765+
while (abs.inheritsFrom) {
3766+
inherited = this.dumper.getClassDefinition(abs.inheritsFrom);
3767+
if (abs.isRecursion || abs.isExcluded) {
3768+
for (i = 0, count = noInherit.length; i < count; i++) {
3769+
inherited[noInherit[i]] = {};
3770+
}
3771+
}
3772+
abs = JSON.parse(JSON.stringify(mergeWith_1({}, inherited, abs, function (objValue, srcValue) {
3773+
if (objValue === null || srcValue === null) {
3774+
return
3775+
}
3776+
if (typeof srcValue === 'object' && typeof objValue === 'object' && Object.keys(objValue).length === 0) {
3777+
return srcValue
3778+
}
3779+
})));
3780+
abs.inheritsFrom = inherited.inheritsFrom;
3781+
}
3782+
for (i = 0, count = noInherit.length; i < count; i++) {
3783+
if (Object.keys(abs[noInherit[i]]).length < 2) {
3784+
continue
3785+
}
3786+
abs[noInherit[i]] = sort(abs[noInherit[i]], abs.sort);
3787+
}
3788+
return abs
3789+
};
3790+
37793791
var base64Arraybuffer = createCommonjsModule(function (module, exports) {
37803792
/*
37813793
* base64-arraybuffer

src/js/main.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/js_src/Logger/DumpObject.js

Lines changed: 32 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -111,35 +111,12 @@ function sort(obj, sortBy) {
111111

112112
DumpObject.prototype.dump = function (abs) {
113113
// console.info('dumpObject', abs)
114-
var classDefinition
115114
var html = ''
116-
var i = 0
117-
var count
118115
var self = this
119116
var strClassname = ''
120-
var noInherit = ['attributes', 'cases', 'constants', 'methods', 'properties']
121117
var dumpOpts = this.dumper.getDumpOpts()
122118
try {
123-
classDefinition = this.dumper.getClassDefinition(abs.classDefinition)
124-
if (abs.isRecursion || abs.isExcluded) {
125-
for (i = 0; i < noInherit.length; i++) {
126-
classDefinition[noInherit[i]] = {}
127-
}
128-
}
129-
abs = JSON.parse(JSON.stringify(mergeWith({}, classDefinition, abs, function (objValue, srcValue) {
130-
if (objValue === null || srcValue === null) {
131-
return
132-
}
133-
if (typeof srcValue === 'object' && typeof objValue === 'object' && Object.keys(objValue).length === 0) {
134-
return srcValue
135-
}
136-
})))
137-
for (i = 0, count = noInherit.length; i < count; i++) {
138-
if (Object.keys(abs[noInherit[i]]).length < 2) {
139-
continue
140-
}
141-
abs[noInherit[i]] = sort(abs[noInherit[i]], abs.sort)
142-
}
119+
abs = this.mergeInherited(abs)
143120
if (typeof abs.cfgFlags === 'undefined') {
144121
abs.cfgFlags = 0x1FFFFFF & ~this.BRIEF
145122
}
@@ -443,3 +420,34 @@ DumpObject.prototype.markupTypePart = function (type) {
443420
}
444421
return '<span class="t_type">' + type + '</span>'
445422
}
423+
424+
DumpObject.prototype.mergeInherited = function (abs) {
425+
var count
426+
var i = 0
427+
var inherited
428+
var noInherit = ['attributes', 'cases', 'constants', 'methods', 'properties']
429+
while (abs.inheritsFrom) {
430+
inherited = this.dumper.getClassDefinition(abs.inheritsFrom)
431+
if (abs.isRecursion || abs.isExcluded) {
432+
for (i = 0, count = noInherit.length; i < count; i++) {
433+
inherited[noInherit[i]] = {}
434+
}
435+
}
436+
abs = JSON.parse(JSON.stringify(mergeWith({}, inherited, abs, function (objValue, srcValue) {
437+
if (objValue === null || srcValue === null) {
438+
return
439+
}
440+
if (typeof srcValue === 'object' && typeof objValue === 'object' && Object.keys(objValue).length === 0) {
441+
return srcValue
442+
}
443+
})))
444+
abs.inheritsFrom = inherited.inheritsFrom
445+
}
446+
for (i = 0, count = noInherit.length; i < count; i++) {
447+
if (Object.keys(abs[noInherit[i]]).length < 2) {
448+
continue
449+
}
450+
abs[noInherit[i]] = sort(abs[noInherit[i]], abs.sort)
451+
}
452+
return abs
453+
}

src/js_src/Logger/Object/Cases.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ Cases.prototype.addAttribs = function ($element, info, cfg) {
1919
Cases.prototype.dump = function (abs) {
2020
var self = this
2121
var cfg = {
22-
attributeOutput : abs.cfgFlags & this.CASE_ATTRIBUTE_OUTPUT,
23-
collect : abs.cfgFlags & this.CASE_COLLECT,
22+
attributeOutput : abs.cfgFlags & this.valDumper.objectDumper.CASE_ATTRIBUTE_OUTPUT,
23+
collect : abs.cfgFlags & this.valDumper.objectDumper.CASE_COLLECT,
2424
groupByInheritance : false,
25-
output : abs.cfgFlags & this.CASE_OUTPUT,
26-
phpDocOutput : abs.cfgFlags & this.PHPDOC_OUTPUT,
25+
output : abs.cfgFlags & this.valDumper.objectDumper.CASE_OUTPUT,
26+
phpDocOutput : abs.cfgFlags & this.valDumper.objectDumper.PHPDOC_OUTPUT,
2727
}
2828
if (abs.implementsList.indexOf('UnitEnum') < 0) {
2929
return ''
@@ -34,7 +34,7 @@ Cases.prototype.dump = function (abs) {
3434
if (!cfg.collect) {
3535
return '<dt class="cases">cases <i>not collected</i></dt>'
3636
}
37-
if (abs.cases.length === 0) {
37+
if (Object.keys(abs.cases).length < 1) {
3838
return '<dt class="cases"><i>no cases!</i></dt>'
3939
}
4040
return '<dt class="cases">cases</dt>' +
@@ -46,10 +46,10 @@ Cases.prototype.dumpInner = function (name, info, cfg) {
4646
? info.desc
4747
: null
4848
var $element = $('<div></div>')
49-
.html('<span class="t_identifier">' + key + '</span>' +
50-
(info.value !== null
49+
.html('<span class="t_identifier">' + name + '</span>' +
50+
(info.value !== this.valDumper.UNDEFINED
5151
? ' <span class="t_operator">=</span> ' +
52-
self.dumper.dump(info.value)
52+
this.valDumper.dump(info.value)
5353
: ''
5454
)
5555
)

src/js_src/Logger/Object/Constants.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Constants.prototype.dump = function (abs) {
4141
if (!cfg.collect) {
4242
return '<dt class="constants">constants <i>not collected</i></dt>'
4343
}
44-
if (!abs.constants.length) {
44+
if (Object.keys(abs.constants).length < 1) {
4545
return ''
4646
}
4747
return '<dt class="constants">constants</dt>' +

src/js_src/Logger/Object/Methods.js

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ Methods.prototype.addAttribs = function ($element, info, cfg) {
3434
if (info.phpDoc && info.phpDoc.deprecated) {
3535
$element.attr('data-deprecated-desc', info.phpDoc.deprecated[0].desc)
3636
}
37+
if (cfg.phpDocOutput && info.phpDoc && info.phpDoc.throws) {
38+
$element.attr('data-throws', JSON.stringify(info.phpDoc.throws))
39+
}
3740
}
3841

3942
Methods.prototype.dump = function (abs) {
@@ -95,15 +98,15 @@ Methods.prototype.dumpModifiers = function (info) {
9598
}
9699

97100
Methods.prototype.dumpName = function (name, info, cfg) {
98-
var title = cfg.phpDocOutput
99-
? (info.phpDoc.summary +
100-
(cfg.methodDescOutput
101-
? "\n\n" + info.phpDoc.desc
102-
: ''
103-
)).trim()
104-
: ''
101+
var titleParts = [
102+
info.phpDoc.summary || '',
103+
cfg.methodDescOutput
104+
? info.phpDoc.desc || ''
105+
: '',
106+
]
107+
var title = titleParts.join("\n\n").trim()
105108
return ' <span class="t_identifier"' +
106-
(title !== ''
109+
(cfg.phpDocOutput && title !== ''
107110
? ' title="' + title.escapeHtml() + '"'
108111
: ''
109112
) +
@@ -176,7 +179,7 @@ Methods.prototype.dumpReturn = function (info, cfg) {
176179
Methods.prototype.dumpStaticVars = function (info, cfg) {
177180
var self = this
178181
var html = ''
179-
if (!cfg.staticVarOutput || info.staticVars.length < 0) {
182+
if (!cfg.staticVarOutput || info.staticVars.length < 1) {
180183
return ''
181184
}
182185
html = '<h3>static variables</h3>'

src/js_src/Logger/Object/SectionPrototype.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export var sectionPrototype = {
99
objClassName : abs.className,
1010
phpDocOutput : abs.cfgFlags & this.valDumper.objectDumper.PHPDOC_OUTPUT,
1111
}, cfg)
12+
delete abs[what].__debug_key_order__
1213
if (cfg.groupByInheritance === false) {
1314
return this.dumpItemsFiltered(abs[what], cfg)
1415
}

0 commit comments

Comments
 (0)