Open
Description
Hello,
This is more a question than a bug report.
Are array shapes supposed to be casted? To be more accurate:
<?php
class Dto
{
public float $age;
}
$source = new Dto();
$target = $autoMapper->map(['age' => '10'], $source);
assert($target->age === 10.0); // ✅
class DtoArray
{
/**
* @var array<float>
*/
public array $age;
}
$source = new DtoArray();
$target = $autoMapper->map(['age' => ['10']], $source);
assert($target->age === [10.0]); // ❌
// $target->age === ['10']
Would it be possible to handle array docblock types?