Skip to content

Rector hangs on a particular file #7649

Closed

Description

@rcmcdonald91

Bug Report

Subject Details
Rector version e.g. v0.15 (invoke vendor/bin/rector --version)

Minimal PHP Code Causing Issue

https://github.com/pfsense/pfsense/blob/master/src/etc/inc/priv.defs.inc

This file is one that is automatically generated, so it is skipped during normal Rector passes. However, this file is problematic for Rector. Rector just hangs processing this file and I haven't been able to work out why that is

Expected Behaviour

Rector should not hang

Activity

  1. samsonasik commented on Dec 9, 2022

    @samsonasik
    Member

    Looking at your rector config, it seems you are using custom rector rule

    https://github.com/pfsense/pfsense/blob/63a0efce7eb90ddea102e79a6750d4c19605f1cf/rector.php#L39

    The bug may be in logic in your rule, you can debug with rector-debugging https://github.com/rectorphp/rector-debugging or other tools with -vvv command.

    Also try using other existing rector rule, if the issue persist, that can be something todo:

  2. samsonasik commented on Dec 19, 2022

    @samsonasik
    Member

    @staabm created PR on phpstan side for improve performance on huge array:

    hopefully that will resolve it 👍

  3. staabm commented on Dec 19, 2022

    @staabm
    Contributor

    you are right that this might get faster with the linked PR. the file is using function calls (gettext), so it won't benefit from the linked PR as it is not constant.

    the file itself looks like it would not benefit from using phpstan/rector on it, therefore I think it should be put on the ignore path for both tools though

  4. samsonasik commented on Dec 19, 2022

    @samsonasik
    Member

    Ok 👍 , based on @staabm suggestion, ignore the file is the way to go, as the file itself is autogenerated.

    I am closing it then ;)

  5. github-actions commented on Nov 1, 2026

    @github-actions
    Contributor

    This issue has been automatically locked because it has been closed for 150 days. Please open a new issue if you have a similar problem.

  6. locked as resolved and limited conversation to collaborators on Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions