Advertisement
Guest User

Untitled

a guest
Oct 3rd, 2015
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1.  
  2.  
  3. class Conflubulator
  4. {
  5.  
  6. private $foo;
  7. private $bar;
  8. private $meh;
  9.  
  10. public function __construct($foo, $bar, $meh)
  11. {
  12. $this->setFoo();
  13. $this->setBar();
  14. $this->setMeh();
  15. }
  16.  
  17. private setFoo($foo)
  18. {
  19. //validate here - throw exception if invalid
  20.  
  21. $this->foo = $foo;
  22. }
  23.  
  24. private setBar($bar)
  25. {
  26. //validate here - throw exception if invalid
  27.  
  28. $this->bar = $bar;
  29. }
  30.  
  31. private setMeh($meh)
  32. {
  33. //validate here - throw exception if invalid
  34.  
  35. $this->meh = $meh;
  36. }
  37.  
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement