| @@ 28-44 (lines=17) @@ | ||
| 25 | * |
|
| 26 | * @return bool|null |
|
| 27 | */ |
|
| 28 | public function notify($name, $object) |
|
| 29 | { |
|
| 30 | if ($object instanceof \PEIP\INF\Event\Event) { |
|
| 31 | if (is_object($object->getContent())) { |
|
| 32 | return self::doNotify( |
|
| 33 | $this->getListeners( |
|
| 34 | $name, |
|
| 35 | $object |
|
| 36 | ), |
|
| 37 | $object->getContent() |
|
| 38 | ); |
|
| 39 | } else { |
|
| 40 | throw new \InvalidArgumentException('instance of \PEIP\INF\Event\Event must contain subject'); |
|
| 41 | } |
|
| 42 | } else { |
|
| 43 | throw new \InvalidArgumentException('object must be instance of \PEIP\INF\Event\Event'); |
|
| 44 | } |
|
| 45 | } |
|
| 46 | ||
| 47 | //put your code here |
|
| @@ 63-81 (lines=19) @@ | ||
| 60 | * |
|
| 61 | * @return bool|null |
|
| 62 | */ |
|
| 63 | public function notify($name, $object) |
|
| 64 | { |
|
| 65 | if ($object instanceof \PEIP\INF\Event\Event) { |
|
| 66 | if (is_object($object->getContent())) { |
|
| 67 | return self::doNotify( |
|
| 68 | $this->getListeners( |
|
| 69 | $name, |
|
| 70 | \PEIP\Util\ReflectionPool::getInstance( |
|
| 71 | $object->getContent() |
|
| 72 | ) |
|
| 73 | ), |
|
| 74 | $object |
|
| 75 | ); |
|
| 76 | } else { |
|
| 77 | throw new \InvalidArgumentException('instance of \PEIP\INF\Event\Event must contain subject'); |
|
| 78 | } |
|
| 79 | } else { |
|
| 80 | throw new \InvalidArgumentException('object must be instance of \PEIP\INF\Event\Event'); |
|
| 81 | } |
|
| 82 | } |
|
| 83 | ||
| 84 | //put your code here |
|