From cb14bfd1661368a3c280077531ebd357e21cb16d Mon Sep 17 00:00:00 2001 From: Romain Neutron Date: Tue, 28 Feb 2017 14:53:41 +0100 Subject: [PATCH 1/2] [2.8] Fix issues reported by static analyse --- .../Bundle/FrameworkBundle/CacheWarmer/TemplateFinder.php | 1 + .../Component/HttpKernel/EventListener/SessionListener.php | 1 + src/Symfony/Component/Templating/PhpEngine.php | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/TemplateFinder.php b/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/TemplateFinder.php index 1e22984982..afda119177 100644 --- a/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/TemplateFinder.php +++ b/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/TemplateFinder.php @@ -14,6 +14,7 @@ namespace Symfony\Bundle\FrameworkBundle\CacheWarmer; use Symfony\Component\HttpKernel\KernelInterface; use Symfony\Component\Finder\Finder; use Symfony\Component\Templating\TemplateNameParserInterface; +use Symfony\Component\Templating\TemplateReferenceInterface; use Symfony\Component\HttpKernel\Bundle\BundleInterface; /** diff --git a/src/Symfony/Component/HttpKernel/EventListener/SessionListener.php b/src/Symfony/Component/HttpKernel/EventListener/SessionListener.php index ecf065f0e8..2d6adfa012 100644 --- a/src/Symfony/Component/HttpKernel/EventListener/SessionListener.php +++ b/src/Symfony/Component/HttpKernel/EventListener/SessionListener.php @@ -11,6 +11,7 @@ namespace Symfony\Component\HttpKernel\EventListener; +use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\HttpKernel\Event\GetResponseEvent; use Symfony\Component\HttpKernel\KernelEvents; use Symfony\Component\EventDispatcher\EventSubscriberInterface; diff --git a/src/Symfony/Component/Templating/PhpEngine.php b/src/Symfony/Component/Templating/PhpEngine.php index d39f863178..90b9abc05f 100644 --- a/src/Symfony/Component/Templating/PhpEngine.php +++ b/src/Symfony/Component/Templating/PhpEngine.php @@ -455,7 +455,7 @@ class PhpEngine implements EngineInterface, \ArrayAccess $value = iconv($that->getCharset(), 'UTF-8', $value); } - $callback = function ($matches) use ($that) { + $callback = function ($matches) { $char = $matches[0]; // \xHH From f11511e300cd84622558eb529ed3f7cec2b8f0cb Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Tue, 28 Feb 2017 15:19:54 +0100 Subject: [PATCH 2/2] fix merge --- .../Serializer/Mapping/Loader/YamlFileLoader.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Symfony/Component/Serializer/Mapping/Loader/YamlFileLoader.php b/src/Symfony/Component/Serializer/Mapping/Loader/YamlFileLoader.php index 656e70928a..e3afa47632 100644 --- a/src/Symfony/Component/Serializer/Mapping/Loader/YamlFileLoader.php +++ b/src/Symfony/Component/Serializer/Mapping/Loader/YamlFileLoader.php @@ -74,14 +74,14 @@ class YamlFileLoader extends FileLoader $attributeMetadata->addGroup($group); } + } - if (isset($data['max_depth'])) { - if (!is_int($data['max_depth'])) { - throw new MappingException(sprintf('The "max_depth" value must be an integer in "%s" for the attribute "%s" of the class "%s".', $this->file, $attribute, $classMetadata->getName())); - } - - $attributeMetadata->setMaxDepth($data['max_depth']); + if (isset($data['max_depth'])) { + if (!is_int($data['max_depth'])) { + throw new MappingException(sprintf('The "max_depth" value must be an integer in "%s" for the attribute "%s" of the class "%s".', $this->file, $attribute, $classMetadata->getName())); } + + $attributeMetadata->setMaxDepth($data['max_depth']); } } }