From 3a7f41102030a23ee736d51fb3abb1a6da72f2f5 Mon Sep 17 00:00:00 2001 From: Deon George Date: Wed, 19 Jan 2022 16:43:29 +1100 Subject: [PATCH] Show size of chars in debug --- src/Blockkit/Blocks/Section.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Blockkit/Blocks/Section.php b/src/Blockkit/Blocks/Section.php index 56c0e2f..18daf81 100644 --- a/src/Blockkit/Blocks/Section.php +++ b/src/Blockkit/Blocks/Section.php @@ -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;