Skip to content

Commit 2507e38

Browse files
ruudkondrejmirtes
authored andcommitted
Do not truncate offset key
When you have an array with long key names, it becomes hard / impossible to see which one errors. I think it would be better to be precise here.
1 parent da764a2 commit 2507e38

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Type/Constant/ConstantArrayType.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ public function acceptsWithReason(Type $type, bool $strictTypes): AcceptsResult
327327
$acceptsValue = $valueType->acceptsWithReason($otherValueType, $strictTypes)->decorateReasons(
328328
static fn (string $reason) => sprintf(
329329
'Offset %s (%s) does not accept type %s: %s',
330-
$keyType->describe(VerbosityLevel::value()),
330+
$keyType->describe(VerbosityLevel::precise()),
331331
$valueType->describe($verbosity),
332332
$otherValueType->describe($verbosity),
333333
$reason,
@@ -337,7 +337,7 @@ public function acceptsWithReason(Type $type, bool $strictTypes): AcceptsResult
337337
$acceptsValue = new AcceptsResult($acceptsValue->result, [
338338
sprintf(
339339
'Offset %s (%s) does not accept type %s.',
340-
$keyType->describe(VerbosityLevel::value()),
340+
$keyType->describe(VerbosityLevel::precise()),
341341
$valueType->describe($verbosity),
342342
$otherValueType->describe($verbosity),
343343
),

0 commit comments

Comments
 (0)