orisai / object-mapper

Raw data mapping to validated objects
Mozilla Public License 2.0
10 stars 1 forks source link

TypeToArrayConverter PHPStan error #72

Open FVesely opened 8 months ago

FVesely commented 8 months ago

Library version

v1.x-dev

Description

If I use TypeToArrayConverter instead of TypeToStringConverter I get a PHPStan error.

Steps to reproduce

$printer = new ErrorVisualPrinter(new TypeToArrayConverter());

Actual Behavior

 Parameter #1 $converter of class Orisai\ObjectMapper\Printers\ErrorVisualPrinter constructor expects Orisai\ObjectMapper\Printers\TypeToPrimitiveConverter<array>,  
         Orisai\ObjectMapper\Printers\TypeToArrayConverter given.                                                                                                            
         💡 Template type T on class Orisai\ObjectMapper\Printers\TypeToPrimitiveConverter is not covariant.

Expected Behavior

No error

Addition information

No response