Procházet zdrojové kódy

json_encode() syntax (fix commit fb889a2eee33db42ba5e)

Victor Berchet před 14 roky
rodič
revize
cd96c91447

+ 1 - 1
src/Symfony/Bundle/DoctrineBundle/Logger/DbalLogger.php

@@ -41,7 +41,7 @@ class DbalLogger extends DebugStack
         parent::startQuery($sql, $params, $types);
 
         if (null !== $this->logger) {
-            $this->log($sql.' ('.json_encode($params, true).')');
+            $this->log($sql.' ('.json_encode($params).')');
         }
     }
 

+ 1 - 1
src/Symfony/Bundle/FrameworkBundle/RequestListener.php

@@ -86,7 +86,7 @@ class RequestListener
         // add attributes based on the path info (routing)
         if (false !== $parameters = $this->router->match($request->getPathInfo())) {
             if (null !== $this->logger) {
-                $this->logger->info(sprintf('Matched route "%s" (parameters: %s)', $parameters['_route'], str_replace("\n", '', json_encode($parameters, true))));
+                $this->logger->info(sprintf('Matched route "%s" (parameters: %s)', $parameters['_route'], json_encode($parameters)));
             }
 
             $request->attributes->add($parameters);

+ 1 - 1
src/Symfony/Bundle/FrameworkBundle/Templating/Loader/CachedTemplateLocator.php

@@ -44,7 +44,7 @@ class CachedTemplateLocator implements TemplateLocatorInterface
         $key = md5(serialize($template));
 
         if (!isset($this->templates[$key])) {
-            throw new \InvalidArgumentException(sprintf('Unable to find template "%s".', json_encode($template, true)));
+            throw new \InvalidArgumentException(sprintf('Unable to find template "%s".', json_encode($template)));
         }
 
         return $this->templates[$key];

+ 2 - 2
src/Symfony/Bundle/FrameworkBundle/Templating/Loader/TemplateLocator.php

@@ -57,7 +57,7 @@ class TemplateLocator implements TemplateLocatorInterface
                 return $this->cache[$key] = $file;
             }
 
-            throw new \InvalidArgumentException(sprintf('Unable to find template "%s" in "%s".', json_encode($template, true), $this->path));
+            throw new \InvalidArgumentException(sprintf('Unable to find template "%s" in "%s".', json_encode($template), $this->path));
         }
 
         $resource = $template['bundle'].'/Resources/views/'.$template['controller'].'/'.$template['name'].'.'.$template['format'].'.'.$template['engine'];
@@ -65,7 +65,7 @@ class TemplateLocator implements TemplateLocatorInterface
         try {
             return $this->kernel->locateResource('@'.$resource, $this->path);
         } catch (\Exception $e) {
-            throw new \InvalidArgumentException(sprintf('Unable to find template "%s".', json_encode($template, true), $this->path), 0, $e);
+            throw new \InvalidArgumentException(sprintf('Unable to find template "%s".', json_encode($template), $this->path), 0, $e);
         }
     }
 }