From adb5327dbbdc06e5a0db6009efd55eb14fdcfba1 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Fri, 14 Aug 2015 12:18:53 +0200 Subject: [PATCH 1/5] [FrameworkBundle] Fix precedence of xdebug.file_link_format --- .../DependencyInjection/FrameworkExtension.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php index 127e7f9c84..75e45202de 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php @@ -356,14 +356,16 @@ class FrameworkExtension extends Extension $loader->load('templating.xml'); $loader->load('templating_php.xml'); - $links = array( - 'textmate' => 'txmt://open?url=file://%%f&line=%%l', - 'macvim' => 'mvim://open?url=file://%%f&line=%%l', - 'emacs' => 'emacs://open?url=file://%%f&line=%%l', - 'sublime' => 'subl://open?url=file://%%f&line=%%l', - ); + if (!$container->hasParameter('templating.helper.code.file_link_format')) { + $links = array( + 'textmate' => 'txmt://open?url=file://%%f&line=%%l', + 'macvim' => 'mvim://open?url=file://%%f&line=%%l', + 'emacs' => 'emacs://open?url=file://%%f&line=%%l', + 'sublime' => 'subl://open?url=file://%%f&line=%%l', + ); - $container->setParameter('templating.helper.code.file_link_format', isset($links[$ide]) ? $links[$ide] : $ide); + $container->setParameter('templating.helper.code.file_link_format', ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format') ?: (isset($links[$ide]) ? $links[$ide] : $ide)); + } $container->setParameter('templating.helper.form.resources', $config['form']['resources']); $container->setParameter('fragment.renderer.hinclude.global_template', $config['hinclude_default_template']); From 4de418045766ace940288da17c1fc9d7055fad73 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Thu, 13 Aug 2015 09:59:41 +0200 Subject: [PATCH 2/5] made Symfony compatible with both Twig 1.x and 2.x --- .../Twig/Tests/Extension/Fixtures/StubFilesystemLoader.php | 4 ++-- src/Symfony/Bundle/TwigBundle/Loader/FilesystemLoader.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Symfony/Bridge/Twig/Tests/Extension/Fixtures/StubFilesystemLoader.php b/src/Symfony/Bridge/Twig/Tests/Extension/Fixtures/StubFilesystemLoader.php index 36c61cd6cc..85102ea56a 100644 --- a/src/Symfony/Bridge/Twig/Tests/Extension/Fixtures/StubFilesystemLoader.php +++ b/src/Symfony/Bridge/Twig/Tests/Extension/Fixtures/StubFilesystemLoader.php @@ -19,12 +19,12 @@ if (!class_exists('Twig_Environment')) { } else { class StubFilesystemLoader extends \Twig_Loader_Filesystem { - protected function findTemplate($name) + protected function findTemplate($name, $throw = true) { // strip away bundle name $parts = explode(':', $name); - return parent::findTemplate(end($parts)); + return parent::findTemplate(end($parts), $throw); } } } diff --git a/src/Symfony/Bundle/TwigBundle/Loader/FilesystemLoader.php b/src/Symfony/Bundle/TwigBundle/Loader/FilesystemLoader.php index fe0fbe15f3..65afe2a33e 100644 --- a/src/Symfony/Bundle/TwigBundle/Loader/FilesystemLoader.php +++ b/src/Symfony/Bundle/TwigBundle/Loader/FilesystemLoader.php @@ -64,7 +64,7 @@ class FilesystemLoader extends \Twig_Loader_Filesystem * * @throws \Twig_Error_Loader if the template could not be found */ - protected function findTemplate($template) + protected function findTemplate($template, $throw = true) { $logicalName = (string) $template; From 2da03b186ae9e9dcc008cb33885bb7048586a987 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Sun, 23 Aug 2015 18:18:32 +0200 Subject: [PATCH 3/5] fixed typo --- UPGRADE-2.7.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UPGRADE-2.7.md b/UPGRADE-2.7.md index 0abc3ae85f..f52220fadc 100644 --- a/UPGRADE-2.7.md +++ b/UPGRADE-2.7.md @@ -473,7 +473,7 @@ Form After: ```jinja - {{ choice_translation_domain is sameas(false) ? choice.label : choice.label|trans({}, choice_translation_domain) }} + {{ choice_translation_domain is same as(false) ? choice.label : choice.label|trans({}, choice_translation_domain) }} ``` Serializer From 6ad4877cde7c20884c00c0a07672afaf52d91309 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=83=C2=A9vin=20Dunglas?= Date: Mon, 24 Aug 2015 03:42:50 +0200 Subject: [PATCH 4/5] [DependencyInjection] Add missing file headers --- .../Tests/Compiler/AutoAliasServicePassTest.php | 9 +++++++++ .../Compiler/MergeExtensionConfigurationPassTest.php | 11 ++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/DependencyInjection/Tests/Compiler/AutoAliasServicePassTest.php b/src/Symfony/Component/DependencyInjection/Tests/Compiler/AutoAliasServicePassTest.php index 368ec3c5cd..e3aba6d707 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Compiler/AutoAliasServicePassTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Compiler/AutoAliasServicePassTest.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace Symfony\Component\DependencyInjection\Tests\Compiler; use Symfony\Component\DependencyInjection\Compiler\AutoAliasServicePass; diff --git a/src/Symfony/Component/DependencyInjection/Tests/Compiler/MergeExtensionConfigurationPassTest.php b/src/Symfony/Component/DependencyInjection/Tests/Compiler/MergeExtensionConfigurationPassTest.php index 1f91b37821..6e112bb7ff 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Compiler/MergeExtensionConfigurationPassTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Compiler/MergeExtensionConfigurationPassTest.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace Symfony\Component\DependencyInjection\Tests\Compiler; use Symfony\Component\DependencyInjection\Compiler\MergeExtensionConfigurationPass; @@ -35,7 +44,7 @@ class MergeExtensionConfigurationPassTest extends \PHPUnit_Framework_TestCase $provider = $this->getMock('Symfony\\Component\\ExpressionLanguage\\ExpressionFunctionProviderInterface'); $container = new ContainerBuilder(new ParameterBag()); $container->registerExtension($extension); - $container->prependExtensionConfig('foo', array('bar' => true )); + $container->prependExtensionConfig('foo', array('bar' => true)); $container->addExpressionLanguageProvider($provider); $pass = new MergeExtensionConfigurationPass(); From cbe6bc9ac4cc1f866e20666e2fb0395f375f3d5f Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 24 Aug 2015 08:32:52 +0200 Subject: [PATCH 5/5] fixed CS --- src/Symfony/Component/Finder/Tests/Shell/CommandTest.php | 2 +- src/Symfony/Component/HttpFoundation/Request.php | 2 +- src/Symfony/Component/HttpFoundation/Tests/RequestTest.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Symfony/Component/Finder/Tests/Shell/CommandTest.php b/src/Symfony/Component/Finder/Tests/Shell/CommandTest.php index 8c6c0064cd..f967cdaa54 100644 --- a/src/Symfony/Component/Finder/Tests/Shell/CommandTest.php +++ b/src/Symfony/Component/Finder/Tests/Shell/CommandTest.php @@ -133,7 +133,7 @@ class CommandTest extends \PHPUnit_Framework_TestCase public function testErrorHandler() { $cmd = Command::create(); - $handler = function() { return 'error-handler'; }; + $handler = function () { return 'error-handler'; }; $cmd->setErrorHandler($handler); $this->assertSame($handler, $cmd->getErrorHandler()); diff --git a/src/Symfony/Component/HttpFoundation/Request.php b/src/Symfony/Component/HttpFoundation/Request.php index 0bd76f3aba..f591ca90be 100644 --- a/src/Symfony/Component/HttpFoundation/Request.php +++ b/src/Symfony/Component/HttpFoundation/Request.php @@ -1479,7 +1479,7 @@ class Request // Content passed in parameter (test) if (is_string($this->content)) { - $resource = fopen('php://temp','r+'); + $resource = fopen('php://temp', 'r+'); fwrite($resource, $this->content); rewind($resource); diff --git a/src/Symfony/Component/HttpFoundation/Tests/RequestTest.php b/src/Symfony/Component/HttpFoundation/Tests/RequestTest.php index 797a00acda..bc4b0fd5a2 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/RequestTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/RequestTest.php @@ -934,7 +934,7 @@ class RequestTest extends \PHPUnit_Framework_TestCase public function testContentAsResource() { - $resource = fopen('php://memory','r+'); + $resource = fopen('php://memory', 'r+'); fwrite($resource, 'My other content'); rewind($resource);