Skip to content

Error after applied IssetOnPropertyObjectToPropertyExistsRector #9264

@omoikane

Description

@omoikane

Bug Report

Subject Details
Rector version 2.1.1

Minimal PHP Code Causing Issue

I created a demo here: https://getrector.com/demo/70deeb27-6dfc-477e-8067-476a928fe35f

After running Rector, the code becomes:

$fooDefined = property_exists($model, 'foo') && $model->foo !== null;

But the value of $fooDefined is false because property_exists() doesn't call the magic method __isset().

Expected Behaviour

Rector should skip this rule when the object implement __isset().

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