Advertisement
Guest User

Untitled

a guest
Dec 10th, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.30 KB | None | 0 0
  1. <?php
  2.  
  3. class Aggregate1
  4. {
  5.     public function isOption1() {
  6.         return true;
  7.     }
  8. }
  9.  
  10. class Aggregate2
  11. {
  12.     public function __construct($aggr1) {
  13.         if (!$aggrId1->isOption1()) {
  14.             throw new InvalidStateException();
  15.         }
  16.         $this->aggrId1 = $aggrId1;
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement