Closed eerison closed 4 weeks ago
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.
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 ofthrow new Exception();
and I see that some places you are using
throw new
and others with static method.e.g:
Thank you in advance.