Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit bf8d57b

Browse filesBrowse files
committed
Remove BC api version in Validator
1 parent 7192b2f commit bf8d57b
Copy full SHA for bf8d57b

File tree

Expand file treeCollapse file tree

113 files changed

+22
-1645
lines changed
Filter options

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner
Expand file treeCollapse file tree

113 files changed

+22
-1645
lines changed

‎src/Symfony/Bridge/Doctrine/Tests/Validator/Constraints/LegacyUniqueEntityValidatorLegacyApiTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Doctrine/Tests/Validator/Constraints/LegacyUniqueEntityValidatorLegacyApiTest.php
-26Lines changed: 0 additions & 26 deletions
This file was deleted.

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

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Doctrine/Tests/Validator/Constraints/UniqueEntityValidatorTest.php
-5Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,6 @@ class UniqueEntityValidatorTest extends AbstractConstraintValidatorTest
4747
*/
4848
protected $repository;
4949

50-
protected function getApiVersion()
51-
{
52-
return Validation::API_VERSION_2_5;
53-
}
54-
5550
protected function setUp()
5651
{
5752
$this->em = DoctrineTestHelper::createTestEntityManager();

‎src/Symfony/Bridge/Doctrine/composer.json

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Doctrine/composer.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"symfony/property-access": "~2.3|~3.0.0",
2828
"symfony/security": "~2.2|~3.0.0",
2929
"symfony/expression-language": "~2.2|~3.0.0",
30-
"symfony/validator": "~2.5,>=2.5.5|~3.0.0",
30+
"symfony/validator": "~2.7|~3.0.0",
3131
"symfony/translation": "~2.0,>=2.0.5|~3.0.0",
3232
"doctrine/data-fixtures": "1.0.*",
3333
"doctrine/dbal": "~2.2",

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

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php
-21Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -494,30 +494,9 @@ private function addValidationSection(ArrayNodeDefinition $rootNode)
494494
->end()
495495
->scalarNode('translation_domain')->defaultValue('validators')->end()
496496
->booleanNode('strict_email')->defaultFalse()->end()
497-
->enumNode('api')
498-
->values(array('2.4', '2.5', '2.5-bc', 'auto'))
499-
->beforeNormalization()
500-
// XML/YAML parse as numbers, not as strings
501-
->ifTrue(function ($v) { return is_scalar($v); })
502-
->then(function ($v) { return (string) $v; })
503-
->end()
504-
->end()
505497
->end()
506498
->end()
507499
->end()
508-
->validate()
509-
->ifTrue(function ($v) { return !isset($v['validation']['api']) || 'auto' === $v['validation']['api']; })
510-
->then(function ($v) {
511-
// This condition is duplicated in ValidatorBuilder. This
512-
// duplication is necessary in order to know the desired
513-
// API version already during container configuration
514-
// (to adjust service classes etc.)
515-
// See https://github.com/symfony/symfony/issues/11580
516-
$v['validation']['api'] = '2.5-bc';
517-
518-
return $v;
519-
})
520-
->end()
521500
;
522501
}
523502

‎src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
-15Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -750,21 +750,6 @@ private function registerValidationConfiguration(array $config, ContainerBuilder
750750

751751
$validatorBuilder->addMethodCall('setMetadataCache', array(new Reference($config['cache'])));
752752
}
753-
754-
if ('2.5' === $config['api']) {
755-
$api = Validation::API_VERSION_2_5;
756-
} else {
757-
// 2.4 is now the same as 2.5 BC
758-
$api = Validation::API_VERSION_2_5_BC;
759-
// the validation class needs to be changed for BC
760-
$container->setParameter('validator.class', 'Symfony\Component\Validator\ValidatorInterface');
761-
}
762-
763-
$validatorBuilder->addMethodCall('setApiVersion', array($api));
764-
765-
// You can use this parameter to check the API version in your own
766-
// bundle extension classes
767-
$container->setParameter('validator.api', $api);
768753
}
769754

