Skip to content

Commit cfbf86f

Browse files
committed
minor #19214 [PropertyInfo] Introduce PropertyDocBlockExtractorInterface (alexandre-daubois)
This PR was merged into the 7.1 branch. Discussion ---------- [PropertyInfo] Introduce `PropertyDocBlockExtractorInterface` Fix #19211 Commits ------- 03b7203 [PropertyInfo] Introduce `PropertyDocBlockExtractorInterface`
2 parents ef99a52 + 03b7203 commit cfbf86f

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

components/property_info.rst

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,26 @@ for a property::
183183

184184
See :ref:`components-property-info-type` for info about the ``Type`` class.
185185

186+
Documentation Block
187+
~~~~~~~~~~~~~~~~~~~
188+
189+
Extractors that implement :class:`Symfony\\Component\\PropertyInfo\\PropertyDocBlockExtractorInterface`
190+
can provide the full documentation block for a property as a string::
191+
192+
$docBlock = $propertyInfo->getDocBlock($class, $property);
193+
/*
194+
Example Result
195+
--------------
196+
string(79):
197+
This is the subsequent paragraph in the DocComment.
198+
It can span multiple lines.
199+
*/
200+
201+
.. versionadded:: 7.1
202+
203+
The :class:`Symfony\\Component\\PropertyInfo\\PropertyDocBlockExtractorInterface``
204+
interface was introduced in Symfony 7.1.
205+
186206
.. _property-info-description:
187207

188208
Description Information
@@ -413,6 +433,12 @@ library is present::
413433
// Description information.
414434
$phpDocExtractor->getShortDescription($class, $property);
415435
$phpDocExtractor->getLongDescription($class, $property);
436+
$phpDocExtractor->getDocBlock($class, $property);
437+
438+
.. versionadded:: 7.1
439+
440+
The :method:`Symfony\\Component\\PropertyInfo\\Extractor\\PhpDocExtractor::getDocBlock``
441+
method was introduced in Symfony 7.1.
416442

417443
PhpStanExtractor
418444
~~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)