Why some places you use throw new Exception and other static method?
eerison opened this issue · 4 comments
Hello guys it is just for a question that came up in our team, and the guy used this repo as example.
Do you have the initial discussion for when you decided to use throw Exception::new();
instead of throw new Exception();
and I see that some places you are using throw new
and others with static method.
e.g:
Line 152 in cbd0e9a
dbal/src/Driver/PgSQL/Driver.php
Line 42 in cbd0e9a
Thank you in advance.
Static constructor methods help us standardize how we derive the exception message from given input, in your example an invalid class name.
But Couldn't you do like this too?
throw new InvalidWrapperClass($wrapperClass);
Sure.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.