Skip to content

Commit dc98423

Browse files
committed
fix implicitly nullable parameter
1 parent 0491c4b commit dc98423

File tree

2 files changed

+22
-105
lines changed

2 files changed

+22
-105
lines changed

src/Node/HtmlTag.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,21 @@
55
use AhjDev\PhpTagMaker\Node;
66
use AhjDev\PhpTagMaker\HtmlClass;
77

8+
/**
9+
* @method static self abbr(Node|string ...$value) Defines an abbreviation or an acronym
10+
* @method static self address(Node|string ...$value) Defines contact information for the author/owner of a document
11+
* @method static self article(Node|string ...$value) Defines an article
12+
* @method static self aside(Node|string ...$value) Defines content aside from the page content
13+
* @method static self audio(Node|string ...$value) Defines embedded sound content
14+
* @method static self b(Node|string ...$value) Defines bold text
15+
* @method static self bdi(Node|string ...$value) Isolates a part of text that might be formatted in a different direction from other text outside it
16+
* @method static self bdo(Node|string ...$value) Overrides the current text direction
17+
* @method static self blockquote(Node|string ...$value) Defines a section that is quoted from another source
18+
* @method static self body(Node|string ...$value) Defines the document's body
19+
* @method static self button(Node|string ...$value) Defines a clickable button
20+
* @method static self canvas(Node|string ...$value) Used to draw graphics, on the fly, via scripting (usually JavaScript)
21+
* @method static self caption(Node|string ...$value) Defines a table caption
22+
*/
823
final class HtmlTag extends Node
924
{
1025
use Internal\Attributes;

src/Node/Internal/DefaultTags.php

Lines changed: 7 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,15 @@
88

99
/**
1010
* @internal
11+
* @property HtmlClass $class
1112
*/
1213
trait DefaultTags
1314
{
15+
public static function __callStatic($method, $args)
16+
{
17+
return HtmlTag::make($method, $args);
18+
}
19+
1420
public static function a(string $uri, Node|string ...$value): self
1521
{
1622
return HtmlTag::make('a', ...$value)->setAttribute('href', $uri);
@@ -24,7 +30,7 @@ public static function heading(int $size, Node|string ...$value): self
2430
/**
2531
* Defines a section in a document
2632
*/
27-
public static function div(HtmlClass|string $class = null, Node|string ...$value): self
33+
public static function div(HtmlClass|string|null $class = null, Node|string ...$value): self
2834
{
2935
$tag = HtmlTag::make('div', ...$value);
3036
if ($class) {
@@ -33,22 +39,6 @@ public static function div(HtmlClass|string $class = null, Node|string ...$value
3339
return $tag;
3440
}
3541

36-
/**
37-
* Defines an abbreviation or an acronym
38-
*/
39-
public static function abbr(Node|string ...$value): self
40-
{
41-
return HtmlTag::make('abbr', ...$value);
42-
}
43-
44-
/**
45-
* Defines contact information for the author/owner of a document
46-
*/
47-
public static function address(Node|string ...$value): self
48-
{
49-
return HtmlTag::make('address', ...$value);
50-
}
51-
5242
/**
5343
* Defines an area inside an image map
5444
*/
@@ -57,38 +47,6 @@ public static function area(): self
5747
return HtmlTag::make('area');
5848
}
5949

60-
/**
61-
* Defines an article
62-
*/
63-
public static function article(Node|string ...$value): self
64-
{
65-
return HtmlTag::make('article', ...$value);
66-
}
67-
68-
/**
69-
* Defines content aside from the page content
70-
*/
71-
public static function aside(Node|string ...$value): self
72-
{
73-
return HtmlTag::make('aside', ...$value);
74-
}
75-
76-
/**
77-
* Defines embedded sound content
78-
*/
79-
public static function audio(Node|string ...$value): self
80-
{
81-
return HtmlTag::make('audio', ...$value);
82-
}
83-
84-
/**
85-
* Defines bold text
86-
*/
87-
public static function b(Node|string ...$value): self
88-
{
89-
return HtmlTag::make('b', ...$value);
90-
}
91-
9250
/**
9351
* Specifies the base URL/target for all relative URLs in a document
9452
*/
@@ -99,38 +57,6 @@ public static function base(string $uri, string $target): self
9957
->setAttribute('target', $target);
10058
}
10159

102-
/**
103-
* Isolates a part of text that might be formatted in a different direction from other text outside it
104-
*/
105-
public static function bdi(Node|string ...$value): self
106-
{
107-
return HtmlTag::make('bdi', ...$value);
108-
}
109-
110-
/**
111-
* Overrides the current text direction
112-
*/
113-
public static function bdo(Node|string ...$value): self
114-
{
115-
return HtmlTag::make('bdo', ...$value);
116-
}
117-
118-
/**
119-
* Defines a section that is quoted from another source
120-
*/
121-
public static function blockquote(Node|string ...$value): self
122-
{
123-
return HtmlTag::make('blockquote', ...$value);
124-
}
125-
126-
/**
127-
* Defines the document's body
128-
*/
129-
public static function body(Node|string ...$value): self
130-
{
131-
return HtmlTag::make('body', ...$value);
132-
}
133-
13460
/**
13561
* Defines a single line break
13662
*/
@@ -139,30 +65,6 @@ public static function br(): self
13965
return HtmlTag::make('br');
14066
}
14167

142-
/**
143-
* Defines a clickable button
144-
*/
145-
public static function button(Node|string ...$value): self
146-
{
147-
return HtmlTag::make('button', ...$value);
148-
}
149-
150-
/**
151-
* Used to draw graphics, on the fly, via scripting (usually JavaScript)
152-
*/
153-
public static function canvas(Node|string ...$value): self
154-
{
155-
return HtmlTag::make('canvas', ...$value);
156-
}
157-
158-
/**
159-
* Defines a table caption
160-
*/
161-
public static function caption(Node|string ...$value): self
162-
{
163-
return HtmlTag::make('caption', ...$value);
164-
}
165-
16668
/**
16769
* Defines the title of a work
16870
*/

0 commit comments

Comments
 (0)