mongo-php-library
mongo-php-library copied to clipboard
Improve type of Collection Bulk Write operations
The Collection::bulkWrite($operations) method requires a complex array structure for the operations list. Describing this type using psalm custom type feature to helps static analysis.
PHPStorm is able to make the completion only with the full @param annotation, not @phpstan-param nor @psaml-param. And only when I start typing the first letter.
Both Psalm and PHPStan detect when the argument is invalid. The PHPStorm inspection does not detect issues when the array does not match the expected @param type.