Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DuplicateArrayKey - String keys are not supported in unpacked arrays #2852

Closed
bendavies opened this issue Feb 20, 2020 · 1 comment
Closed
Labels

Comments

@bendavies
Copy link
Contributor

https://psalm.dev/r/b55ef4e286

muglug: @bendavies mind creating an issue for that? I think it should only warn for array<string, string>

@psalm-github-bot
Copy link

I found these snippets:

https://psalm.dev/r/b55ef4e286
<?php

class Foo
{
    protected function one(): array
    {
        return [
            'one',
            'two',
            'three',
        ];
    }

    protected function two(): array
    {
        return [
            'four',
            'five',
            'six',
        ];
    }

    public function three(): array
    {
        return [...$this->one(), ...$this->two()];
    }
}
Psalm output (using commit 306ed07):

ERROR: DuplicateArrayKey - 25:20 - String keys are not supported in unpacked arrays

ERROR: DuplicateArrayKey - 25:37 - String keys are not supported in unpacked arrays

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants