#102263Return string version of Stringable objects in DataMapper::getPlainValue
Description
The DataMapper::getPlainValue expects a object to be a instance of TypeInterface in order to return a plain value.
The TypoInterface holds the `__toString` method – making it `a instance of Stringable`.
Objects/value objects coming from own extensions, not implementing the TypeInterface but being a `Stringable` (either by `implements \Stringable` or having the `__toString` method) throws the exception
`throw new UnexpectedTypeException(‘An object of class “’ . get_class($input) . ‘” could not be converted to a plain value.’, 1274799934);`
Suggestion here, being that the condition also allows a object being a stringable
From:
`if (TypeHandlingUtility::isCoreType($input)) {`
To:
`if (TypeHandlingUtility::isCoreType($input) || ($input instanceof \Stringable)) {`
Reviews 2
History 35
-
Gerrit Code Review pushed patch set 1 for main to change 81576 status
NewUnder Review 10/26/23, 09:55 -
Oliver Hader changed category 10/26/23, 10:40
-
Gerrit Code Review pushed patch set 1 for 12.4 to change 81579 10/26/23, 12:33
-
Soren Malling commented and changed status
Under ReviewResolved done0 %100 % 10/26/23, 13:10 -
Benni Mack changed status
ResolvedClosed 01/30/24, 08:30
Applied in changeset commit:d5043eb1214e40134f588eb16fe6174b0bee8984.