diff --git a/composer.json b/composer.json index b7c41f0..232b44f 100644 --- a/composer.json +++ b/composer.json @@ -6,7 +6,7 @@ "authors": [ { "name": "Dave Mc Nicoll", - "email": "mcndave@gmail.com" + "email": "info@mcnd.ca" } ], "require": {}, diff --git a/src/I18n.php b/src/I18n.php index 860881a..e7dfed4 100644 --- a/src/I18n.php +++ b/src/I18n.php @@ -50,10 +50,6 @@ class I18n implements MissingKeyInterface $string = $this->missingKey ? $this->missingKey->get($key) : null; } - #if (is_array($string)) { - # $string = json_encode($string); - #} - return $string && $variables ? $this->placeVariables($string, $variables) : $string; } diff --git a/src/Iterate.php b/src/Iterate.php index 734ce81..f808def 100644 --- a/src/Iterate.php +++ b/src/Iterate.php @@ -59,7 +59,7 @@ class Iterate if ( ! is_iterable($recurse) ) { if ( is_object($recurse) ) { if ( count($pathArr) > 1 ) { - throw new \Exception("An error occured trying to fetch a value from an object using path $path"); + throw new \Exception("An error occured trying to fetch a value from an object using path '$path'"); } else { # @TODO An object caller would be a WAY better idea then this line of code @@ -67,6 +67,9 @@ class Iterate return $recurse->{$pathArr[0]} ?? ""; } } + elseif (is_scalar($recurse)) { + throw new \Exception("An error occured trying to fetch a value from a scalar value using path '$path'"); + } } return static::arrayGet($recurse, implode($delimiter, $pathArr), $delimiter);