Skip to content

RepeatedAndNotEqualToNotInArrayRector cannot be applied as default value of class properties #9930

Closed
rectorphp/rector-src
#8651

Description

@bpruneau

Bug Report

https://getrector.com/rule-detail/repeated-and-not-equal-to-not-in-array-rector

This rule can not be applied as default value of a property in a class.

defined("ENVIRONMENT") || define("ENVIRONMENT", getenv('ENVIRONMENT'));

class Foo
{
  public static bool $env = (ENVIRONMENT === 'local' || ENVIRONMENT === 'dev' || ENVIRONMENT === 'stage');

  ....
}

Activity

  1. TomasVotruba commented on Oct 14, 2026

    @TomasVotruba
    Member

    Good point 👍

    rectorphp/rector-src#8651

    Thanks

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