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

[php] Incorrect highlighting of unused variable #8252

Open
Daniel-Peder opened this issue Feb 16, 2025 · 1 comment
Open

[php] Incorrect highlighting of unused variable #8252

Daniel-Peder opened this issue Feb 16, 2025 · 1 comment
Assignees
Labels
kind:bug Bug report or fix PHP [ci] enable extra PHP tests (php/php.editor)
Milestone

Comments

@Daniel-Peder
Copy link

Daniel-Peder commented Feb 16, 2025

Apache NetBeans version

Apache NetBeans 24

What happened

does highlite variable as unused (line 120 on screenshot)
also in similar code does not (line 97 on screenshot)
see screenshot and enclosed code

    function opening_day_info(array $data)
    {
        return array_map(
                fn($info) => new OpeningInfo(
                        is_string($info['opens'] ?? null) ? new TimeHHMM($info['opens']) : null,
                        is_string($info['closes'] ?? null) ? new TimeHHMM($info['closes']) : null,
                        ...array_map(
                                fn($description_line) => new DescriptionLine(
                                        $description_line['inline_html_text'],
                                        $description_line['html_class'] ?? null
                                ),
                                $info['description_lines']
                        )
                ),
                $data
        );

    }

    function closing_day(array $data)
    {
        return new ClosingDayInfo($data['day_key'], ...closing_day_info($data['info']));

    }

    function closing_day_info(array $data)
    {
        return array_map(
                fn($info) => new ClosingInfo(
                        ...array_map(
                                fn($description_line) => new DescriptionLine(
                                        $description_line['inline_html_text'],
                                        $description_line['html_class'] ?? null
                                ),
                                $info['description_lines']
                        )
                ),
                $data
        );

    }

Image

Language / Project Type / NetBeans Component

No response

How to reproduce

copy paste the code

Did this work correctly in an earlier version?

No / Don't know

Operating System

Linux version 5.4.0-205-generic running on amd64; UTF-8; en_US (nb)

JDK

17.0.14; OpenJDK 64-Bit Server VM 17.0.14+7-Ubuntu-120.04

Apache NetBeans packaging

Apache NetBeans Snap Package

Anything else

Product Version: Apache NetBeans IDE 24
Java: 17.0.14; OpenJDK 64-Bit Server VM 17.0.14+7-Ubuntu-120.04
Runtime: OpenJDK Runtime Environment 17.0.14+7-Ubuntu-120.04
System: Linux version 5.4.0-205-generic running on amd64; UTF-8; en_US (nb)

Are you willing to submit a pull request?

No

@Daniel-Peder Daniel-Peder added kind:bug Bug report or fix needs:triage Requires attention from one of the committers labels Feb 16, 2025
@troizet troizet added the PHP [ci] enable extra PHP tests (php/php.editor) label Feb 16, 2025
@junichi11
Copy link
Member

Thanks for reporting it. Reproducible.

@junichi11 junichi11 removed the needs:triage Requires attention from one of the committers label Feb 17, 2025
@junichi11 junichi11 self-assigned this Feb 17, 2025
@junichi11 junichi11 added this to the NB26 milestone Feb 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug Bug report or fix PHP [ci] enable extra PHP tests (php/php.editor)
Projects
None yet
Development

No branches or pull requests

3 participants