Show size of chars in debug

This commit is contained in:
Deon George 2022-01-19 16:43:29 +11:00
parent b2cd5c7d46
commit 3a7f411020

View File

@ -70,8 +70,8 @@ final class Section extends Blocks
if (count($collection) > self::MAX_FIELDS)
throw new Exception(sprintf('Can only have maximum %d fields',self::MAX_FIELDS));
if ($collection->map(function($item) { return strlen($item->text); })->max() > self::MAX_FIELDS_TEXT)
throw new Exception(sprintf('The maximum size of text in a field is %d',self::MAX_FIELDS_TEXT));
if (($x=$collection->map(function($item) { return strlen($item->text); })->max()) > self::MAX_FIELDS_TEXT)
throw new Exception(sprintf('The maximum size of the text in a field is %d (%d)',self::MAX_FIELDS_TEXT,$x));
$this->fields = $collection;