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

Broken T_FN token #2828

Closed
kukulich opened this issue Jan 17, 2020 · 1 comment
Closed

Broken T_FN token #2828

kukulich opened this issue Jan 17, 2020 · 1 comment

Comments

@kukulich
Copy link
Contributor

Code:

<?php
array_map(
    static fn (array $value): array => array_filter($value),
    []
);

The T_FN token is missing parenthesis_opener and parenthesis_closer.

@gsherwood
Copy link
Member

This has already been fixed in master as issue #2773

The token used to look like this:

    [7] => Array
        (
            [content] => fn
            [code] => PHPCS_T_FN
            [type] => T_FN
            [line] => 3
            [column] => 12
            [length] => 2
            [nested_parenthesis] => Array
                (
                    [2] => 30
                )

            [level] => 0
            [conditions] => Array
                (
                )

        )

But now looks like this:

    [7] => Array
        (
            [code] => 343
            [type] => T_FN
            [content] => fn
            [line] => 3
            [column] => 12
            [length] => 2
            [nested_parenthesis] => Array
                (
                    [2] => 30
                )

            [level] => 0
            [conditions] => Array
                (
                )

            [scope_condition] => 7
            [scope_opener] => 18
            [scope_closer] => 24
            [parenthesis_owner] => 7
            [parenthesis_opener] => 9
            [parenthesis_closer] => 13
        )

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