Guest User

Untitled

a guest
Jan 20th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. <?php
  2.  
  3. // USER MODULE
  4. abstract class RunetimeException extends \RuntimeException
  5. {
  6. }
  7.  
  8. final class UserNotFound extends RuntimeException
  9. {
  10. public static function withEmail(string $email): self
  11. {
  12. $message = \sprintf('User cannot be found by email: %s', $email);
  13.  
  14. return new self($message);
  15. }
  16. }
  17.  
  18. throw UserNotFound::withEmail('patrykwozinski@github.example');
Add Comment
Please, Sign In to add comment