Merge branch '3.4'

* 3.4:
  Skip tests affected by PHP bug 75354
  fix deps
  fix PHP 7.2 compatibility
  [Form] Fix error message in circular reference dependencies check
This commit is contained in:
Nicolas Grekas 2017-10-10 19:12:22 +02:00
commit 990917fe30
8 changed files with 18 additions and 7 deletions

View File

@ -99,7 +99,7 @@
}, },
"conflict": { "conflict": {
"phpdocumentor/reflection-docblock": "<3.0||>=3.2.0,<3.2.2", "phpdocumentor/reflection-docblock": "<3.0||>=3.2.0,<3.2.2",
"phpdocumentor/type-resolver": "<0.2.0", "phpdocumentor/type-resolver": "<0.2.1",
"phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0" "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0"
}, },
"provide": { "provide": {

View File

@ -61,7 +61,7 @@
}, },
"conflict": { "conflict": {
"phpdocumentor/reflection-docblock": "<3.0", "phpdocumentor/reflection-docblock": "<3.0",
"phpdocumentor/type-resolver": "<0.2.0", "phpdocumentor/type-resolver": "<0.2.1",
"phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0", "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0",
"symfony/asset": "<3.4", "symfony/asset": "<3.4",
"symfony/console": "<3.4", "symfony/console": "<3.4",

View File

@ -111,7 +111,7 @@ class FormRegistry implements FormRegistryInterface
if (isset($this->checkedTypes[$fqcn])) { if (isset($this->checkedTypes[$fqcn])) {
$types = implode(' > ', array_merge(array_keys($this->checkedTypes), array($fqcn))); $types = implode(' > ', array_merge(array_keys($this->checkedTypes), array($fqcn)));
throw new LogicException(sprintf('Circular reference detected for form "%s" (%s).', $fqcn, $types)); throw new LogicException(sprintf('Circular reference detected for form type "%s" (%s).', $fqcn, $types));
} }
$this->checkedTypes[$fqcn] = true; $this->checkedTypes[$fqcn] = true;

View File

@ -162,7 +162,7 @@ class FormRegistryTest extends TestCase
/** /**
* @expectedException \Symfony\Component\Form\Exception\LogicException * @expectedException \Symfony\Component\Form\Exception\LogicException
* @expectedExceptionMessage Circular reference detected for form "Symfony\Component\Form\Tests\Fixtures\FormWithSameParentType" (Symfony\Component\Form\Tests\Fixtures\FormWithSameParentType > Symfony\Component\Form\Tests\Fixtures\FormWithSameParentType). * @expectedExceptionMessage Circular reference detected for form type "Symfony\Component\Form\Tests\Fixtures\FormWithSameParentType" (Symfony\Component\Form\Tests\Fixtures\FormWithSameParentType > Symfony\Component\Form\Tests\Fixtures\FormWithSameParentType).
*/ */
public function testFormCannotHaveItselfAsAParent() public function testFormCannotHaveItselfAsAParent()
{ {
@ -175,7 +175,7 @@ class FormRegistryTest extends TestCase
/** /**
* @expectedException \Symfony\Component\Form\Exception\LogicException * @expectedException \Symfony\Component\Form\Exception\LogicException
* @expectedExceptionMessage Circular reference detected for form "Symfony\Component\Form\Tests\Fixtures\RecursiveFormTypeFoo" (Symfony\Component\Form\Tests\Fixtures\RecursiveFormTypeFoo > Symfony\Component\Form\Tests\Fixtures\RecursiveFormTypeBar > Symfony\Component\Form\Tests\Fixtures\RecursiveFormTypeBaz > Symfony\Component\Form\Tests\Fixtures\RecursiveFormTypeFoo). * @expectedExceptionMessage Circular reference detected for form type "Symfony\Component\Form\Tests\Fixtures\RecursiveFormTypeFoo" (Symfony\Component\Form\Tests\Fixtures\RecursiveFormTypeFoo > Symfony\Component\Form\Tests\Fixtures\RecursiveFormTypeBar > Symfony\Component\Form\Tests\Fixtures\RecursiveFormTypeBaz > Symfony\Component\Form\Tests\Fixtures\RecursiveFormTypeFoo).
*/ */
public function testRecursiveFormDependencies() public function testRecursiveFormDependencies()
{ {

View File

@ -35,7 +35,7 @@
}, },
"conflict": { "conflict": {
"phpdocumentor/reflection-docblock": "<3.0||>=3.2.0,<3.2.2", "phpdocumentor/reflection-docblock": "<3.0||>=3.2.0,<3.2.2",
"phpdocumentor/type-resolver": "<0.2.0", "phpdocumentor/type-resolver": "<0.2.1",
"symfony/dependency-injection": "<3.4" "symfony/dependency-injection": "<3.4"
}, },
"suggest": { "suggest": {

View File

@ -31,6 +31,7 @@
"phpdocumentor/reflection-docblock": "^3.0|^4.0" "phpdocumentor/reflection-docblock": "^3.0|^4.0"
}, },
"conflict": { "conflict": {
"phpdocumentor/type-resolver": "<0.2.1",
"symfony/dependency-injection": "<3.4", "symfony/dependency-injection": "<3.4",
"symfony/property-access": "<3.4", "symfony/property-access": "<3.4",
"symfony/property-info": "<3.4", "symfony/property-info": "<3.4",

View File

@ -261,11 +261,13 @@ class RecursiveContextualValidator implements ContextualValidatorInterface
if (is_object($objectOrClass)) { if (is_object($objectOrClass)) {
$object = $objectOrClass; $object = $objectOrClass;
$class = get_class($object);
$cacheKey = spl_object_hash($objectOrClass); $cacheKey = spl_object_hash($objectOrClass);
$propertyPath = PropertyPath::append($this->defaultPropertyPath, $propertyName); $propertyPath = PropertyPath::append($this->defaultPropertyPath, $propertyName);
} else { } else {
// $objectOrClass contains a class name // $objectOrClass contains a class name
$object = null; $object = null;
$class = $objectOrClass;
$cacheKey = null; $cacheKey = null;
$propertyPath = $this->defaultPropertyPath; $propertyPath = $this->defaultPropertyPath;
} }
@ -280,7 +282,7 @@ class RecursiveContextualValidator implements ContextualValidatorInterface
$this->validateGenericNode( $this->validateGenericNode(
$value, $value,
$object, $object,
$cacheKey.':'.get_class($object).':'.$propertyName, $cacheKey.':'.$class.':'.$propertyName,
$propertyMetadata, $propertyMetadata,
$propertyPath, $propertyPath,
$groups, $groups,

View File

@ -94,6 +94,10 @@ EODUMP;
*/ */
public function testDumpInterval($intervalSpec, $ms, $invert, $expected) public function testDumpInterval($intervalSpec, $ms, $invert, $expected)
{ {
if ($ms && PHP_VERSION_ID >= 70200 && version_compare(PHP_VERSION, '7.2.0rc2', '<=')) {
$this->markTestSkipped('Skipped on 7.2 before rc3 because of php bug #75354.');
}
$interval = $this->createInterval($intervalSpec, $ms, $invert); $interval = $this->createInterval($intervalSpec, $ms, $invert);
$xDump = <<<EODUMP $xDump = <<<EODUMP
@ -110,6 +114,10 @@ EODUMP;
*/ */
public function testDumpIntervalExcludingVerbosity($intervalSpec, $ms, $invert, $expected) public function testDumpIntervalExcludingVerbosity($intervalSpec, $ms, $invert, $expected)
{ {
if ($ms && PHP_VERSION_ID >= 70200 && version_compare(PHP_VERSION, '7.2.0rc2', '<=')) {
$this->markTestSkipped('Skipped on 7.2 before rc3 because of php bug #75354.');
}
$interval = $this->createInterval($intervalSpec, $ms, $invert); $interval = $this->createInterval($intervalSpec, $ms, $invert);
$xDump = <<<EODUMP $xDump = <<<EODUMP