770755
private function getValidatorMappingFiles(ContainerBuilder $container)

‎src/Symfony/Bundle/FrameworkBundle/Resources/config/schema/symfony-1.0.xsd

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Resources/config/schema/symfony-1.0.xsd
-2Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
<xsd:restriction base="xsd:string">
1212
<xsd:enumeration value="auto" />
1313
<xsd:enumeration value="2.4" />
14-
<xsd:enumeration value="2.5" />
15-
<xsd:enumeration value="2.5-bc" />
1614
</xsd:restriction>
1715
</xsd:simpleType>
1816

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

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@ protected static function getBundleDefaultConfig()
131131
'static_method' => array('loadValidatorMetadata'),
132132
'translation_domain' => 'validators',
133133
'strict_email' => false,
134-
'api' => '2.5-bc',
135134
),
136135
'annotations' => array(
137136
'cache' => 'file',

‎src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/validation_2_5_api.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/validation_2_5_api.php
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
$container->loadFromExtension('framework', array(
44
'secret' => 's3cr3t',
55
'validation' => array(
6-
'enabled' => true,
7-
'api' => '2.5',
6+
'enabled' => true
87
),
98
));

‎src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/validation_2_5_bc_api.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/validation_2_5_bc_api.php
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,5 @@
44
'secret' => 's3cr3t',
55
'validation' => array(
66
'enabled' => true,
7-
'api' => '2.5-bc',
87
),
98
));

‎src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/validation_auto_api.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/validation_auto_api.php
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,5 @@
44
'secret' => 's3cr3t',
55
'validation' => array(
66
'enabled' => true,
7-
'api' => 'auto',
87
),
98
));

‎src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/validation_2_5_api.xml

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/validation_2_5_api.xml
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
http://symfony.com/schema/dic/symfony http://symfony.com/schema/dic/symfony/symfony-1.0.xsd">
88

99
<framework:config secret="s3cr3t">
10-
<framework:validation enabled="true" api="2.5" />
10+
<framework:validation enabled="true" />
1111
</framework:config>
1212
</container>

‎src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/validation_2_5_bc_api.xml

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/validation_2_5_bc_api.xml
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
http://symfony.com/schema/dic/symfony http://symfony.com/schema/dic/symfony/symfony-1.0.xsd">
88

99
<framework:config secret="s3cr3t">
10-
<framework:validation enabled="true" api="2.5-bc" />
10+
<framework:validation enabled="true" />
1111
</framework:config>
1212
</container>

‎src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/validation_auto_api.xml

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/validation_auto_api.xml
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
http://symfony.com/schema/dic/symfony http://symfony.com/schema/dic/symfony/symfony-1.0.xsd">
88

99
<framework:config secret="s3cr3t">
10-
<framework:validation enabled="true" api="auto" />
10+
<framework:validation enabled="true" />
1111
</framework:config>
1212
</container>

‎src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/validation_2_5_api.yml

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/validation_2_5_api.yml
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,3 @@ framework:
22
secret: s3cr3t
33
validation:
44
enabled: true
5-
api: 2.5

‎src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/validation_2_5_bc_api.yml

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/validation_2_5_bc_api.yml
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,3 @@ framework:
22
secret: s3cr3t
33
validation:
44
enabled: true
5-
api: 2.5-bc

‎src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/validation_auto_api.yml

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/validation_auto_api.yml
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,3 @@ framework:
22
secret: s3cr3t
33
validation:
44
enabled: true
5-
api: auto

‎src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php
+9-39Lines changed: 9 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ public function testValidation()
280280

281281
$calls = $container->getDefinition('validator.builder')->getMethodCalls();
282282

