Review main Merged

75160[BUGFIX] Enhance annotation integrity test script

Stefan Bürk CR +2 V +2 Easy +12 −3 updated 07/13/22, 06:59

Commit message

Docblock annotations with more then one space between a wildcard
character `*` and the annotation start character `@` was not found.
Additionally, annotation identifiers did not regonize hyphens as
valid identifier character, thus cutting of e.g. phpstan annoations.

This patch now properly finds annotions with multi-space separations
and annotation identifiers containing hyphens. Additionally, two
phpstan specific annotations are allowed.

> https://phpstan.org/writing-php-code/phpdoc-types#local-type-aliases

Summarized contained tasks:

> find multi-space separated annotations
  e.g. `*  @<AnnotationIdentifier>`
> properly extract full annotation identifier containing hyphens
  e.g. `* @annoation-identifier-with-hyphen`
> add `@phpstan-type` and `@phpstan-import-type` as allowed
  annotation, but only on class level, and not on class-property
  or class-method level

Review

  • Code review CR +2 Done
    • Stefan Bürk +2
    • Oli Bartsch +1
    • Christian Kuhn +1
  • Verified V +2 Done
    • Stefan Bürk +2
    • Oli Bartsch +1
    • Christian Kuhn +1
    • core-ci +1 CI

Issues 3

Files 1

Review log 1014

  1. Stefan Bürk uploaded patch set 1 07/12/22, 22:38

  2. crell voted on patch set 1 CR +1 07/12/22, 22:44

  3. core-ci voted on patch set 1 V +1 07/12/22, 22:45 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29016

  4. Stefan Bürk commented on patch set 1 07/12/22, 22:48

    Can be simply verified with following diff: ``` diff --git a/typo3/sysext/core/Classes/Configuration/FlexForm/FlexFormTools.php b/typo3/sysext/core/Classes/Configuration/FlexForm/FlexFormTools.php index 746084d3ef..f03974a0a8 100644 --- a/typo3/sysext/core/Classes/Configuration/FlexForm/FlexFormTools.php +++ b/typo3/sysext/core/Classes/Configuration/FlexForm/FlexFormTools.php @@ -34,6 +34,7 @@ use TYPO3\CMS\Core\Utility\MathUtility; /** * Contains functions for manipulating flex form data + * @phpstan-type */ class FlexFormTools { @@ -41,6 +42,7 @@ class FlexFormTools * If set, section indexes are re-numbered before processing * * @var bool + * @phpstan-type */ public $reNumberIndexesOfSectionData = false; @@ -115,6 +117,8 @@ class FlexFormTools * @throws InvalidParentRowRootException in getDataStructureIdentifierFromRecord * @throws InvalidPointerFieldValueException in getDataStructureIdentifierFromRecord * @throws InvalidTcaException in getDataStructureIdentifierFromRecord + * + * @phpstan-type */ public function getDataStructureIdentifier(array $fieldTca, string $tableName, string $fieldName, array $row): string { ``` allowing classlevel, failing for property and class method level
  5. Stefan Bürk updated the commit message in patch set 2 07/12/22, 22:52

  6. Stefan Bürk updated the commit message in patch set 3 07/12/22, 22:53

  7. core-ci voted on patch set 2 V +1 07/12/22, 23:00 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29017

  8. core-ci voted on patch set 3 V +1 07/12/22, 23:01 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29018

  9. Christian Kuhn updated the commit message in patch set 4 07/13/22, 06:15

  10. Christian Kuhn voted on patch set 4 V +1 CR +1 07/13/22, 06:15

  11. core-ci voted on patch set 4 V +1 07/13/22, 06:22 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29029

  12. Oli Bartsch voted on patch set 4 V +1 CR +1 07/13/22, 06:58

  13. Stefan Bürk voted on patch set 4 V +2 CR +2 07/13/22, 06:59

  14. Stefan Bürk merged patch set 5 07/13/22, 06:59