File tree Expand file tree Collapse file tree 1 file changed +7
-10
lines changed Expand file tree Collapse file tree 1 file changed +7
-10
lines changed Original file line number Diff line number Diff line change 11<?php
2-
32declare (strict_types=1 );
43
54namespace Eightfold \HTMLBuilder ;
65
76use Stringable ;
87
9- use Eightfold \XMLBuilder \Comment ;
108use Eightfold \XMLBuilder \Contracts \Buildable ;
9+ use Eightfold \XMLBuilder \Implementations \Buildable as BuildableImp ;
10+
1111use Eightfold \HTMLBuilder \Element ;
1212
1313class Document implements Buildable
1414{
15+ use BuildableImp;
16+
1517 /**
1618 * @var array<string|Stringable>
1719 */
@@ -32,8 +34,8 @@ public static function create(
3234
3335 final private function __construct (
3436 private string $ title ,
35- private string $ lang = ' en ' ,
36- private string $ charset = ' utf-8 '
37+ private string $ lang ,
38+ private string $ charset
3739 ) {
3840 }
3941
@@ -49,7 +51,7 @@ public function body(string|Stringable ...$content): Document
4951 return $ this ;
5052 }
5153
52- public function build (): string
54+ public function __toString (): string
5355 {
5456 $ doctype = '<!doctype html> ' . "\n" ;
5557 return $ doctype . Element::html (
@@ -62,11 +64,6 @@ public function build(): string
6264 )->props ($ this ->lang ())->build ();
6365 }
6466
65- public function __toString (): string
66- {
67- return $ this ->build ();
68- }
69-
7067 private function title (): string
7168 {
7269 return $ this ->title ;
You can’t perform that action at this time.
0 commit comments