File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change 2020 */
2121final class Report extends File
2222{
23+ private readonly string $ name ;
24+
2325 public function __construct (string $ name )
2426 {
2527 $ dom = new DOMDocument ;
@@ -32,11 +34,14 @@ public function __construct(string $name)
3234
3335 parent ::__construct ($ contextNode );
3436
35- $ this ->setName ( $ name) ;
37+ $ this ->name = $ name ;
3638 }
3739
3840 public function asDom (): DOMDocument
3941 {
42+ $ this ->contextNode ()->setAttribute ('name ' , basename ($ this ->name ));
43+ $ this ->contextNode ()->setAttribute ('path ' , dirname ($ this ->name ));
44+
4045 return $ this ->dom ();
4146 }
4247
@@ -85,12 +90,6 @@ public function source(): Source
8590 return new Source ($ source );
8691 }
8792
88- private function setName (string $ name ): void
89- {
90- $ this ->contextNode ()->setAttribute ('name ' , basename ($ name ));
91- $ this ->contextNode ()->setAttribute ('path ' , dirname ($ name ));
92- }
93-
9493 private function unitObject (string $ tagName , string $ name ): Unit
9594 {
9695 $ node = $ this ->contextNode ()->appendChild (
You can’t perform that action at this time.
0 commit comments