Respect / Validation

The most awesome validation engine ever created for PHP
https://respect-validation.readthedocs.io
MIT License
5.79k stars 776 forks source link

Respect no longer using exceptions for custom rules after upgrading to 2.0 #1319

Closed oschwald closed 4 years ago

oschwald commented 4 years ago

I am in the process of trying to upgrade maxmind/minfraud to Respect 2.0, but I am running into an issue where my exception classes for custom rules are not being used.

You can see my progress in this commit. As far as I can tell, everything is set up as suggested in the documentation, but perhaps I am overlooking something. These same classes worked in 1.x.

Thanks!

oschwald commented 4 years ago

I looked into this briefly today and it appears that the exceptions are now found using the default Factory instance. It searches the exception namespaces there using the short name of the class, ignoring the namespace of the class.

This isn't ideal for my use case as I don't want to overwrite the default Factory as it is shared global state that might get set by something else. I might end up overriding reportError, although that doesn't seem ideal either.

oschwald commented 4 years ago

It looks like a dupe of #1278. I'll close this in favor of that.