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

Fix parsing magic method annotations #10665

Merged
merged 2 commits into from
Feb 6, 2024

Commits on Feb 6, 2024

  1. Regression and fail tests

    List fail tests:
    
    ```
    1) testMethodAnnotation with data set "static (string|int)[] getArray()"
    Undefined array key 0
    
    /workspaces/psalm/tests/ClassLikeDocblockParserTest.php:201
    
    2) testMethodAnnotation with data set "static (callable() : string) getCallable()"
    Undefined array key 0
    
    /workspaces/psalm/tests/ClassLikeDocblockParserTest.php:201
    ```
    issidorov committed Feb 6, 2024
    Configuration menu
    Copy the full SHA
    6b3380b View commit details
    Browse the repository at this point in the history
  2. Fix parsing magic method annotations

    Fix parsing for code:
    
    ```
    /**
     * @method static (string|int)[] getArray()
     * @method static (callable() : string) getCallable()
     */
    class MyClass {}
    ```
    
    Resolved tests:
    
    ```
    1) testMethodAnnotation with data set "static (string|int)[] getArray()"
    2) testMethodAnnotation with data set "static (callable() : string) getCallable()"
    ```
    issidorov committed Feb 6, 2024
    Configuration menu
    Copy the full SHA
    afaaa3d View commit details
    Browse the repository at this point in the history