Skip to content

SF 8.0 with PHP8.4 : interface with properties? #62281

@Nayte91

Description

@Nayte91

Description

Hello all,

I suppose that were discussed in internal since ages, but as SF8 has PHP8.4 as minimum version, have you considered moving some interfaces from methods to properties?

Example

For example for a common User Entity that implements UserInterface & PasswordAuthenticatedUserInterface

  • replace getRoles() by public array $roles { get; }
  • replace getPassword() by public string $password { get; }

My 2 cents: I would not recommend this migration for every interfaced method in the world, but it makes sense for DTOs as you may want to push properties over methods in those objects.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions