Skip to content

Commit

Permalink
feature #4583 Phpdoc to param type fixer rebase (jg-development)
Browse files Browse the repository at this point in the history
This PR was merged into the 2.16-dev branch.

Discussion
----------

Phpdoc to param type fixer rebase

Commits
-------

2f959ab PhpdocToParamTypeFixer - introduction
  • Loading branch information
SpacePossum committed Oct 11, 2019
2 parents f88a5e7 + 2f959ab commit c0d9d5a
Show file tree
Hide file tree
Showing 9 changed files with 804 additions and 3 deletions.
12 changes: 12 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1622,6 +1622,18 @@ Choose from the list of available rules:

Docblocks should only be used on structural elements.

* **phpdoc_to_param_type**

EXPERIMENTAL: Takes ``@param`` annotations of non-mixed types and adjusts
accordingly the function signature. Requires PHP >= 7.0.

*Risky rule: [1] This rule is EXPERIMENTAL and is not covered with backward compatibility promise. [2] ``@param`` annotation is mandatory for the fixer to make changes, signatures of methods without it (no docblock, inheritdocs) will not be fixed. [3] Manual actions are required if inherited signatures are not properly documented.*

Configuration options:

- ``scalar_types`` (``bool``): fix also scalar types; may have unexpected
behaviour due to PHP bad type coercion system; defaults to ``true``

* **phpdoc_to_return_type**

EXPERIMENTAL: Takes ``@return`` annotation of non-mixed types and adjusts
Expand Down
2 changes: 1 addition & 1 deletion src/DocBlock/Annotation.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class Annotation
(?<types>
(?<type>
(?<array>
(?&simple)\[\]
(?&simple)(\[\])*
)
|
(?<simple>
Expand Down

0 comments on commit c0d9d5a

Please sign in to comment.