Updating Symfony lib and dependencies:

Package operations: 2 installs, 23 updates, 0 removals
  - Updating psr/log (1.1.0 => 1.1.2)
  - Updating symfony/debug (v3.4.30 => v3.4.35)
  - Updating symfony/console (v3.4.30 => v3.4.35)
  - Updating symfony/dotenv (v3.4.30 => v3.4.35)
  - Updating symfony/routing (v3.4.30 => v3.4.35)
  - Updating symfony/finder (v3.4.30 => v3.4.35)
  - Updating symfony/filesystem (v3.4.30 => v3.4.35)
  - Installing symfony/polyfill-util (v1.12.0)
  - Installing symfony/polyfill-php56 (v1.12.0)
  - Updating symfony/http-foundation (v3.4.30 => v3.4.35)
  - Updating symfony/event-dispatcher (v3.4.30 => v3.4.35)
  - Updating symfony/http-kernel (v3.4.30 => v3.4.35)
  - Updating symfony/config (v3.4.30 => v3.4.35)
  - Updating symfony/dependency-injection (v3.4.30 => v3.4.35)
  - Updating symfony/class-loader (v3.4.30 => v3.4.35)
  - Updating symfony/cache (v3.4.30 => v3.4.35)
  - Updating symfony/framework-bundle (v3.4.30 => v3.4.35)
  - Updating twig/twig (v1.42.2 => v1.42.4)
  - Updating symfony/twig-bridge (v3.4.30 => v3.4.35)
  - Updating symfony/twig-bundle (v3.4.30 => v3.4.35)
  - Updating symfony/yaml (v3.4.30 => v3.4.35)
  - Updating symfony/stopwatch (v3.4.30 => v3.4.35)
  - Updating symfony/var-dumper (v3.4.30 => v3.4.35)
  - Updating symfony/web-profiler-bundle (v3.4.30 => v3.4.35)
  - Updating symfony/css-selector (v3.4.30 => v3.4.35)
This commit is contained in:
Molkobain
2019-11-18 18:04:32 +01:00
parent 532eb466a1
commit c76cccd2e7
633 changed files with 4154 additions and 4093 deletions

View File

@@ -19,6 +19,7 @@ use Symfony\Component\HttpKernel\Profiler\Profiler;
use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Loader\ExistsLoaderInterface;
use Twig\Loader\SourceContextLoaderInterface;
/**
* ExceptionController.
@@ -118,17 +119,22 @@ class ExceptionController
protected function templateExists($template)
{
$loader = $this->twig->getLoader();
if ($loader instanceof ExistsLoaderInterface) {
return $loader->exists($template);
if (1 === Environment::MAJOR_VERSION && !$loader instanceof ExistsLoaderInterface) {
try {
if ($loader instanceof SourceContextLoaderInterface) {
$loader->getSourceContext($template);
} else {
$loader->getSource($template);
}
return true;
} catch (LoaderError $e) {
}
return false;
}
try {
$loader->getSource($template);
return true;
} catch (LoaderError $e) {
}
return false;
return $loader->exists($template);
}
}

View File

@@ -78,8 +78,7 @@ class RouterController
/**
* Returns the routing traces associated to the given request.
*
* @param RequestDataCollector $request
* @param string $method
* @param string $method
*
* @return array
*/

View File

