colopl / laravel-spanner

Laravel database driver for Google Cloud Spanner
Apache License 2.0
97 stars 16 forks source link

incorrect phpdoc/types in insertUsingMutations() #217

Closed oprudkyi closed 5 months ago

oprudkyi commented 5 months ago

https://github.com/colopl/laravel-spanner/blob/master/src/Query/Concerns/UsesMutations.php#L32

    /**
     * @param array<string, mixed> $values
     * @return void
     */

should allow int in array indexes

     * @param array<string|int, mixed> $values

since it is used with multiple rows

            $records = [
                [
                    'name' => 'One',
                ],
                [
                    'name' => 'Two',
                ],
            ];

...
            $builder->insertUsingMutation($records);

https://cloud.google.com/spanner/docs/modify-mutation-api#insert-new-rows