Skip to content

Improving extracting type from constructor #10969

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion components/property_info.rst
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,9 @@ Using PHP reflection, the :class:`Symfony\\Component\\PropertyInfo\\Extractor\\R
provides list, type and access information from setter and accessor methods.
It can also give the type of a property, and if it is initializable through the
constructor. It supports return and scalar types for PHP 7.
The component is also able to extract the types of the constructor's parameters.
If the class is a sub-class, then the constructor's properties of the parent
superclass are extracted.

.. note::

Expand Down Expand Up @@ -399,9 +402,15 @@ constructor. It supports return and scalar types for PHP 7.
$reflectionExtractor->isReadable($class, $property);
$reflectionExtractor->isWritable($class, $property);

// Initializable information
// Initializable information.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be reverted

$reflectionExtractor->isInitializable($class, $property);

// Constructor type information.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The dot can also be removed here

$reflectionExtractor->extractFromConstructor($class, $property);
$reflectionExtractor->getTypes($class, $property, [
'enable_constructor_extraction' => true
]);

PhpDocExtractor
~~~~~~~~~~~~~~~

Expand Down