Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / vendor / symfony / dependency-injection / ParameterBag / ParameterBag.php
index bb3e2110254dfe0916c1200bf4e869655d982771..e06fd344c05a027307ee5a74b006c95aaae4cf0a 100644 (file)
@@ -11,8 +11,8 @@
 
 namespace Symfony\Component\DependencyInjection\ParameterBag;
 
-use Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException;
 use Symfony\Component\DependencyInjection\Exception\ParameterCircularReferenceException;
+use Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException;
 use Symfony\Component\DependencyInjection\Exception\RuntimeException;
 
 /**
@@ -78,18 +78,18 @@ class ParameterBag implements ParameterBagInterface
             $alternatives = array();
             foreach ($this->parameters as $key => $parameterValue) {
                 $lev = levenshtein($name, $key);
-                if ($lev <= strlen($name) / 3 || false !== strpos($key, $name)) {
+                if ($lev <= \strlen($name) / 3 || false !== strpos($key, $name)) {
                     $alternatives[] = $key;
                 }
             }
 
             $nonNestedAlternative = null;
-            if (!count($alternatives) && false !== strpos($name, '.')) {
+            if (!\count($alternatives) && false !== strpos($name, '.')) {
                 $namePartsLength = array_map('strlen', explode('.', $name));
                 $key = substr($name, 0, -1 * (1 + array_pop($namePartsLength)));
-                while (count($namePartsLength)) {
+                while (\count($namePartsLength)) {
                     if ($this->has($key)) {
-                        if (is_array($this->get($key))) {
+                        if (\is_array($this->get($key))) {
                             $nonNestedAlternative = $key;
                         }
                         break;
@@ -233,8 +233,8 @@ class ParameterBag implements ParameterBagInterface
 
             $resolved = $this->get($key);
 
-            if (!is_string($resolved) && !is_numeric($resolved)) {
-                throw new RuntimeException(sprintf('A string value must be composed of strings and/or numbers, but found parameter "%s" of type %s inside string value "%s".', $key, gettype($resolved), $value));
+            if (!\is_string($resolved) && !is_numeric($resolved)) {
+                throw new RuntimeException(sprintf('A string value must be composed of strings and/or numbers, but found parameter "%s" of type %s inside string value "%s".', $key, \gettype($resolved), $value));
             }
 
             $resolved = (string) $resolved;
@@ -254,11 +254,11 @@ class ParameterBag implements ParameterBagInterface
      */
     public function escapeValue($value)
     {
-        if (is_string($value)) {
+        if (\is_string($value)) {
             return str_replace('%', '%%', $value);
         }
 
-        if (is_array($value)) {
+        if (\is_array($value)) {
             $result = array();
             foreach ($value as $k => $v) {
                 $result[$k] = $this->escapeValue($v);
@@ -275,11 +275,11 @@ class ParameterBag implements ParameterBagInterface
      */
     public function unescapeValue($value)
     {
-        if (is_string($value)) {
+        if (\is_string($value)) {
             return str_replace('%%', '%', $value);
         }
 
-        if (is_array($value)) {
+        if (\is_array($value)) {
             $result = array();
             foreach ($value as $k => $v) {
                 $result[$k] = $this->unescapeValue($v);