diff --git a/php/src/StateException.php b/php/src/StateException.php index b54d13a..3eadf1d 100644 --- a/php/src/StateException.php +++ b/php/src/StateException.php @@ -15,9 +15,9 @@ class StateException extends LogicException { return new static($prefix.$message); } - static final function unexpected_state(?string $prefix=null): self { + static final function unexpected_state(?string $suffix=null): self { $message = "unexpected state"; - if ($prefix) $prefix = "$prefix: "; - return new static($prefix.$message); + if ($suffix) $suffix = ": $suffix"; + return new static($message.$suffix); } }