283-
$this->assertCount(7, $calls);
283+
$this->assertCount(6, $calls);
284284
$this->assertSame('setConstraintValidatorFactory', $calls[0][0]);
285285
$this->assertEquals(array(new Reference('validator.validator_factory')), $calls[0][1]);
286286
$this->assertSame('setTranslator', $calls[1][0]);
@@ -293,8 +293,6 @@ public function testValidation()
293293
$this->assertSame(array('loadValidatorMetadata'), $calls[4][1]);
294294
$this->assertSame('setMetadataCache', $calls[5][0]);
295295
$this->assertEquals(array(new Reference('validator.mapping.cache.apc')), $calls[5][1]);
296-
$this->assertSame('setApiVersion', $calls[6][0]);
297-
$this->assertEquals(array(Validation::API_VERSION_2_5_BC), $calls[6][1]);
298296
}
299297

300298
public function testFullyConfiguredValidationService()
@@ -305,14 +303,14 @@ public function testFullyConfiguredValidationService()
305303

306304
$container = $this->createContainerFromFile('full');
307305

308-
$this->assertInstanceOf('Symfony\Component\Validator\ValidatorInterface', $container->get('validator'));
306+
$this->assertInstanceOf('Symfony\Component\Validator\Validator\RecursiveValidator', $container->get('validator'));
309307
}
310308

311309
public function testValidationService()
312310
{
313311
$container = $this->createContainerFromFile('validation_annotations');
314312

315-
$this->assertInstanceOf('Symfony\Component\Validator\ValidatorInterface', $container->get('validator'));
313+
$this->assertInstanceOf('Symfony\Component\Validator\Validator\RecursiveValidator', $container->get('validator'));
316314
}
317315

318316
public function testAnnotations()
@@ -336,7 +334,7 @@ public function testValidationAnnotations()
336334

337335
$calls = $container->getDefinition('validator.builder')->getMethodCalls();
338336

339-
$this->assertCount(7, $calls);
337+
$this->assertCount(6, $calls);
340338
$this->assertSame('enableAnnotationMapping', $calls[4][0]);
341339
$this->assertEquals(array(new Reference('annotation_reader')), $calls[4][1]);
342340
$this->assertSame('addMethodMapping', $calls[5][0]);
@@ -354,7 +352,7 @@ public function testValidationPaths()
354352

355353
$calls = $container->getDefinition('validator.builder')->getMethodCalls();
356354

357-
$this->assertCount(8, $calls);
355+
$this->assertCount(7, $calls);
358356
$this->assertSame('addXmlMappings', $calls[3][0]);
359357
$this->assertSame('addYamlMappings', $calls[4][0]);
360358
$this->assertSame('enableAnnotationMapping', $calls[5][0]);
@@ -377,9 +375,8 @@ public function testValidationNoStaticMethod()
377375

378376
$calls = $container->getDefinition('validator.builder')->getMethodCalls();
379377

380-
$this->assertCount(5, $calls);
378+
$this->assertCount(4, $calls);
381379
$this->assertSame('addXmlMappings', $calls[3][0]);
382-
// no cache, no annotations, no static methods
383380
}
384381

385382
public function testValidation2Dot5Api()
@@ -388,30 +385,11 @@ public function testValidation2Dot5Api()
388385

389386
$calls = $container->getDefinition('validator.builder')->getMethodCalls();
390387

