From 5804b8b1f299632e19199f291237163af18741b3 Mon Sep 17 00:00:00 2001 From: Alexandre Quercia Date: Wed, 28 Sep 2022 03:20:05 +0200 Subject: [PATCH] fixup! Add extract variable --- README.md | 2 ++ doc/refactoring-toolbox.txt | 1 + 2 files changed, 3 insertions(+) diff --git a/README.md b/README.md index 55387a6..74ce965 100644 --- a/README.md +++ b/README.md @@ -261,6 +261,7 @@ class HelloWorld { private function prepareSentence($firstName) { $sentence = 'Hello'; + if ('foo' === $firstName) { $sentence .= ' ' . $firstName; } @@ -279,6 +280,7 @@ class HelloWorld { private function prepareSentence($firstName) { $sentence = 'Hello'; + $firstNameIsValid = 'foo' === $firstName; if ($firstNameIsValid) { diff --git a/doc/refactoring-toolbox.txt b/doc/refactoring-toolbox.txt index 0570747..d420f5c 100755 --- a/doc/refactoring-toolbox.txt +++ b/doc/refactoring-toolbox.txt @@ -217,6 +217,7 @@ class HelloWorld { private function prepareSentence($firstName) { $sentence = 'Hello'; + $firstNameIsValid = 'foo' === $firstName; if ($firstNameIsValid) {