|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace BestServedCold\HTMLBuilder; |
|
4
|
|
|
|
|
5
|
|
|
use BestServedCold\HTMLBuilder\Html\Node, |
|
6
|
|
|
BestServedCold\HTMLBuilder\Html\Special, |
|
7
|
|
|
BestServedCold\HTMLBuilder\Html\Node\Element, |
|
8
|
|
|
InvalidArgumentException; |
|
9
|
|
|
|
|
10
|
|
|
/** |
|
11
|
|
|
* Class Html |
|
12
|
|
|
* |
|
13
|
|
|
* @package BestServedCold\HTMLBuilder |
|
14
|
|
|
* @method static Node a(false|null|array|\Closure|Node ...$arguments) |
|
15
|
|
|
* @method static Node abbr(false|null|array|\Closure|Node ...$arguments) |
|
16
|
|
|
* @method static Node address(false|null|array|\Closure|Node ...$arguments) |
|
17
|
|
|
* @method static Node area(false|null|array|\Closure|Node ...$arguments) |
|
18
|
|
|
* @method static Node article(false|null|array|\Closure|Node ...$arguments) |
|
19
|
|
|
* @method static Node aside(false|null|array|\Closure|Node ...$arguments) |
|
20
|
|
|
* @method static Node audio(false|null|array|\Closure|Node ...$arguments) |
|
21
|
|
|
* @method static Node b(false|null|array|\Closure|Node ...$arguments) |
|
22
|
|
|
* @method static Node base(false|null|array|\Closure|Node ...$arguments) |
|
23
|
|
|
* @method static Node bdi(false|null|array|\Closure|Node ...$arguments) |
|
24
|
|
|
* @method static Node bdo(false|null|array|\Closure|Node ...$arguments) |
|
25
|
|
|
* @method static Node blockquote(false|null|array|\Closure|Node ...$arguments) |
|
26
|
|
|
* @method static Node body(false|null|array|\Closure|Node ...$arguments) |
|
27
|
|
|
* @method static Node br(false|null|array|\Closure|Node ...$arguments) |
|
28
|
|
|
* @method static Node button(false|null|array|\Closure|Node ...$arguments) |
|
29
|
|
|
* @method static Node canvas(false|null|array|\Closure|Node ...$arguments) |
|
30
|
|
|
* @method static Node caption(false|null|array|\Closure|Node ...$arguments) |
|
31
|
|
|
* @method static Node cite(false|null|array|\Closure|Node ...$arguments) |
|
32
|
|
|
* @method static Node code(false|null|array|\Closure|Node ...$arguments) |
|
33
|
|
|
* @method static Node col(false|null|array|\Closure|Node ...$arguments) |
|
34
|
|
|
* @method static Node colgroup(false|null|array|\Closure|Node ...$arguments) |
|
35
|
|
|
* @method static Node datalist(false|null|array|\Closure|Node ...$arguments) |
|
36
|
|
|
* @method static Node dd(false|null|array|\Closure|Node ...$arguments) |
|
37
|
|
|
* @method static Node del(false|null|array|\Closure|Node ...$arguments) |
|
38
|
|
|
* @method static Node details(false|null|array|\Closure|Node ...$arguments) |
|
39
|
|
|
* @method static Node dfn(false|null|array|\Closure|Node ...$arguments) |
|
40
|
|
|
* @method static Node dialog(false|null|array|\Closure|Node ...$arguments) |
|
41
|
|
|
* @method static Node div(false|null|array|\Closure|Node ...$arguments) |
|
42
|
|
|
* @method static Node dl(false|null|array|\Closure|Node ...$arguments) |
|
43
|
|
|
* @method static Node dt(false|null|array|\Closure|Node ...$arguments) |
|
44
|
|
|
* @method static Node em(false|null|array|\Closure|Node ...$arguments) |
|
45
|
|
|
* @method static Node embed(false|null|array|\Closure|Node ...$arguments) |
|
46
|
|
|
* @method static Node fieldset(false|null|array|\Closure|Node ...$arguments) |
|
47
|
|
|
* @method static Node figcaption(false|null|array|\Closure|Node ...$arguments) |
|
48
|
|
|
* @method static Node figure(false|null|array|\Closure|Node ...$arguments) |
|
49
|
|
|
* @method static Node footer(false|null|array|\Closure|Node ...$arguments) |
|
50
|
|
|
* @method static Node form(false|null|array|\Closure|Node ...$arguments) |
|
51
|
|
|
* @method static Node h1(false|null|array|\Closure|Node ...$arguments) |
|
52
|
|
|
* @method static Node h2(false|null|array|\Closure|Node ...$arguments) |
|
53
|
|
|
* @method static Node h3(false|null|array|\Closure|Node ...$arguments) |
|
54
|
|
|
* @method static Node h4(false|null|array|\Closure|Node ...$arguments) |
|
55
|
|
|
* @method static Node h5(false|null|array|\Closure|Node ...$arguments) |
|
56
|
|
|
* @method static Node h6(false|null|array|\Closure|Node ...$arguments) |
|
57
|
|
|
* @method static Node head(false|null|array|\Closure|Node ...$arguments) |
|
58
|
|
|
* @method static Node header(false|null|array|\Closure|Node ...$arguments) |
|
59
|
|
|
* @method static Node hr(false|null|array|\Closure|Node ...$arguments) |
|
60
|
|
|
* @method static Node html(false|null|array|\Closure|Node ...$arguments) |
|
61
|
|
|
* @method static Node i(false|null|array|\Closure|Node ...$arguments) |
|
62
|
|
|
* @method static Node iframe(false|null|array|\Closure|Node ...$arguments) |
|
63
|
|
|
* @method static Node img(false|null|array|\Closure|Node ...$arguments) |
|
64
|
|
|
* @method static Node input(false|null|array|\Closure|Node ...$arguments) |
|
65
|
|
|
* @method static Node ins(false|null|array|\Closure|Node ...$arguments) |
|
66
|
|
|
* @method static Node kbd(false|null|array|\Closure|Node ...$arguments) |
|
67
|
|
|
* @method static Node keygen(false|null|array|\Closure|Node ...$arguments) |
|
68
|
|
|
* @method static Node label(false|null|array|\Closure|Node ...$arguments) |
|
69
|
|
|
* @method static Node legend(false|null|array|\Closure|Node ...$arguments) |
|
70
|
|
|
* @method static Node li(false|null|array|\Closure|Node ...$arguments) |
|
71
|
|
|
* @method static Node link(false|null|array|\Closure|Node ...$arguments) |
|
72
|
|
|
* @method static Node main(false|null|array|\Closure|Node ...$arguments) |
|
73
|
|
|
* @method static Node map(false|null|array|\Closure|Node ...$arguments) |
|
74
|
|
|
* @method static Node mark(false|null|array|\Closure|Node ...$arguments) |
|
75
|
|
|
* @method static Node menu(false|null|array|\Closure|Node ...$arguments) |
|
76
|
|
|
* @method static Node menuitem(false|null|array|\Closure|Node ...$arguments) |
|
77
|
|
|
* @method static Node meta(false|null|array|\Closure|Node ...$arguments) |
|
78
|
|
|
* @method static Node meter(false|null|array|\Closure|Node ...$arguments) |
|
79
|
|
|
* @method static Node nav(false|null|array|\Closure|Node ...$arguments) |
|
80
|
|
|
* @method static Node noscript(false|null|array|\Closure|Node ...$arguments) |
|
81
|
|
|
* @method static Node object(false|null|array|\Closure|Node ...$arguments) |
|
82
|
|
|
* @method static Node ol(false|null|array|\Closure|Node ...$arguments) |
|
83
|
|
|
* @method static Node optgroup(false|null|array|\Closure|Node ...$arguments) |
|
84
|
|
|
* @method static Node option(false|null|array|\Closure|Node ...$arguments) |
|
85
|
|
|
* @method static Node output(false|null|array|\Closure|Node ...$arguments) |
|
86
|
|
|
* @method static Node p(false|null|array|\Closure|Node ...$arguments) |
|
87
|
|
|
* @method static Node param(false|null|array|\Closure|Node ...$arguments) |
|
88
|
|
|
* @method static Node picture(false|null|array|\Closure|Node ...$arguments) |
|
89
|
|
|
* @method static Node pre(false|null|array|\Closure|Node ...$arguments) |
|
90
|
|
|
* @method static Node progress(false|null|array|\Closure|Node ...$arguments) |
|
91
|
|
|
* @method static Node q(false|null|array|\Closure|Node ...$arguments) |
|
92
|
|
|
* @method static Node rp(false|null|array|\Closure|Node ...$arguments) |
|
93
|
|
|
* @method static Node rt(false|null|array|\Closure|Node ...$arguments) |
|
94
|
|
|
* @method static Node ruby(false|null|array|\Closure|Node ...$arguments) |
|
95
|
|
|
* @method static Node s(false|null|array|\Closure|Node ...$arguments) |
|
96
|
|
|
* @method static Node samp(false|null|array|\Closure|Node ...$arguments) |
|
97
|
|
|
* @method static Node script(false|null|array|\Closure|Node ...$arguments) |
|
98
|
|
|
* @method static Node section(false|null|array|\Closure|Node ...$arguments) |
|
99
|
|
|
* @method static Node select(false|null|array|\Closure|Node ...$arguments) |
|
100
|
|
|
* @method static Node small(false|null|array|\Closure|Node ...$arguments) |
|
101
|
|
|
* @method static Node source(false|null|array|\Closure|Node ...$arguments) |
|
102
|
|
|
* @method static Node span(false|null|array|\Closure|Node ...$arguments) |
|
103
|
|
|
* @method static Node strong(false|null|array|\Closure|Node ...$arguments) |
|
104
|
|
|
* @method static Node style(false|null|array|\Closure|Node ...$arguments) |
|
105
|
|
|
* @method static Node sub(false|null|array|\Closure|Node ...$arguments) |
|
106
|
|
|
* @method static Node summary(false|null|array|\Closure|Node ...$arguments) |
|
107
|
|
|
* @method static Node sup(false|null|array|\Closure|Node ...$arguments) |
|
108
|
|
|
* @method static Node table(false|null|array|\Closure|Node ...$arguments) |
|
109
|
|
|
* @method static Node tbody(false|null|array|\Closure|Node ...$arguments) |
|
110
|
|
|
* @method static Node td(false|null|array|\Closure|Node ...$arguments) |
|
111
|
|
|
* @method static Node textarea(false|null|array|\Closure|Node ...$arguments) |
|
112
|
|
|
* @method static Node tfoot(false|null|array|\Closure|Node ...$arguments) |
|
113
|
|
|
* @method static Node th(false|null|array|\Closure|Node ...$arguments) |
|
114
|
|
|
* @method static Node thead(false|null|array|\Closure|Node ...$arguments) |
|
115
|
|
|
* @method static Node time(false|null|array|\Closure|Node ...$arguments) |
|
116
|
|
|
* @method static Node title(false|null|array|\Closure|Node ...$arguments) |
|
117
|
|
|
* @method static Node tr(false|null|array|\Closure|Node ...$arguments) |
|
118
|
|
|
* @method static Node track(false|null|array|\Closure|Node ...$arguments) |
|
119
|
|
|
* @method static Node u(false|null|array|\Closure|Node ...$arguments) |
|
120
|
|
|
* @method static Node ul(false|null|array|\Closure|Node ...$arguments) |
|
121
|
|
|
* @method static Node var(false|null|array|\Closure|Node ...$arguments) |
|
122
|
|
|
* @method static Node video(false|null|array|\Closure|Node ...$arguments) |
|
123
|
|
|
* @method static Node wbr(false|null|array|\Closure|Node ...$arguments) |
|
124
|
|
|
*/ |
|
125
|
|
|
abstract class Html |
|
126
|
|
|
{ |
|
127
|
|
|
use Special; |
|
128
|
|
|
|
|
129
|
|
|
/** |
|
130
|
|
|
* Static over loader |
|
131
|
|
|
* |
|
132
|
|
|
* @param string $name |
|
133
|
|
|
* @param array $arguments |
|
134
|
|
|
* @return Node |
|
135
|
|
|
* @throws InvalidArgumentException |
|
136
|
|
|
*/ |
|
137
|
1 |
|
public static function __callStatic($name, $arguments) |
|
138
|
|
|
{ |
|
139
|
1 |
|
if (Element::isElement($name)) { |
|
140
|
1 |
|
return new Node($name, $arguments, Element::isVoid($name)); |
|
141
|
|
|
} |
|
142
|
|
|
|
|
143
|
1 |
|
throw new InvalidArgumentException('Method [' . $name . '] does not exist in context [' . self::class . '].'); |
|
144
|
|
|
} |
|
145
|
|
|
} |
|
146
|
|
|
|