Positional entry after a named entry in one dataset is not reported

Open
#218 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
php
Domain
testing

Research direction

Start by reading the PHPUnit plugin's handling of dataset keys and argument unpacking, then check how Psalm represents array shapes and whether that representation preserves key order. Reproduce the example with a named key followed by a positional key for test(int $a, string $b). Done means the plugin reports this runtime error reliably despite Psalm's array shape representation.

Written by the indexing model from the issue text.

Description

enhancement

A dataset like ['b' => 'x', 0 => 1] for test(int $a, string $b) throws "Cannot use positional argument after named argument during unpacking" at runtime. The plugin can't see this reliably because Psalm does not keep the key order of array shapes. Found in review of #177.

Dominant language
Gherkin
Stars
79
Forks
38
Avg merge
6h 52m
Merged PRs (30d)
28

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from psalm/psalm-plugin-phpunit

All issues in psalm/psalm-plugin-phpunit

Similar issues

More Testing & QA issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.