From 03b72037ad4d8794bdf232340a702bfc6e5962f7 Mon Sep 17 00:00:00 2001 From: Alexandre Daubois Date: Mon, 4 Dec 2023 08:56:36 +0100 Subject: [PATCH] [PropertyInfo] Introduce `PropertyDocBlockExtractorInterface` --- components/property_info.rst | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/components/property_info.rst b/components/property_info.rst index 452966f57d5..ca05d944429 100644 --- a/components/property_info.rst +++ b/components/property_info.rst @@ -183,6 +183,26 @@ for a property:: See :ref:`components-property-info-type` for info about the ``Type`` class. +Documentation Block +~~~~~~~~~~~~~~~~~~~ + +Extractors that implement :class:`Symfony\\Component\\PropertyInfo\\PropertyDocBlockExtractorInterface` +can provide the full documentation block for a property as a string:: + + $docBlock = $propertyInfo->getDocBlock($class, $property); + /* + Example Result + -------------- + string(79): + This is the subsequent paragraph in the DocComment. + It can span multiple lines. + */ + +.. versionadded:: 7.1 + + The :class:`Symfony\\Component\\PropertyInfo\\PropertyDocBlockExtractorInterface`` + interface was introduced in Symfony 7.1. + .. _property-info-description: Description Information @@ -413,6 +433,12 @@ library is present:: // Description information. $phpDocExtractor->getShortDescription($class, $property); $phpDocExtractor->getLongDescription($class, $property); + $phpDocExtractor->getDocBlock($class, $property); + +.. versionadded:: 7.1 + + The :method:`Symfony\\Component\\PropertyInfo\\Extractor\\PhpDocExtractor::getDocBlock`` + method was introduced in Symfony 7.1. PhpStanExtractor ~~~~~~~~~~~~~~~~