@@ -64,9 +64,7 @@ class WebProfilerExtension extends Extension
}
/**
* Returns the base path for the XSD files.
*
* @return string The XSD base path
* {@inheritdoc}
*/
public function getXsdValidationBasePath()
{

View File

@@ -42,8 +42,7 @@ class TemplateManager
/**
* Gets the template name for a given panel.
*
* @param Profile $profile
* @param string $panel
* @param string $panel
*
* @return mixed
*
@@ -118,21 +117,22 @@ class TemplateManager
protected function templateExists($template)
{
$loader = $this->twig->getLoader();
if ($loader instanceof ExistsLoaderInterface) {
return $loader->exists($template);
}
try {
if ($loader instanceof SourceContextLoaderInterface || method_exists($loader, 'getSourceContext')) {
$loader->getSourceContext($template);
} else {
$loader->getSource($template);
if (1 === Environment::MAJOR_VERSION && !$loader instanceof ExistsLoaderInterface) {
try {
if ($loader instanceof SourceContextLoaderInterface) {
$loader->getSourceContext($template);
} else {
$loader->getSource($template);
}
return true;
} catch (LoaderError $e) {
}
return true;
} catch (LoaderError $e) {
return false;
}
return false;
return $loader->exists($template);
}
}

View File

@@ -13,7 +13,7 @@
{% set text %}
<div class="sf-toolbar-info-piece">
<b>Locale</b>
<b>Default locale</b>
<span class="sf-toolbar-status">
{{ collector.locale|default('-') }}
</span>
@@ -73,7 +73,7 @@
<div class="metrics">
<div class="metric">
<span class="value">{{ collector.locale|default('-') }}</span>
<span class="label">Locale</span>
<span class="label">Default locale</span>
</div>
<div class="metric">
<span class="value">{{ collector.fallbackLocales|join(', ')|default('-') }}</span>
@@ -152,7 +152,7 @@
</div>
{% else %}
{% block fallback_messages %}
{{ helper.render_table(messages_fallback) }}
{{ helper.render_table(messages_fallback, true) }}
{% endblock %}
{% endif %}
</div>
@@ -185,11 +185,14 @@
{% endblock %}
{% macro render_table(messages) %}
{% macro render_table(messages, is_fallback) %}
<table>
<thead>
<tr>
<th>Locale</th>
{% if is_fallback %}
<th>Fallback locale</th>
{% endif %}
<th>Domain</th>
<th>Times used</th>
<th>Message ID</th>
@@ -200,6 +203,9 @@
{% for message in messages %}
<tr>
<td class="font-normal text-small nowrap">{{ message.locale }}</td>
{% if is_fallback %}
<td class="font-normal text-small nowrap">{{ message.fallbackLocale|default('-') }}</td>
{% endif %}
<td class="font-normal text-small text-bold nowrap">{{ message.domain }}</td>
<td class="font-normal text-small nowrap">{{ message.count }}</td>
<td>

View File

@@ -15,7 +15,7 @@
Sfjs.load(
'sfwdt{{ token }}',
'{{ path("_wdt", { "token": token }) }}',
'{{ path("_wdt", { "token": token })|escape('js') }}',
function(xhr, el) {
/* Evaluate embedded scripts inside the toolbar */

View File

@@ -98,9 +98,7 @@ class ProfilerControllerTest extends TestCase
->expects($this->exactly(2))
->method('loadProfile')
->willReturnCallback(function ($token) {
if ('found' == $token) {
return new Profile($token);
}
return 'found' == $token ? new Profile($token) : null;
})
;

View File

@@ -15,6 +15,8 @@ use Symfony\Bundle\WebProfilerBundle\Profiler\TemplateManager;
use Symfony\Bundle\WebProfilerBundle\Tests\TestCase;
use Symfony\Component\HttpKernel\Profiler\Profile;
use Twig\Environment;
use Twig\Loader\LoaderInterface;
use Twig\Loader\SourceContextLoaderInterface;
/**
* Test for TemplateManager class.
@@ -53,11 +55,9 @@ class TemplateManagerTest extends TestCase
$this->templateManager = new TemplateManager($profiler, $twigEnvironment, $templates);
}
/**
* @expectedException \Symfony\Component\HttpKernel\Exception\NotFoundHttpException
*/
public function testGetNameOfInvalidTemplate()
{
$this->expectException('Symfony\Component\HttpKernel\Exception\NotFoundHttpException');
$this->templateManager->getName(new Profile('token'), 'notexistingpanel');
}
@@ -126,11 +126,16 @@ class TemplateManagerTest extends TestCase
->method('loadTemplate')
->willReturn('loadedTemplate');
if (interface_exists('Twig\Loader\SourceContextLoaderInterface')) {
$loader = $this->getMockBuilder('Twig\Loader\SourceContextLoaderInterface')->getMock();
if (Environment::MAJOR_VERSION > 1) {
$loader = $this->createMock(LoaderInterface::class);
$loader
->expects($this->any())
->method('exists')
->willReturn(true);
} else {
$loader = $this->getMockBuilder('Twig\Loader\LoaderInterface')->getMock();
$loader = $this->createMock(SourceContextLoaderInterface::class);
}
$this->twigEnvironment->expects($this->any())->method('getLoader')->willReturn($loader);
return $this->twigEnvironment;