391-
$this->assertCount(6, $calls);
388+
$this->assertCount(5, $calls);
392389
$this->assertSame('addXmlMappings', $calls[3][0]);
393390
$this->assertSame('addMethodMapping', $calls[4][0]);
394391
$this->assertSame(array('loadValidatorMetadata'), $calls[4][1]);
395-
$this->assertSame('setApiVersion', $calls[5][0]);
396-
$this->assertSame(array(Validation::API_VERSION_2_5), $calls[5][1]);
397392
$this->assertSame('Symfony\Component\Validator\Validator\ValidatorInterface', $container->getParameter('validator.class'));
398-
// no cache, no annotations
399-
}
400-
401-
public function testValidation2Dot5BcApi()
402-
{
403-
$container = $this->createContainerFromFile('validation_2_5_bc_api');
404-
405-
$calls = $container->getDefinition('validator.builder')->getMethodCalls();
406-
407-
$this->assertCount(6, $calls);
408-
$this->assertSame('addXmlMappings', $calls[3][0]);
409-
$this->assertSame('addMethodMapping', $calls[4][0]);
410-
$this->assertSame(array('loadValidatorMetadata'), $calls[4][1]);
411-
$this->assertSame('setApiVersion', $calls[5][0]);
412-
$this->assertSame(array(Validation::API_VERSION_2_5_BC), $calls[5][1]);
413-
$this->assertSame('Symfony\Component\Validator\ValidatorInterface', $container->getParameter('validator.class'));
414-
// no cache, no annotations
415393
}
416394

417395
public function testValidationImplicitApi()
@@ -420,14 +398,10 @@ public function testValidationImplicitApi()
420398

421399
$calls = $container->getDefinition('validator.builder')->getMethodCalls();
422400

423-
$this->assertCount(6, $calls);
401+
$this->assertCount(5, $calls);
424402
$this->assertSame('addXmlMappings', $calls[3][0]);
425403
$this->assertSame('addMethodMapping', $calls[4][0]);
426404
$this->assertSame(array('loadValidatorMetadata'), $calls[4][1]);
427-
$this->assertSame('setApiVersion', $calls[5][0]);
428-
// no cache, no annotations
429-
430-
$this->assertSame(array(Validation::API_VERSION_2_5_BC), $calls[5][1]);
431405
}
432406

433407
/**
@@ -440,14 +414,10 @@ public function testValidationAutoApi()
440414

441415
$calls = $container->getDefinition('validator.builder')->getMethodCalls();
442416

443-
$this->assertCount(6, $calls);
417+
$this->assertCount(5, $calls);
444418
$this->assertSame('addXmlMappings', $calls[3][0]);
445419
$this->assertSame('addMethodMapping', $calls[4][0]);
446420
$this->assertSame(array('loadValidatorMetadata'), $calls[4][1]);
447-
$this->assertSame('setApiVersion', $calls[5][0]);
448-
// no cache, no annotations
449-
450-
$this->assertSame(array(Validation::API_VERSION_2_5_BC), $calls[5][1]);
451421
}
452422

453423
public function testFormsCanBeEnabledWithoutCsrfProtection()

‎src/Symfony/Component/Form/Tests/Extension/Validator/Constraints/FormValidatorTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Tests/Extension/Validator/Constraints/FormValidatorTest.php
-5Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,6 @@ protected function setUp()
5555
parent::setUp();
5656
}
5757

58-
protected function getApiVersion()
59-
{
60-
return Validation::API_VERSION_2_5;
61-
}
62-
6358
protected function createValidator()
6459
{
6560
return new FormValidator($this->serverParams);

‎src/Symfony/Component/Form/Tests/Extension/Validator/Constraints/LegacyFormValidatorLegacyApiTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Tests/Extension/Validator/Constraints/LegacyFormValidatorLegacyApiTest.php
-26Lines changed: 0 additions & 26 deletions
This file was deleted.

‎src/Symfony/Component/Form/composer.json

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/composer.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
},
2525
"require-dev": {
2626
"doctrine/collections": "~1.0",
27-
"symfony/validator": "~2.6|~3.0.0",
27+
"symfony/validator": "~2.7|~3.0.0",
2828
"symfony/http-foundation": "~2.2|~3.0.0",
2929
"symfony/http-kernel": "~2.4|~3.0.0",
3030
"symfony/security-csrf": "~2.4|~3.0.0",

‎src/Symfony/Component/Security/Core/Tests/Validator/Constraints/LegacyUserPasswordValidatorTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Security/Core/Tests/Validator/Constraints/LegacyUserPasswordValidatorTest.php
-26Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.