Thanks to visit codestin.com
Credit goes to github.com

Skip to content

BC break in return type of ConstraintViolationInterface::getMessage() #34710

Closed
@Majkl578

Description

@Majkl578

Symfony version(s) affected: 4.4.0

Description
In Symfony 4.3.4 Symfony\Component\Validator\ConstraintViolationInterface::getMessage() returns string.
In Symfony 4.4.0 it returns string|object.

Widening return types is a BC break that breaks contract for consumers.

Caught by PHPStan:

Parameter #1 $message of class InvalidArgumentException constructor expects string, object|string given.

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