Skip to content

Commit

Permalink
[BUGFIX] satisfy php-cs-fixer
Browse files Browse the repository at this point in the history
This commit resolves the yoda conditions introduced in previous
[BUGFIX] commits.

regarding: MyIntervals#794, MyIntervals#778 (comment)
  • Loading branch information
SignpostMarv committed Oct 7, 2019
1 parent bfc0076 commit 0801e2a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/CssInliner.php
Original file line number Diff line number Diff line change
Expand Up @@ -1135,7 +1135,7 @@ protected function addStyleElementToDocument(string $css)

$headElement = $this->getHeadElement();

if (null === $headElement) {
if ($headElement === null) {
throw new \UnexpectedValueException('Could not find <head>');
}

Expand Down
8 changes: 4 additions & 4 deletions src/HtmlProcessor/AbstractHtmlProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ private function setHtml(string $html)
*/
public function getDomDocument(): \DOMDocument
{
if (null === $this->domDocument) {
if ($this->domDocument === null) {
throw new \UnexpectedValueException(
self::class .
'::setDomDocument() has not yet been called on ' .
Expand All @@ -126,7 +126,7 @@ public function getDomDocument(): \DOMDocument
*/
public function getXPath(): \DOMXPath
{
if (null === $this->xPath) {
if ($this->xPath === null) {
throw new \UnexpectedValueException(
self::class .
'::setDomDocument() has not yet been called on ' .
Expand Down Expand Up @@ -159,7 +159,7 @@ public function render(): string
{
$htmlWithPossibleErroneousClosingTags = $this->getDomDocument()->saveHTML();

if (false === $htmlWithPossibleErroneousClosingTags) {
if ($htmlWithPossibleErroneousClosingTags === false) {
throw new \UnexpectedValueException(
'Could not save html from ' .
self::class .
Expand All @@ -181,7 +181,7 @@ public function renderBodyContent(): string
{
$htmlWithPossibleErroneousClosingTags = $this->getDomDocument()->saveHTML($this->getBodyElement());

if (false === $htmlWithPossibleErroneousClosingTags) {
if ($htmlWithPossibleErroneousClosingTags === false) {
throw new \UnexpectedValueException(
'Failed to save html on ' .
self::class .
Expand Down

0 comments on commit 0801e2a

Please sign in to comment.