Skip to content

Commit 3de593a

Browse files
[DependencyInjection] Deprecate ExtensionInterface::getXsdValidationBasePath() and getNamespace()
1 parent 5ececce commit 3de593a

File tree

8 files changed

+33
-0
lines changed

8 files changed

+33
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ CHANGELOG
1414
* Handle declaring services using PHP arrays that follow the same shape as corresponding yaml files
1515
* Deprecate using `$this` or its internal scope from PHP config files; use the `$loader` variable instead
1616
* Deprecate XML configuration format, use YAML or PHP instead
17+
* Deprecate `ExtensionInterface::getXsdValidationBasePath()` and `getNamespace()`
1718

1819
7.3
1920
---

Extension/Extension.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ abstract class Extension implements ExtensionInterface, ConfigurationExtensionIn
3030

3131
/**
3232
* @return string|false
33+
*
34+
* @deprecated since Symfony 7.4, to be removed in Symfony 8.0 together with XML support.
3335
*/
3436
public function getXsdValidationBasePath()
3537
{
@@ -38,6 +40,8 @@ public function getXsdValidationBasePath()
3840

3941
/**
4042
* @return string
43+
*
44+
* @deprecated since Symfony 7.4, to be removed in Symfony 8.0 together with XML support.
4145
*/
4246
public function getNamespace()
4347
{

Extension/ExtensionInterface.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,17 @@ public function load(array $configs, ContainerBuilder $container);
3535
* Returns the namespace to be used for this extension (XML namespace).
3636
*
3737
* @return string
38+
*
39+
* @deprecated since Symfony 7.4, to be removed in Symfony 8.0 together with XML support.
3840
*/
3941
public function getNamespace();
4042

4143
/**
4244
* Returns the base path for the XSD files.
4345
*
4446
* @return string|false
47+
*
48+
* @deprecated since Symfony 7.4, to be removed in Symfony 8.0 together with XML support.
4549
*/
4650
public function getXsdValidationBasePath();
4751

Tests/Fixtures/includes/AcmeExtension.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,17 @@ public function load(array $configs, ContainerBuilder $configuration): void
1010
$configuration->setParameter('acme.configs', $configs);
1111
}
1212

13+
/**
14+
* @deprecated since Symfony 7.4, to be removed in Symfony 8.0 together with XML support.
15+
*/
1316
public function getXsdValidationBasePath(): string|false
1417
{
1518
return false;
1619
}
1720

21+
/**
22+
* @deprecated since Symfony 7.4, to be removed in Symfony 8.0 together with XML support.
23+
*/
1824
public function getNamespace(): string
1925
{
2026
return 'http://www.example.com/schema/acme';

Tests/Fixtures/includes/ProjectExtension.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,17 @@ public function load(array $configs, ContainerBuilder $configuration): void
2323
$configuration->setParameter('project.parameter.foo', $config['foo'] ?? 'foobar');
2424
}
2525

26+
/**
27+
* @deprecated since Symfony 7.4, to be removed in Symfony 8.0 together with XML support.
28+
*/
2629
public function getXsdValidationBasePath(): string|false
2730
{
2831
return false;
2932
}
3033

34+
/**
35+
* @deprecated since Symfony 7.4, to be removed in Symfony 8.0 together with XML support.
36+
*/
3137
public function getNamespace(): string
3238
{
3339
return 'http://www.example.com/schema/project';

Tests/Fixtures/includes/ProjectWithXsdExtension.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,17 @@
22

33
class ProjectWithXsdExtension extends ProjectExtension
44
{
5+
/**
6+
* @deprecated since Symfony 7.4, to be removed in Symfony 8.0 together with XML support.
7+
*/
58
public function getXsdValidationBasePath(): string
69
{
710
return __DIR__.'/schema';
811
}
912

13+
/**
14+
* @deprecated since Symfony 7.4, to be removed in Symfony 8.0 together with XML support.
15+
*/
1016
public function getNamespace(): string
1117
{
1218
return 'http://www.example.com/schema/projectwithxsd';
232 Bytes
Binary file not shown.

Tests/Fixtures/includes/createphar.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,17 @@
1111
1212
class ProjectWithXsdExtensionInPhar extends ProjectExtension
1313
{
14+
/**
15+
* @deprecated since Symfony 7.4, to be removed in Symfony 8.0 together with XML support.
16+
*/
1417
public function getXsdValidationBasePath(): string
1518
{
1619
return __DIR__.'/schema';
1720
}
1821
22+
/**
23+
* @deprecated since Symfony 7.4, to be removed in Symfony 8.0 together with XML support.
24+
*/
1925
public function getNamespace(): string
2026
{
2127
return 'http://www.example.com/schema/projectwithxsdinphar';

0 commit comments

Comments
 (0)