Closed axkirillov closed 1 year ago
Hi @axkirillov,
You're right, this could probably be improved.
php-vips lets you either use numbers for enum values (so 2 is VIPS_BLEND_MODE_OVER
, for example), or strings (they get looked up in the enum introspection and turned to numbers before being passed to libvips).
BlendMode
is supposed to help catch typos. I think php only added true enums in 8.1, so we can't use them yet.
Is the composite method annotated incorrectly?
The second param is annotated as BlendMode|array, but BlendMode is not a true enum, just an empty class with a bunch of constants. I assume the intention here is just to use the constants but then the type is string and static analysers (phpstan) will complain about that.