From 6fd149371f317ef2d444a2d913ef177044bdcbda Mon Sep 17 00:00:00 2001 From: PiotrFedak Date: Wed, 5 Jun 2024 09:19:04 +0200 Subject: [PATCH] #9 --- src/Features/Traits/Environment.php | 3 ++- src/Helpers/BooleanHelper.php | 13 +++++++++++++ src/Helpers/NullableHelper.php | 13 +++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 src/Helpers/BooleanHelper.php create mode 100644 src/Helpers/NullableHelper.php diff --git a/src/Features/Traits/Environment.php b/src/Features/Traits/Environment.php index 8124207..3db8e95 100644 --- a/src/Features/Traits/Environment.php +++ b/src/Features/Traits/Environment.php @@ -6,6 +6,7 @@ use Behat\Gherkin\Node\TableNode; use Blumilk\BLT\Bootstrapping\LaravelBootstrapper; +use Blumilk\BLT\Helpers\BooleanHelper; trait Environment { @@ -21,7 +22,7 @@ public function castConfigBoolValues(TableNode $configTable): array $value = $row["value"]; if (in_array($value, ["true", "false"], true)) { - $value = $value === "true"; + $value = BooleanHelper::toBoolean($value); } $config[$key] = $value; } diff --git a/src/Helpers/BooleanHelper.php b/src/Helpers/BooleanHelper.php new file mode 100644 index 0000000..222509b --- /dev/null +++ b/src/Helpers/BooleanHelper.php @@ -0,0 +1,13 @@ +