From 58c127bcf76886ed37ec3cf97675aec63eda362c Mon Sep 17 00:00:00 2001 From: stephweb Date: Wed, 4 Sep 2019 21:44:02 +0200 Subject: [PATCH 1/2] Add compatibility with >=7.2 for tests --- src/FormBuilder.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/FormBuilder.php b/src/FormBuilder.php index 992cc0c..50388ac 100644 --- a/src/FormBuilder.php +++ b/src/FormBuilder.php @@ -1298,7 +1298,7 @@ class FormBuilder && is_null($old) && is_null($value) && !is_null($this->view->shared('errors')) - && count($this->view->shared('errors')) > 0 + && count(php_sapi_name() === 'cli' ? [] : $this->view->shared('errors')) > 0 ) { return null; } From 028c5bf054c383d4edf7ec9550c1904690405735 Mon Sep 17 00:00:00 2001 From: stephweb Date: Fri, 6 Sep 2019 14:06:41 +0200 Subject: [PATCH 2/2] Refacto for PHP 7.2 with tests --- src/FormBuilder.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/FormBuilder.php b/src/FormBuilder.php index 50388ac..f1e9b6d 100644 --- a/src/FormBuilder.php +++ b/src/FormBuilder.php @@ -1298,7 +1298,7 @@ class FormBuilder && is_null($old) && is_null($value) && !is_null($this->view->shared('errors')) - && count(php_sapi_name() === 'cli' ? [] : $this->view->shared('errors')) > 0 + && count(is_countable($this->view->shared('errors')) ? $this->view->shared('errors') : []) > 0 ) { return null; }