AnnotationToAttributeRector doesn't handle optional properties properly
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3499247. -->
Reported by: [joachim](https://www.drupal.org/user/107701)
>>>
<h2>Drupal version</h2>
<p>11.0.6</p>
<h2>Drupal Rector version</h2>
<p>0.20.3</p>
<h2>Problem / Motivation</h2>
<p>In my annotation class, I had this:</p>
<pre> /**<br> * The directions for the plugin's links.<br> *<br> * Array keys are machine names, array values are labels.<br> *<br> * @var array<br> */<br> public $directions = [];</pre><p>The rector rule produces this in the attribute class:</p>
<pre> public readonly array $directions,</pre><p>This should have the same default value as in the annotation, so it's an optional attribute property.</p>
issue