Skip to content

Commit

Permalink
FIX: trim construct function
Browse files Browse the repository at this point in the history
  • Loading branch information
Iliain committed Oct 16, 2024
1 parent 5ab08c2 commit 22e5e43
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions src/UsernameRandomizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,11 @@ class UsernameRandomizer
*/
public function __construct($customAdjectives = null, $customNouns = null)
{
// $adjectiveArray and $nounArray are defined in RandomizerArrays.php
include __DIR__ . '/RandomizerArrays.php';

if ($customAdjectives === null) {
self::$adjectiveList = $adjectiveArray;
} else {
self::$adjectiveList = $customAdjectives;
}

if ($customNouns === null) {
self::$nounList = $nounArray;
} else {
self::$nounList = $customNouns;
}
self::$adjectiveList = $customAdjectives ?? $adjectiveArray;
self::$nounList = $customNouns ?? $nounArray;
}

/**
Expand Down Expand Up @@ -145,7 +137,7 @@ public static function getFormattedWord($word, $options): string

/**
* Toggles the case of each letter in the provided word. E.g. "hello" becomes "HeLlO"
* @param $word string
* @param string $word
*/
public static function getToggleCaseWord($word): string
{
Expand Down

0 comments on commit 22e5e43

Please sign in to comment.