Merge branch '2.3' into 2.6

* 2.3:
  CS: fix some license headers
  CS: Ensure there is no code on the same line as the PHP open tag and it is followed by a blankline
  use visited lookup with reference to gain performance
  Replace GET parameters when changed

Conflicts:
	src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php
This commit is contained in:
Fabien Potencier 2015-03-24 18:00:37 +01:00
commit 2559628654
13 changed files with 44 additions and 17 deletions

6
.php_cs Normal file
View File

@ -0,0 +1,6 @@
<?php
return Symfony\CS\Config\Config::create()
->setUsingLinter(false)
->setUsingCache(true)
;

View File

@ -1,4 +1,5 @@
<?php
/*
* This file is part of the Symfony package.
*

View File

@ -1,4 +1,5 @@
<?php
/*
* This file is part of the Symfony package.
*

View File

@ -77,7 +77,7 @@ class PhpStringTokenParser
if ('\'' === $str[$bLength]) {
return str_replace(
array('\\\\', '\\\''),
array( '\\', '\''),
array('\\', '\''),
substr($str, $bLength + 1, -1)
);
} else {

View File

@ -1235,7 +1235,7 @@ EOF;
*
* @return bool
*/
private function hasReference($id, array $arguments, $deep = false, array $visited = array())
private function hasReference($id, array $arguments, $deep = false, array &$visited = array())
{
foreach ($arguments as $argument) {
if (is_array($argument)) {

View File

@ -197,9 +197,18 @@ class Form extends Link implements \ArrayAccess
{
$uri = parent::getUri();
if (!in_array($this->getMethod(), array('POST', 'PUT', 'DELETE', 'PATCH')) && $queryString = http_build_query($this->getValues(), null, '&')) {
$sep = false === strpos($uri, '?') ? '?' : '&';
$uri .= $sep.$queryString;
if (!in_array($this->getMethod(), array('POST', 'PUT', 'DELETE', 'PATCH'))) {
$query = parse_url($uri, PHP_URL_QUERY);
$currentParameters = array();
if ($query) {
parse_str($query, $currentParameters);
}
$queryString = http_build_query(array_merge($currentParameters, $this->getValues()), null, '&');
$pos = strpos($uri, '?');
$base = false === $pos ? $uri : substr($uri, 0, $pos);
$uri = rtrim($base.'?'.$queryString, '?');
}
return $uri;

View File

@ -593,6 +593,12 @@ class FormTest extends \PHPUnit_Framework_TestCase
array(),
'/foo?bar=bar&foo=foo',
),
array(
'replaces query values with the form values',
'<form action="/foo?bar=bar"><input type="text" name="bar" value="foo" /><input type="submit" /></form>',
array(),
'/foo?bar=foo',
),
array(
'returns an empty URI if the action is empty',
'<form><input type="submit" /></form>',

View File

@ -2,12 +2,12 @@
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Form\Extension\Core\ChoiceList;

View File

@ -1,4 +1,5 @@
<?php
/*
* This file is part of the Symfony package.
*

View File

@ -3,7 +3,7 @@
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien.potencier@symfony-project.com>
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.

View File

@ -1,4 +1,5 @@
<?php
/*
* This file is part of the Symfony package.
*

View File

@ -1,4 +1,5 @@
<?php
/*
* This file is part of the Symfony package.
*

View File

@ -1,9 +1,4 @@
<?php
namespace Symfony\Component\Security\Http\RememberMe;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Request;
/*
* This file is part of the Symfony package.
@ -14,6 +9,12 @@ use Symfony\Component\HttpFoundation\Request;
* file that was distributed with this source code.
*/
namespace Symfony\Component\Security\Http\RememberMe;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Request;
/**
* Interface that needs to be implemented by classes which provide remember-me
* capabilities.