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

TooWidePropertyTypeRule: dont skip always-read properties #3653

Open
wants to merge 1 commit into
base: 2.0.x
Choose a base branch
from

Conversation

janedbal
Copy link
Contributor

  • Since this rule reports assignment issues, it is irrelevant if it is always read or not
  • Found this by dropping similar rule of our own and Doctrine entities are no longer reported:
#[Entity]
class FooEntity 
{

    /**
     * @var array<string>|null
     */
    #[Column(type: Types::SIMPLE_ARRAY, nullable: true)]
    private ?array $zones; // null never assigned

    /**
     * @param list<string> $zones
     */
    public function __construct(
        array $zones,
    )
    {
        $this->zones = $zones;
    }

}

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

Successfully merging this pull request may close these issues.

1 participant