|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
abstract class Kint_Renderer_Rich_Plugin |
|
|
|
|
|
|
4
|
|
|
{ |
|
5
|
|
|
protected $renderer; |
|
6
|
|
|
|
|
7
|
|
|
public function __construct(Kint_Renderer_Rich $r) |
|
|
|
|
|
|
8
|
|
|
{ |
|
9
|
|
|
$this->renderer = $r; |
|
10
|
|
|
} |
|
11
|
|
|
|
|
12
|
|
|
/** |
|
13
|
|
|
* Renders a locked header. |
|
14
|
|
|
* |
|
15
|
|
|
* This is a placeholder until Kint 3 when it can be renamed to |
|
16
|
|
|
* renderLockedHeader after the deprecated static method is removed |
|
17
|
|
|
*/ |
|
18
|
|
|
public function renderHeaderLocked(Kint_Object $o, $content) |
|
|
|
|
|
|
19
|
|
|
{ |
|
20
|
|
|
$header = '<dt class="kint-parent kint-locked">'; |
|
21
|
|
|
|
|
22
|
|
View Code Duplication |
if (Kint_Renderer_Rich::$access_paths && $o->depth > 0 && $ap = $o->getAccessPath()) { |
|
|
|
|
|
|
23
|
|
|
$header .= '<span class="kint-access-path-trigger" title="Show access path">⇄</span>'; |
|
24
|
|
|
} |
|
25
|
|
|
|
|
26
|
|
|
$header .= '<span class="kint-popup-trigger" title="Open in new window">→</span><nav></nav>'; |
|
27
|
|
|
|
|
28
|
|
|
if (($s = $o->getModifiers()) !== null) { |
|
|
|
|
|
|
29
|
|
|
$header .= '<var>'.$s.'</var> '; |
|
30
|
|
|
} |
|
31
|
|
|
|
|
32
|
|
View Code Duplication |
if (($s = $o->getName()) !== null) { |
|
|
|
|
|
|
33
|
|
|
$header .= '<dfn>'.$this->renderer->escape($s).'</dfn> '; |
|
34
|
|
|
|
|
35
|
|
|
if ($s = $o->getOperator()) { |
|
36
|
|
|
$header .= $this->renderer->escape($s, 'ASCII').' '; |
|
|
|
|
|
|
37
|
|
|
} |
|
38
|
|
|
} |
|
39
|
|
|
|
|
40
|
|
|
if (($s = $o->getType()) !== null) { |
|
41
|
|
|
$s = $this->renderer->escape($s); |
|
42
|
|
|
|
|
43
|
|
|
if ($o->reference) { |
|
44
|
|
|
$s = '&'.$s; |
|
45
|
|
|
} |
|
46
|
|
|
|
|
47
|
|
|
$header .= '<var>'.$s.'</var> '; |
|
48
|
|
|
} |
|
49
|
|
|
|
|
50
|
|
View Code Duplication |
if (($s = $o->getSize()) !== null) { |
|
|
|
|
|
|
51
|
|
|
$header .= '('.$this->renderer->escape($s).') '; |
|
52
|
|
|
} |
|
53
|
|
|
|
|
54
|
|
|
$header .= $content; |
|
55
|
|
|
|
|
56
|
|
|
if (!empty($ap)) { |
|
57
|
|
|
$header .= '<div class="access-path">'.$this->renderer->escape($ap).'</div>'; |
|
58
|
|
|
} |
|
59
|
|
|
|
|
60
|
|
|
return $header.'</dt>'; |
|
61
|
|
|
} |
|
62
|
|
|
|
|
63
|
|
|
public static function renderLockedHeader(Kint_Object $o, $content) |
|
|
|
|
|
|
64
|
|
|
{ |
|
65
|
|
|
static $show_dep = true; |
|
66
|
|
|
|
|
67
|
|
View Code Duplication |
if ($show_dep) { |
|
|
|
|
|
|
68
|
|
|
trigger_error('Kint_Renderer_Rich_Plugin::renderLockedHeader() is deprecated and will be removed in Kint 3.0. Use renderHeaderLocked instead.', KINT_PHP53 ? E_USER_DEPRECATED : E_USER_NOTICE); |
|
69
|
|
|
$show_dep = false; |
|
|
|
|
|
|
70
|
|
|
} |
|
71
|
|
|
|
|
72
|
|
|
$header = '<dt class="kint-parent kint-locked">'; |
|
73
|
|
|
|
|
74
|
|
View Code Duplication |
if (Kint_Renderer_Rich::$access_paths && $o->depth > 0 && $ap = $o->getAccessPath()) { |
|
|
|
|
|
|
75
|
|
|
$header .= '<span class="kint-access-path-trigger" title="Show access path">⇄</span>'; |
|
76
|
|
|
} |
|
77
|
|
|
|
|
78
|
|
|
$header .= '<span class="kint-popup-trigger" title="Open in new window">→</span><nav></nav>'; |
|
79
|
|
|
|
|
80
|
|
|
if (($s = $o->getModifiers()) !== null) { |
|
|
|
|
|
|
81
|
|
|
$header .= '<var>'.$s.'</var> '; |
|
82
|
|
|
} |
|
83
|
|
|
|
|
84
|
|
View Code Duplication |
if (($s = $o->getName()) !== null) { |
|
|
|
|
|
|
85
|
|
|
$header .= '<dfn>'.Kint_Object_Blob::escape($s).'</dfn> '; |
|
86
|
|
|
|
|
87
|
|
|
if ($s = $o->getOperator()) { |
|
88
|
|
|
$header .= Kint_Object_Blob::escape($s, 'ASCII').' '; |
|
|
|
|
|
|
89
|
|
|
} |
|
90
|
|
|
} |
|
91
|
|
|
|
|
92
|
|
View Code Duplication |
if (($s = $o->getType()) !== null) { |
|
|
|
|
|
|
93
|
|
|
$s = Kint_Object_Blob::escape($s); |
|
94
|
|
|
|
|
95
|
|
|
if ($o->reference) { |
|
96
|
|
|
$s = '&'.$s; |
|
97
|
|
|
} |
|
98
|
|
|
|
|
99
|
|
|
$header .= '<var>'.$s.'</var> '; |
|
100
|
|
|
} |
|
101
|
|
|
|
|
102
|
|
View Code Duplication |
if (($s = $o->getSize()) !== null) { |
|
|
|
|
|
|
103
|
|
|
$header .= '('.Kint_Object_Blob::escape($s).') '; |
|
104
|
|
|
} |
|
105
|
|
|
|
|
106
|
|
|
$header .= $content; |
|
107
|
|
|
|
|
108
|
|
|
if (!empty($ap)) { |
|
109
|
|
|
$header .= '<div class="access-path">'.Kint_Object_Blob::escape($ap).'</div>'; |
|
110
|
|
|
} |
|
111
|
|
|
|
|
112
|
|
|
return $header.'</dt>'; |
|
113
|
|
|
} |
|
114
|
|
|
|
|
115
|
|
|
abstract public function render($o); |
|
|
|
|
|
|
116
|
|
|
} |
|
117
|
|
|
|
This check examines a number of code elements and verifies that they conform to the given naming conventions.
You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.