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

feat: add support for psalm and phpstan array and list shapes #27

Open
afranioce opened this issue Aug 2, 2023 · 2 comments
Open

feat: add support for psalm and phpstan array and list shapes #27

afranioce opened this issue Aug 2, 2023 · 2 comments

Comments

@afranioce
Copy link

afranioce commented Aug 2, 2023

Add support for a special format for list arrays

<?php

class Foo {
    /**
     * @param array{criteria: string, handler: Bar} $handlers
     */
    public function singleLine(array $handlers)
    {
    }

    /**
     * @param array {
     *     criteria: string,
     *     handler: Bar
     *  } $handlers
     */
    public function multipleLines(array $handlers)
    {
    }
}
@afranioce afranioce changed the title feat: add support for psalm and phpstan array shapes feat: add support for psalm and phpstan array and list shapes Aug 2, 2023
@claytonrcarter
Copy link
Owner

I had always intended to add support for array shapes, but I ran out of steam at some point and never got to it. (And I guess I don't use them as much as I thought I would at that time. 😆) I would welcome a PR that adds support for array and list shapes, though!

@claytonrcarter
Copy link
Owner

Ah ha. I found an old branch where I had started on support for array shapes. It's now been dusted off and pushed to #39; please take a look and let me know what you think.

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

No branches or pull requests

2 participants