Skip to content

HydratorException should be Throwable#190

Merged
DavidBadura merged 1 commit intopatchlevel:1.24.xfrom
gsteel:hydrator-exception
May 2, 2026
Merged

HydratorException should be Throwable#190
DavidBadura merged 1 commit intopatchlevel:1.24.xfrom
gsteel:hydrator-exception

Conversation

@gsteel
Copy link
Copy Markdown
Contributor

@gsteel gsteel commented May 1, 2026

This is a technical BC break, but it's extremely unlikely that users will have implemented this interface on a non-throwable.

This fixes code for static analysers such as:

try {
   return $hydrator->extract($object);
} catch(HydratorException $e) {
   throw new MyException('Foo', 0, $e);
}

This is a technical BC break, but it's extremely unlikely that users will have implemented this interface on a non-throwable.

This fixes code for static analysers such as:

```php
try {
   return $hydrator->extract($object);
} catch(HydratorException $e) {
   throw new MyException('Foo', 0, $e);
}
```
Copy link
Copy Markdown
Member

@DavidBadura DavidBadura left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yes, I don't think this BC break should affect anyone, since the sole purpose of this interface was to allow it to be used for catching. What do you think, @DanielBadura

@DavidBadura DavidBadura added BC break enhancement New feature or request labels May 2, 2026
@DavidBadura DavidBadura added this to the 1.24.0 milestone May 2, 2026
@DavidBadura DavidBadura requested a review from DanielBadura May 2, 2026 08:42
@DanielBadura
Copy link
Copy Markdown
Member

I'd consider this as a bug fix, so I'm fine with it 👍

@DavidBadura DavidBadura added bug Something isn't working and removed enhancement New feature or request labels May 2, 2026
@DavidBadura DavidBadura merged commit b2e7f29 into patchlevel:1.24.x May 2, 2026
15 of 16 checks passed
@gsteel gsteel deleted the hydrator-exception branch May 2, 2026 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BC break bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants