Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / vendor / symfony / http-kernel / Fragment / HIncludeFragmentRenderer.php
index 7e957d4c95f71ea579a537598fcc458c20953fc7..f7150c1979b4b93408572bdb11cc534b5a2cd547 100644 (file)
@@ -13,9 +13,9 @@ namespace Symfony\Component\HttpKernel\Fragment;
 
 use Symfony\Component\HttpFoundation\Request;
 use Symfony\Component\HttpFoundation\Response;
-use Symfony\Component\Templating\EngineInterface;
 use Symfony\Component\HttpKernel\Controller\ControllerReference;
 use Symfony\Component\HttpKernel\UriSigner;
+use Symfony\Component\Templating\EngineInterface;
 use Twig\Environment;
 use Twig\Error\LoaderError;
 use Twig\Loader\ExistsLoaderInterface;
@@ -89,7 +89,7 @@ class HIncludeFragmentRenderer extends RoutableFragmentRenderer
             }
 
             // we need to sign the absolute URI, but want to return the path only.
-            $uri = substr($this->signer->sign($this->generateFragmentUri($uri, $request, true)), strlen($request->getSchemeAndHttpHost()));
+            $uri = substr($this->signer->sign($this->generateFragmentUri($uri, $request, true)), \strlen($request->getSchemeAndHttpHost()));
         }
 
         // We need to replace ampersands in the URI with the encoded form in order to return valid html/xml content.
@@ -102,12 +102,12 @@ class HIncludeFragmentRenderer extends RoutableFragmentRenderer
             $content = $template;
         }
 
-        $attributes = isset($options['attributes']) && is_array($options['attributes']) ? $options['attributes'] : array();
+        $attributes = isset($options['attributes']) && \is_array($options['attributes']) ? $options['attributes'] : array();
         if (isset($options['id']) && $options['id']) {
             $attributes['id'] = $options['id'];
         }
         $renderedAttributes = '';
-        if (count($attributes) > 0) {
+        if (\count($attributes) > 0) {
             $flags = ENT_QUOTES | ENT_SUBSTITUTE;
             foreach ($attributes as $attribute => $value) {
                 $renderedAttributes .= sprintf(
@@ -131,7 +131,7 @@ class HIncludeFragmentRenderer extends RoutableFragmentRenderer
         if ($this->templating instanceof EngineInterface) {
             try {
                 return $this->templating->exists($template);
-            } catch (\InvalidArgumentException $e) {
+            } catch (\Exception $e) {
                 return false;
             }
         }