Show size of chars in debug
This commit is contained in:
parent
b2cd5c7d46
commit
3a7f411020
@ -70,8 +70,8 @@ final class Section extends Blocks
|
|||||||
if (count($collection) > self::MAX_FIELDS)
|
if (count($collection) > self::MAX_FIELDS)
|
||||||
throw new Exception(sprintf('Can only have maximum %d fields',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)
|
if (($x=$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));
|
throw new Exception(sprintf('The maximum size of the text in a field is %d (%d)',self::MAX_FIELDS_TEXT,$x));
|
||||||
|
|
||||||
$this->fields = $collection;
|
$this->fields = $collection;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user