diff --git a/src/VoucherService/TokenManager/Pattern.php b/src/VoucherService/TokenManager/Pattern.php index 5d09e6af..572a8638 100644 --- a/src/VoucherService/TokenManager/Pattern.php +++ b/src/VoucherService/TokenManager/Pattern.php @@ -257,16 +257,16 @@ public function getFinalTokenLength(): int { $separatorCount = $this->configuration->getSeparatorCount(); $separator = $this->configuration->getSeparator(); - $prefix = $this->configuration->getPrefix(); + $prefix = (string)$this->configuration->getPrefix(); if (!empty($separator)) { if (!empty($prefix)) { - return strlen($this->configuration->getPrefix()) + 1 + (int) floor($this->configuration->getLength() / $separatorCount) + $this->configuration->getLength(); + return strlen($prefix) + 1 + (int) floor($this->configuration->getLength() / $separatorCount) + $this->configuration->getLength(); } return (int) floor($this->configuration->getLength() / $separatorCount) + $this->configuration->getLength(); } - return strlen($this->configuration->getPrefix()) + $this->configuration->getLength(); + return strlen($prefix) + $this->configuration->getLength(); } /**