mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-08-04 22:17:25 +02:00
remove unneeded elses
This commit is contained in:
@@ -16,7 +16,8 @@ final class StaticFactory
|
|||||||
{
|
{
|
||||||
if ($type == 'number') {
|
if ($type == 'number') {
|
||||||
return new FormatNumber();
|
return new FormatNumber();
|
||||||
} elseif ($type == 'string') {
|
}
|
||||||
|
if ($type == 'string') {
|
||||||
return new FormatString();
|
return new FormatString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -30,9 +30,8 @@ class TextFactory implements Countable
|
|||||||
{
|
{
|
||||||
if (strlen($name) == 1) {
|
if (strlen($name) == 1) {
|
||||||
return new Character($name);
|
return new Character($name);
|
||||||
} else {
|
|
||||||
return new Word($name);
|
|
||||||
}
|
}
|
||||||
|
return new Word($name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function count(): int
|
public function count(): int
|
||||||
|
Reference in New Issue
Block a user