daily pastebin goal
68%
SHARE
TWEET

Untitled

a guest Jan 20th, 2019 51 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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');
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top