Skip to content

Commit

Permalink
fixup! Add extract variable
Browse files Browse the repository at this point in the history
  • Loading branch information
alquerci committed Sep 28, 2022
1 parent e5263dc commit 5804b8b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ class HelloWorld {
private function prepareSentence($firstName)
{
$sentence = 'Hello';

if ('foo' === $firstName) {
$sentence .= ' ' . $firstName;
}
Expand All @@ -279,6 +280,7 @@ class HelloWorld {
private function prepareSentence($firstName)
{
$sentence = 'Hello';

$firstNameIsValid = 'foo' === $firstName;

if ($firstNameIsValid) {
Expand Down
1 change: 1 addition & 0 deletions doc/refactoring-toolbox.txt
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ class HelloWorld {
private function prepareSentence($firstName)
{
$sentence = 'Hello';

$firstNameIsValid = 'foo' === $firstName;

if ($firstNameIsValid) {
Expand Down

0 comments on commit 5804b8b

Please sign in to comment.