Skip to content

Commit ce0946d

Browse files
committed
Merge branch '2.3' into 2.7
* 2.3: fixed undefined variable Fixed the phpDoc of UserInterface fixed APCu dep version Added support for the `0.0.0.0/0` trusted proxy [DoctrineBridge][Validator] >= 2.3 Pass association instead of ID as argument [HttpKernel] Lookup the response even if the lock was released after 2 seconds
2 parents 81ab4ee + ca96e33 commit ce0946d

File tree

9 files changed

+11
-41
lines changed

9 files changed

+11
-41
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"php": ">=5.3.9",
2020
"doctrine/common": "~2.4",
2121
"paragonie/random_compat": "~1.0",
22-
"symfony/polyfill-apcu": "~1.0,>=1.0.2",
22+
"symfony/polyfill-apcu": "~1.1",
2323
"twig/twig": "~1.23|~2.0",
2424
"psr/log": "~1.0"
2525
},

src/Symfony/Bridge/Doctrine/Tests/Validator/Constraints/UniqueEntityValidatorTest.php

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
use Doctrine\Common\Persistence\ObjectManager;
1717
use Doctrine\Common\Persistence\ObjectRepository;
1818
use Symfony\Bridge\Doctrine\Test\DoctrineTestHelper;
19-
use Symfony\Bridge\Doctrine\Tests\Fixtures\CompositeIntIdEntity;
2019
use Symfony\Bridge\Doctrine\Tests\Fixtures\SingleIntIdEntity;
2120
use Symfony\Bridge\Doctrine\Tests\Fixtures\DoubleNameEntity;
2221
use Symfony\Bridge\Doctrine\Tests\Fixtures\AssociationEntity;
@@ -404,7 +403,7 @@ public function testAssociatedEntity()
404403

405404
$this->buildViolation('myMessage')
406405
->atPath('property.path.single')
407-
->setInvalidValue(1)
406+
->setInvalidValue($entity1)
408407
->assertRaised();
409408
}
410409

@@ -428,29 +427,6 @@ public function testAssociatedEntityWithNull()
428427
$this->assertNoViolation();
429428
}
430429

431-
/**
432-
* @expectedException \Symfony\Component\Validator\Exception\ConstraintDefinitionException
433-
* @expectedExceptionMessage Associated entities are not allowed to have more than one identifier field
434-
*/
435-
public function testAssociatedCompositeEntity()
436-
{
437-
$constraint = new UniqueEntity(array(
438-
'message' => 'myMessage',
439-
'fields' => array('composite'),
440-
'em' => self::EM_NAME,
441-
));
442-
443-
$composite = new CompositeIntIdEntity(1, 1, 'test');
444-
$associated = new AssociationEntity();
445-
$associated->composite = $composite;
446-
447-
$this->em->persist($composite);
448-
$this->em->persist($associated);
449-
$this->em->flush();
450-
451-
$this->validator->validate($associated, $constraint);
452-
}
453-
454430
/**
455431
* @expectedException \Symfony\Component\Validator\Exception\ConstraintDefinitionException
456432
* @expectedExceptionMessage Object manager "foo" does not exist.

src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntityValidator.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -97,17 +97,6 @@ public function validate($entity, Constraint $constraint)
9797
* getter methods in the Proxy are being bypassed.
9898
*/
9999
$em->initializeObject($criteria[$fieldName]);
100-
101-
$relatedClass = $em->getClassMetadata($class->getAssociationTargetClass($fieldName));
102-
$relatedId = $relatedClass->getIdentifierValues($criteria[$fieldName]);
103-
104-
if (count($relatedId) > 1) {
105-
throw new ConstraintDefinitionException(
106-
'Associated entities are not allowed to have more than one identifier field to be '.
107-
'part of a unique constraint in: '.$class->getName().'#'.$fieldName
108-
);
109-
}
110-
$criteria[$fieldName] = array_pop($relatedId);
111100
}
112101
}
113102

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,10 @@ public function getConfigTreeBuilder()
139139
}
140140

141141
if (false !== strpos($v, '/')) {
142+
if ('0.0.0.0/0' === $v) {
143+
return false;
144+
}
145+
142146
list($v, $mask) = explode('/', $v, 2);
143147

144148
if (strcmp($mask, (int) $mask) || $mask < 1 || $mask > (false !== strpos($v, ':') ? 128 : 32)) {

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ public function getTestValidTrustedProxiesData()
6666
array(array(), array()),
6767
array(array('10.0.0.0/8'), array('10.0.0.0/8')),
6868
array(array('::ffff:0:0/96'), array('::ffff:0:0/96')),
69+
array(array('0.0.0.0/0'), array('0.0.0.0/0')),
6970
);
7071
}
7172

src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_item.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% if link %}
1+
{% if link|default(true) %}
22
{% set icon %}
33
<a href="{{ path('_profiler', { 'token': token, 'panel': name }) }}">{{ icon }}</a>
44
{% endset %}

src/Symfony/Component/ClassLoader/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"minimum-stability": "dev",
1919
"require": {
2020
"php": ">=5.3.9",
21-
"symfony/polyfill-apcu": "~1.0,>=1.0.2"
21+
"symfony/polyfill-apcu": "~1.1"
2222
},
2323
"require-dev": {
2424
"symfony/finder": "~2.0,>=2.0.5"

src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ protected function lock(Request $request, Response $entry)
566566
$wait += 50000;
567567
}
568568

569-
if ($wait < 2000000) {
569+
if ($wait < 5000000) {
570570
// replace the current entry with the fresh one
571571
$new = $this->lookup($request);
572572
$entry->headers = $new->headers;

src/Symfony/Component/Security/Core/User/UserInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ interface UserInterface
4747
* and populated in any number of different ways when the user object
4848
* is created.
4949
*
50-
* @return Role[] The user roles
50+
* @return (Role|string)[] The user roles
5151
*/
5252
public function getRoles();
5353

0 commit comments

Comments
 (0)