From 269c2c63fba60d9797fc779045b02f624c917d36 Mon Sep 17 00:00:00 2001 From: mehdi hasanpour Date: Sat, 9 Jul 2022 15:00:13 +0430 Subject: [PATCH] remove unneeded elses --- Creational/StaticFactory/StaticFactory.php | 3 ++- Structural/Flyweight/TextFactory.php | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Creational/StaticFactory/StaticFactory.php b/Creational/StaticFactory/StaticFactory.php index 8ebff07..3b8a9d9 100644 --- a/Creational/StaticFactory/StaticFactory.php +++ b/Creational/StaticFactory/StaticFactory.php @@ -16,7 +16,8 @@ final class StaticFactory { if ($type == 'number') { return new FormatNumber(); - } elseif ($type == 'string') { + } + if ($type == 'string') { return new FormatString(); } diff --git a/Structural/Flyweight/TextFactory.php b/Structural/Flyweight/TextFactory.php index db1402f..82b39ea 100644 --- a/Structural/Flyweight/TextFactory.php +++ b/Structural/Flyweight/TextFactory.php @@ -30,9 +30,8 @@ class TextFactory implements Countable { if (strlen($name) == 1) { return new Character($name); - } else { - return new Word($name); } + return new Word($name); } public function count(): int