Skip to content

TypedPropertyFromColumnTypeRector should remove initialize value when adding class as type #9896

Description

@raphaelincert

Bug Report

Subject Details
Rector version 2.6.6

Hi,
the rule TypedPropertyFromColumnTypeRector should remove the default init value when adding a class (example: DateTimeInterface) as type.
The fix currently gives the following error:
Fatal Error:[64] Default value for property of type DateTimeInterface may not be null. Use the nullable type ?DateTimeInterface to allow null default value

Best regards

Minimal PHP Code Causing Issue

https://getrector.com/demo/44901474-5df1-416c-8430-f572d31113e9

Expected Behaviour

Remove initializing property

Activity

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