Skip to content

Commit e821297

Browse files
lacatoirejaviereguiluz
authored andcommitted
[Contracts] Document ContainerProviderInterface
1 parent 4197547 commit e821297

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

components/contracts.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,24 @@ that can be enabled when using :ref:`autoconfiguration <services-autoconfigure>`
3939
or manual :doc:`service tagging </service_container/tags>` (or any other means
4040
provided by your framework.)
4141

42+
``ContainerProviderInterface``
43+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
44+
45+
.. versionadded:: 8.1
46+
47+
The ``ContainerProviderInterface`` was introduced in Symfony 8.1.
48+
49+
The :class:`Symfony\\Contracts\\Service\\ContainerProviderInterface` provides a
50+
standard way for objects to expose their service container. It defines a single
51+
method::
52+
53+
use Psr\Container\ContainerInterface;
54+
55+
interface ContainerProviderInterface
56+
{
57+
public function getContainer(): ContainerInterface;
58+
}
59+
4260
Design Principles
4361
-----------------
4462

0 commit comments

Comments
 (0)