This rule is simple, the JMS annotations state exact type, that can be added to the property.
If on PHH 8.0+ (due to attributes, lets skip annotations to keep rule simple and more reliable), we can add known typed property:
[JMS\Type('string')]
-private $name;
+private ?string $name = null;