Skip to content

Commit

Permalink
Merge branch '3.1'
Browse files Browse the repository at this point in the history
* 3.1:
  [Debug] Remove GLOBALS from exception context to avoid endless recursion
  [Serializer] Improve test coverage of the MaxDepth annotation
  DX: replace @link with @see annotation
  bumped min version of Twig to 1.28
  • Loading branch information
fabpot committed Nov 16, 2016
2 parents 5c0d0ae + a43ccb1 commit c57d8ed
Show file tree
Hide file tree
Showing 19 changed files with 58 additions and 33 deletions.
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -18,7 +18,7 @@
"require": {
"php": ">=5.5.9",
"doctrine/common": "~2.4",
"twig/twig": "~1.27|~2.0",
"twig/twig": "~1.28|~2.0",
"psr/cache": "~1.0",
"psr/log": "~1.0",
"symfony/polyfill-intl-icu": "~1.0",
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Bundle/SecurityBundle/composer.json
Expand Up @@ -40,7 +40,7 @@
"symfony/yaml": "~2.8|~3.0",
"symfony/expression-language": "~2.8|~3.0",
"doctrine/doctrine-bundle": "~1.4",
"twig/twig": "~1.27|~2.0"
"twig/twig": "~1.28|~2.0"
},
"suggest": {
"symfony/security-acl": "For using the ACL functionality of this bundle"
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Bundle/TwigBundle/composer.json
Expand Up @@ -20,7 +20,7 @@
"symfony/twig-bridge": "~3.2",
"symfony/http-foundation": "~2.8|~3.0",
"symfony/http-kernel": "~2.8|~3.0",
"twig/twig": "~1.27|~2.0"
"twig/twig": "~1.28|~2.0"
},
"require-dev": {
"symfony/asset": "~2.8|~3.0",
Expand Down
Expand Up @@ -120,7 +120,7 @@ public function panelAction(Request $request, $token)
'panel' => $panel,
'page' => $page,
'request' => $request,
'templates' => $this->getTemplateManager()->getTemplates($profile),
'templates' => $this->getTemplateManager()->getNames($profile),
'is_ajax' => $request->isXmlHttpRequest(),
'profiler_markup_version' => 2, // 1 = original profiler, 2 = Symfony 2.8+ profiler
)), 200, array('Content-Type' => 'text/html'));
Expand Down Expand Up @@ -203,7 +203,7 @@ public function toolbarAction(Request $request, $token)
'request' => $request,
'position' => $position,
'profile' => $profile,
'templates' => $this->getTemplateManager()->getTemplates($profile),
'templates' => $this->getTemplateManager()->getNames($profile),
'profiler_url' => $url,
'token' => $token,
'profiler_markup_version' => 2, // 1 = original toolbar, 2 = Symfony 2.8+ toolbar
Expand Down
Expand Up @@ -67,7 +67,9 @@ public function getName(Profile $profile, $panel)
*
* @param Profile $profile
*
* @return array
* @return Twig_Template[]
*
* @deprecated not used anymore internally
*/
public function getTemplates(Profile $profile)
{
Expand All @@ -89,7 +91,7 @@ public function getTemplates(Profile $profile)
*
* @throws \UnexpectedValueException
*/
protected function getNames(Profile $profile)
public function getNames(Profile $profile)
{
$templates = array();

Expand Down
Expand Up @@ -112,7 +112,11 @@
{% if templates is defined %}
<ul id="menu-profiler">
{% for name, template in templates %}
{% set menu %}{{ template.renderBlock('menu', { collector: profile.getcollector(name), profiler_markup_version: profiler_markup_version }) }}{% endset %}
{% set menu -%}
{% with { collector: profile.getcollector(name), profiler_markup_version: profiler_markup_version } %}
{{ block('menu', template) }}
{% endwith %}
{%- endset %}
{% if menu is not empty %}
<li class="{{ name }} {{ name == panel ? 'selected' : '' }}">
<a href="{{ path('_profiler', { token: token, panel: name }) }}">{{ menu|raw }}</a>
Expand Down
Expand Up @@ -13,16 +13,17 @@

<div id="sfToolbarMainContent-{{ token }}" class="sf-toolbarreset clear-fix" data-no-turbolink>
{% for name, template in templates %}
{{ template.renderblock('toolbar', {
'collector': profile.getcollector(name),
'profiler_url': profiler_url,
'token': profile.token,
'name': name,
'profiler_markup_version': profiler_markup_version,
'csp_script_nonce': csp_script_nonce,
'csp_style_nonce': csp_style_nonce
})
}}
{% with {
collector: profile.getcollector(name),
profiler_url: profiler_url,
token: profile.token,
name: name,
profiler_markup_version: profiler_markup_version,
csp_script_nonce: csp_script_nonce,
csp_style_nonce: csp_style_nonce
} %}
{{ block('toolbar', template) }}
{% endwith %}
{% endfor %}

{% if 'normal' != position %}
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Console/Logger/ConsoleLogger.php
Expand Up @@ -22,7 +22,7 @@
*
* @author Kévin Dunglas <dunglas@gmail.com>
*
* @link http://www.php-fig.org/psr/psr-3/
* @see http://www.php-fig.org/psr/psr-3/
*/
class ConsoleLogger extends AbstractLogger
{
Expand Down
4 changes: 4 additions & 0 deletions src/Symfony/Component/Debug/ErrorHandler.php
Expand Up @@ -378,6 +378,10 @@ public function handleError($type, $message, $file, $line, array $context, array
return $type && $log;
}

if (isset($context['GLOBALS']) && ($this->scopedErrors & $type)) {
unset($context['GLOBALS']);
}

if (null !== $backtrace && $type & E_ERROR) {
// E_ERROR fatal errors are triggered on HHVM when
// hhvm.error_handling.call_user_handler_on_fatals=1
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Form/FormTypeGuesserInterface.php
Expand Up @@ -54,7 +54,7 @@ public function guessMaxLength($class, $property);
* Example:
* You want a float greater than 5, 4.512313 is not valid but length(4.512314) > length(5)
*
* @link https://github.com/symfony/symfony/pull/3927
* @see https://github.com/symfony/symfony/pull/3927
*
* @param string $class The fully qualified class name
* @param string $property The name of the property to guess for
Expand Down
Expand Up @@ -508,7 +508,7 @@ public function testReverseTransformExpectsValidNumber()
/**
* @expectedException \Symfony\Component\Form\Exception\TransformationFailedException
*
* @link https://github.com/symfony/symfony/issues/3161
* @see https://github.com/symfony/symfony/issues/3161
*/
public function testReverseTransformDisallowsNaN()
{
Expand Down
Expand Up @@ -28,7 +28,7 @@ class FileinfoMimeTypeGuesser implements MimeTypeGuesserInterface
*
* @param string $magicFile A magic file to use with the finfo instance
*
* @link http://www.php.net/manual/en/function.finfo-open.php
* @see http://www.php.net/manual/en/function.finfo-open.php
*/
public function __construct($magicFile = null)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/HttpFoundation/Request.php
Expand Up @@ -1693,7 +1693,7 @@ public function getAcceptableContentTypes()
* It works if your JavaScript library sets an X-Requested-With HTTP header.
* It is known to work with common JavaScript frameworks:
*
* @link http://en.wikipedia.org/wiki/List_of_Ajax_frameworks#JavaScript
* @see http://en.wikipedia.org/wiki/List_of_Ajax_frameworks#JavaScript
*
* @return bool true if the request is an XMLHttpRequest, false otherwise
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/HttpFoundation/Response.php
Expand Up @@ -1213,7 +1213,7 @@ public static function closeOutputBuffers($targetLevel, $flush)
/**
* Checks if we need to remove Cache-Control for SSL encrypted downloads when using IE < 9.
*
* @link http://support.microsoft.com/kb/323308
* @see http://support.microsoft.com/kb/323308
*/
protected function ensureIEOverSSLCompatibility(Request $request)
{
Expand Down
Expand Up @@ -21,7 +21,7 @@
*
* @author Bernhard Schussek <bschussek@gmail.com>
*
* @link http://source.icu-project.org/repos/icu/icu4j/trunk/main/classes/core/src/com/ibm/icu/util/Region.java
* @see http://source.icu-project.org/repos/icu/icu4j/trunk/main/classes/core/src/com/ibm/icu/util/Region.java
*
* @internal
*/
Expand Down
Expand Up @@ -62,7 +62,7 @@ public function __construct($cost)
*
* @throws BadCredentialsException when the given password is too long
*
* @link http://lxr.php.net/xref/PHP_5_5/ext/standard/password.c#111
* @see http://lxr.php.net/xref/PHP_5_5/ext/standard/password.c#111
*/
public function encodePassword($raw, $salt)
{
Expand Down
22 changes: 18 additions & 4 deletions src/Symfony/Component/Serializer/Tests/Annotation/MaxDepthTest.php
Expand Up @@ -18,6 +18,22 @@
*/
class MaxDepthTest extends \PHPUnit_Framework_TestCase
{
/**
* @expectedException \Symfony\Component\Serializer\Exception\InvalidArgumentException
*/
public function testNotSetMaxDepthParameter()
{
new MaxDepth(array());
}

/**
* @expectedException \Symfony\Component\Serializer\Exception\InvalidArgumentException
*/
public function testEmptyMaxDepthParameter()
{
new MaxDepth(array('value' => ''));
}

/**
* @expectedException \Symfony\Component\Serializer\Exception\InvalidArgumentException
*/
Expand All @@ -28,9 +44,7 @@ public function testNotAnIntMaxDepthParameter()

public function testMaxDepthParameters()
{
$validData = 3;

$groups = new MaxDepth(array('value' => 3));
$this->assertEquals($validData, $groups->getMaxDepth());
$maxDepth = new MaxDepth(array('value' => 3));
$this->assertEquals(3, $maxDepth->getMaxDepth());
}
}
4 changes: 2 additions & 2 deletions src/Symfony/Component/Validator/Constraints/IbanValidator.php
Expand Up @@ -20,7 +20,7 @@
* @author Michael Schummel
* @author Bernhard Schussek <bschussek@gmail.com>
*
* @link http://www.michael-schummel.de/2007/10/05/iban-prufung-mit-php/
* @see http://www.michael-schummel.de/2007/10/05/iban-prufung-mit-php/
*/
class IbanValidator extends ConstraintValidator
{
Expand All @@ -33,7 +33,7 @@ class IbanValidator extends ConstraintValidator
* a BBAN (Basic Bank Account Number) which has a fixed length per country and,
* included within it, a bank identifier with a fixed position and a fixed length per country
*
* @link http://www.swift.com/dsp/resources/documents/IBAN_Registry.pdf
* @see http://www.swift.com/dsp/resources/documents/IBAN_Registry.pdf
*
* @var array
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Validator/Constraints/Regex.php
Expand Up @@ -56,7 +56,7 @@ public function getRequiredOptions()
* Pattern is also ignored if match=false since the pattern should
* then be reversed before application.
*
* @link http://dev.w3.org/html5/spec/single-page.html#the-pattern-attribute
* @see http://dev.w3.org/html5/spec/single-page.html#the-pattern-attribute
*
* @return string|null
*/
Expand Down

0 comments on commit c57d8ed

Please sign in to comment.