From 9a1cba283475b47599ea5b6df3e2ddb8724dbb06 Mon Sep 17 00:00:00 2001 From: JakeQZ Date: Tue, 31 Mar 2020 09:34:34 +0100 Subject: [PATCH] [TASK] Allow chaining all configuration methods (#854) The example given in the documentation using `disableStyleBlocksParsing()` will now actually work. Fixes #824 --- CHANGELOG.md | 3 ++ src/CssInliner.php | 28 +++++++++--- tests/Unit/CssInlinerTest.php | 84 +++++++++++++++++++++++++++++++++++ 3 files changed, 108 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e72b2bd7..ddd0107e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,9 @@ This project adheres to [Semantic Versioning](https://semver.org/). ## x.y.z ### Added +- Configuration setting methods now all return `$this` to allow chaining + ([#824](https://github.com/MyIntervals/emogrifier/pull/824), + [#854](https://github.com/MyIntervals/emogrifier/pull/854)) - Add support for PHP 7.4 ([#821](https://github.com/MyIntervals/emogrifier/pull/821)) - Disable php-cs-fixer Yoda conditions diff --git a/src/CssInliner.php b/src/CssInliner.php index faa17e67..f9629038 100644 --- a/src/CssInliner.php +++ b/src/CssInliner.php @@ -211,21 +211,25 @@ public function inlineCss(string $css = ''): self /** * Disables the parsing of inline styles. * - * @return void + * @return self fluent interface */ public function disableInlineStyleAttributesParsing() { $this->isInlineStyleAttributesParsingEnabled = false; + + return $this; } /** * Disables the parsing of