Skip to content

Commit d67ace0

Browse files
committed
Improve string type behaviour
1 parent 486d99e commit d67ace0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Type/StringType.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function cast(mixed $value, Context $context): string
3535
}
3636

3737
if (!$context->isStrictTypesEnabled()) {
38-
return $this->convertToString($value, $context);
38+
return $this->coerce($value, $context);
3939
}
4040

4141
throw InvalidValueException::createFromContext(
@@ -47,7 +47,7 @@ public function cast(mixed $value, Context $context): string
4747
/**
4848
* @throws InvalidValueException
4949
*/
50-
protected function convertToString(mixed $value, Context $context): string
50+
protected function coerce(mixed $value, Context $context): string
5151
{
5252
return match (true) {
5353
// Null

0 commit comments

Comments
 (0)