Total Complexity | 4 |
Total Lines | 42 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
12 | class HQ |
||
13 | { |
||
14 | /** |
||
15 | * Generate a new instance with the html |
||
16 | * |
||
17 | * @param string $html |
||
18 | * |
||
19 | * @return HtmlDocument |
||
20 | */ |
||
21 | 80 | public static function html(string $html) |
|
22 | { |
||
23 | 80 | return static::instance($html); |
|
24 | } |
||
25 | |||
26 | /** |
||
27 | * Generate a new instance with the html file |
||
28 | * |
||
29 | * @param string $file |
||
30 | * |
||
31 | * @return HtmlDocument |
||
32 | */ |
||
33 | 1 | public static function htmlFile(string $file) |
|
34 | { |
||
35 | 1 | return static::html(file_get_contents($file)); |
|
36 | } |
||
37 | |||
38 | /** |
||
39 | * Generate a new instance, optionally with the html |
||
40 | * |
||
41 | * @param string|null $html |
||
42 | * |
||
43 | * @return HtmlDocument |
||
44 | */ |
||
45 | 81 | public static function instance(?string $html = null) |
|
54 | } |
||
55 | } |
||
56 |