Skip to content

Commit

Permalink
Deprecate object to string conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
natanfelles committed Sep 29, 2023
1 parent 8cda6ff commit 50c66fa
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Route.php
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,10 @@ protected function makeResponseBodyPart(mixed $result) : string
return (string) $result;
}
if (\is_object($result) && \method_exists($result, '__toString')) {
\trigger_error(
'Object to string conversion is deprecated',
\E_USER_DEPRECATED
);
return (string) $result;
}
if (
Expand Down

0 comments on commit 50c66fa

Please sign in to comment.