Skip to content

Commit 0598283

Browse files
committed
Merge branch 'master' of github.com:hexydec/htmldoc
2 parents a1223f5 + 3ee6093 commit 0598283

File tree

4 files changed

+56
-36
lines changed

4 files changed

+56
-36
lines changed

composer.lock

Lines changed: 51 additions & 31 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/config.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public function __construct(array $config = []) {
2020
case 'style':
2121
$obj = new \hexydec\css\cssdoc();
2222
break;
23-
case 'script':
23+
case 'script':
2424
$obj = new \hexydec\jslite\jslite();
2525
break;
2626
default:

src/htmldoc.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ public function open(string $url, $context = null, ?string &$error = null) : str
229229
* @param ?string &$error A reference to any user error that is generated
230230
* @return bool Whether the input HTML was parsed
231231
*/
232-
public function load(string $html, string $charset = null, ?string &$error = null) : bool {
232+
public function load(string $html, ?string $charset = null, ?string &$error = null) : bool {
233233

234234
// detect the charset
235235
if ($charset || ($charset = $this->getCharsetFromHtml($html)) !== null) {
@@ -343,7 +343,7 @@ public function cache(string $key, array $values) : void {
343343
* @param int $index The index of the child tag to retrieve
344344
* @return tag|array|null A tag object if index is specified, or an array of tag objects, or null if the specified index doesn't exist or the object is empty
345345
*/
346-
public function get(int $index = null) : tag|array|null {
346+
public function get(?int $index = null) : tag|array|null {
347347

348348
// build children that are tags
349349
$children = [];

src/tokens/tag.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class tag implements token {
6868
* @param string $tag The HTML tag this object will represent
6969
* @param tag $parent The parent tag object
7070
*/
71-
public function __construct(htmldoc $root, string $tag = null, tag $parent = null) {
71+
public function __construct(htmldoc $root, ?string $tag = null, ?tag $parent = null) {
7272
$this->root = $root;
7373
$this->tagName = $tag;
7474
$this->parent = $parent;
@@ -300,7 +300,7 @@ public function parent() : ?tag {
300300
* @param int $index To insert the nodes at a particular position, set the index
301301
* @return void
302302
*/
303-
public function append(array $nodes, int $index = null) : void {
303+
public function append(array $nodes, ?int $index = null) : void {
304304

305305
// reset the index if it doesn't exist
306306
if ($index !== null && !isset($this->children[$index])) {

0 commit comments

Comments
 (0)