From b8cdcaaca49bf02a63e0323a3fe691f15b355a24 Mon Sep 17 00:00:00 2001 From: SignpostMarv Date: Sun, 6 Oct 2019 00:56:48 +0100 Subject: [PATCH] [BUGFIX] satisfy php-cs-fixer This commit resolves the yoda conditions introduced in previous [BUGFIX] commits. regarding: #794, https://github.com/MyIntervals/emogrifier/pull/778#discussion_r331764312 --- src/CssInliner.php | 2 +- src/HtmlProcessor/AbstractHtmlProcessor.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/CssInliner.php b/src/CssInliner.php index 42c3cfbc..cb4cb5b4 100644 --- a/src/CssInliner.php +++ b/src/CssInliner.php @@ -1135,7 +1135,7 @@ protected function addStyleElementToDocument(string $css) $headElement = $this->getHeadElement(); - if (null === $headElement) { + if ($headElement === null) { throw new \UnexpectedValueException('Could not find '); } diff --git a/src/HtmlProcessor/AbstractHtmlProcessor.php b/src/HtmlProcessor/AbstractHtmlProcessor.php index 0283d4e0..9ad35a6d 100644 --- a/src/HtmlProcessor/AbstractHtmlProcessor.php +++ b/src/HtmlProcessor/AbstractHtmlProcessor.php @@ -129,7 +129,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 ' . @@ -162,7 +162,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 . @@ -184,7 +184,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 .