Skip to content

Commit e83962e

Browse files
committed
Fix static methods
1 parent 513bc65 commit e83962e

File tree

1 file changed

+36
-13
lines changed

1 file changed

+36
-13
lines changed

src/Html.php

Lines changed: 36 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,6 @@
77

88
/**
99
* @method class(...$arguments)
10-
* @method static a(...$arguments)
11-
* @method static button(...$arguments)
12-
* @method static div(...$arguments)
13-
* @method static input(...$arguments)
14-
* @method static li(...$arguments)
15-
* @method static p(...$arguments)
16-
* @method static img(...$arguments)
17-
* @method static span(...$arguments)
18-
* @method static ul(...$arguments)
19-
* @method static table(...$arguments)
20-
* @method static tbody(...$arguments)
21-
* @method static td(...$arguments)
22-
* @method static tr(...$arguments)
2310
*
2411
* @mixin Html
2512
*/
@@ -423,6 +410,7 @@ public static function icon(string $icon, string|int $size = 0, string $tag = 'i
423410

424411
$icon_array = explode(',', $icon, 2);
425412
$icon = Arr::get($icon_array, 0);
413+
426414
if (Arr::has($icon_array, 1)) {
427415
$attributes = explode(',', Arr::get($icon_array, 1, ''));
428416
}
@@ -433,8 +421,10 @@ public static function icon(string $icon, string|int $size = 0, string $tag = 'i
433421
} else {
434422
$type = config('html.icon.default.type', 'l');
435423
}
424+
436425
$icon = ($icon[0] === '-') ? substr($icon, 1) : 'fa-'.$icon;
437426
$size = ($size > 0) ? ' fa-'.$size : '';
427+
438428
$fa = self::$tag()->addClass('fa'.$type.' fa-fw '.$icon.$size)->aria('hidden', 'true');
439429

440430
if (isset($attributes) && is_array($attributes)) {
@@ -1073,66 +1063,99 @@ public function __call($tag, $arguments): Html
10731063

10741064
public static function a(...$arguments)
10751065
{
1066+
array_unshift($arguments, 'a');
1067+
10761068
return self::createElement(...$arguments);
10771069
}
10781070

10791071
public static function button(...$arguments)
10801072
{
1073+
array_unshift($arguments, 'button');
1074+
10811075
return self::createElement(...$arguments);
10821076
}
10831077

10841078
public static function div(...$arguments)
10851079
{
1080+
array_unshift($arguments, 'div');
1081+
10861082
return self::createElement(...$arguments);
10871083
}
10881084

10891085
public static function input(...$arguments)
10901086
{
1087+
array_unshift($arguments, 'input');
1088+
1089+
return self::createElement(...$arguments);
1090+
}
1091+
1092+
public static function textarea(...$arguments)
1093+
{
1094+
array_unshift($arguments, 'textarea');
1095+
10911096
return self::createElement(...$arguments);
10921097
}
10931098

10941099
public static function li(...$arguments)
10951100
{
1101+
array_unshift($arguments, 'li');
1102+
10961103
return self::createElement(...$arguments);
10971104
}
10981105

10991106
public static function p(...$arguments)
11001107
{
1108+
array_unshift($arguments, 'p');
1109+
11011110
return self::createElement(...$arguments);
11021111
}
11031112

11041113
public static function img(...$arguments)
11051114
{
1115+
array_unshift($arguments, 'img');
1116+
11061117
return self::createElement(...$arguments);
11071118
}
11081119

11091120
public static function span(...$arguments)
11101121
{
1122+
array_unshift($arguments, 'span');
1123+
11111124
return self::createElement(...$arguments);
11121125
}
11131126

11141127
public static function ul(...$arguments)
11151128
{
1129+
array_unshift($arguments, 'ul');
1130+
11161131
return self::createElement(...$arguments);
11171132
}
11181133

11191134
public static function table(...$arguments)
11201135
{
1136+
array_unshift($arguments, 'table');
1137+
11211138
return self::createElement(...$arguments);
11221139
}
11231140

11241141
public static function tbody(...$arguments)
11251142
{
1143+
array_unshift($arguments, 'tbody');
1144+
11261145
return self::createElement(...$arguments);
11271146
}
11281147

11291148
public static function td(...$arguments)
11301149
{
1150+
array_unshift($arguments, 'td');
1151+
11311152
return self::createElement(...$arguments);
11321153
}
11331154

11341155
public static function tr(...$arguments)
11351156
{
1157+
array_unshift($arguments, 'tr');
1158+
11361159
return self::createElement(...$arguments);
11371160
}
11381161

0 commit comments

Comments
 (0)