Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Cannot assign null to property DOMNode::* of type string #110

Merged
merged 1 commit into from
May 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/voku/helper/AbstractSimpleHtmlDom.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,14 @@
switch ($name) {
case 'outerhtml':
case 'outertext':
return $this->replaceNodeWithString($value);

Check failure on line 155 in src/voku/helper/AbstractSimpleHtmlDom.php

View workflow job for this annotation

GitHub Actions / tests (7.4, basic)

Method voku\helper\AbstractSimpleHtmlDom::__set() with return type void returns voku\helper\SimpleHtmlDomInterface but should not return anything.
case 'innertext':
case 'innerhtml':
return $this->replaceChildWithString($value);

Check failure on line 158 in src/voku/helper/AbstractSimpleHtmlDom.php

View workflow job for this annotation

GitHub Actions / tests (7.4, basic)

Method voku\helper\AbstractSimpleHtmlDom::__set() with return type void returns voku\helper\SimpleHtmlDomInterface but should not return anything.
case 'innerhtmlkeep':
return $this->replaceChildWithString($value, false);

Check failure on line 160 in src/voku/helper/AbstractSimpleHtmlDom.php

View workflow job for this annotation

GitHub Actions / tests (7.4, basic)

Method voku\helper\AbstractSimpleHtmlDom::__set() with return type void returns voku\helper\SimpleHtmlDomInterface but should not return anything.
case 'plaintext':
return $this->replaceTextWithString($value);

Check failure on line 162 in src/voku/helper/AbstractSimpleHtmlDom.php

View workflow job for this annotation

GitHub Actions / tests (7.4, basic)

Method voku\helper\AbstractSimpleHtmlDom::__set() with return type void returns voku\helper\SimpleHtmlDomInterface but should not return anything.
case 'classlist':
$name = 'class';
$nameOrig = 'class';
Expand All @@ -171,10 +171,12 @@
$value = (string)$value;
}

return $this->node->{$nameOrig} = $value;
if (!is_null($value)) {
return $this->node->{$nameOrig} = $value;

Check failure on line 175 in src/voku/helper/AbstractSimpleHtmlDom.php

View workflow job for this annotation

GitHub Actions / tests (7.4, basic)

Method voku\helper\AbstractSimpleHtmlDom::__set() with return type void returns mixed but should not return anything.
}
}

return $this->setAttribute($name, $value);

Check failure on line 179 in src/voku/helper/AbstractSimpleHtmlDom.php

View workflow job for this annotation

GitHub Actions / tests (7.4, basic)

Method voku\helper\AbstractSimpleHtmlDom::__set() with return type void returns voku\helper\SimpleHtmlDomInterface but should not return anything.
}
}

Expand Down
Loading