diff --git a/src/Configuration.php b/src/Configuration.php index 11237354..0018ad9a 100644 --- a/src/Configuration.php +++ b/src/Configuration.php @@ -713,7 +713,7 @@ public function getHistorySize() */ public function setEraseDuplicates(bool $value) { - $this->eraseDuplicates = (bool) $value; + $this->eraseDuplicates = $value; } /** @@ -819,7 +819,7 @@ public function getReadline(): Readline\Readline $this->readline = new $className( $this->getHistoryFile(), $this->getHistorySize(), - $this->getEraseDuplicates() + $this->getEraseDuplicates() ?? false ); } diff --git a/src/Readline/Transient.php b/src/Readline/Transient.php index cbf01e20..e5bb9ba1 100644 --- a/src/Readline/Transient.php +++ b/src/Readline/Transient.php @@ -50,7 +50,7 @@ public function __construct($historyFile = null, $historySize = 0, $eraseDups = // don't do anything with the history file... $this->history = []; $this->historySize = $historySize; - $this->eraseDups = $eraseDups; + $this->eraseDups = $eraseDups ?? false; } /**