Repository: FriendsOfPHP/PHP-CS-Fixer (php)

Issue:
PhpdocToCommentFixer false positive with property promotion
## Bug report

![Screenshot from 2021-08-23 13-53-24](https://user-images.githubusercontent.com/539462/130443054-e97c2d03-8236-4fd9-a300-c3e55f42df39.png)

### Code snippet that reproduces the problem

```php
use Symfony\Component\Validator\Constraints as Assert;

class X
{
	public function __construct(
		/**
		 * @Assert\NotBlank()
		 */
		public string $x
	) {
	}
}

```


Pull request description:
CommentsAnalyzer - constructor property promotion support
Closes #5893 

Patch:
diff --git a/src/Tokenizer/Analyzer/CommentsAnalyzer.php b/src/Tokenizer/Analyzer/CommentsAnalyzer.php
index 309a93669..37e12d3a0 100644
--- a/src/Tokenizer/Analyzer/CommentsAnalyzer.php
+++ b/src/Tokenizer/Analyzer/CommentsAnalyzer.php
@@ -171,6 +171,9 @@ private function isStructuralElement(Tokens $tokens, int $index): bool
                 T_INCLUDE,
                 T_INCLUDE_ONCE,
                 T_FINAL,
+                CT::T_CONSTRUCTOR_PROPERTY_PROMOTION_PUBLIC,
+                CT::T_CONSTRUCTOR_PROPERTY_PROMOTION_PROTECTED,
+                CT::T_CONSTRUCTOR_PROPERTY_PROMOTION_PRIVATE,
             ];
 
             if (\defined('T_READONLY')) { // @TODO: drop condition when PHP 8.1+ is required


Test patch:
diff --git a/tests/Fixer/Phpdoc/PhpdocToCommentFixerTest.php b/tests/Fixer/Phpdoc/PhpdocToCommentFixerTest.php
index 1d7879c67..6c1291e5a 100644
--- a/tests/Fixer/Phpdoc/PhpdocToCommentFixerTest.php
+++ b/tests/Fixer/Phpdoc/PhpdocToCommentFixerTest.php
@@ -879,6 +879,18 @@ public function foo() {}
      */
 }',
             ],
+            [
+                '<?php
+class Foo
+{
+	public function __construct(
+	    /** @var string Do not convert this */
+		public string $bar
+	) {
+	}
+}
+',
+            ],
         ];
     }
 }