| 1 | <?php |
||
| 16 | class JoinPoint implements SplSubject |
||
| 17 | { |
||
| 18 | /** @var SplObjectStorage */ |
||
| 19 | protected $storage; |
||
| 20 | |||
| 21 | /** @var HttpGetRequest */ |
||
| 22 | protected $request; |
||
| 23 | |||
| 24 | /** @var HttpGetResponse */ |
||
| 25 | protected $response; |
||
| 26 | |||
| 27 | /** @var string */ |
||
| 28 | protected $name; |
||
| 29 | |||
| 30 | /** |
||
| 31 | * @param string $pointName |
||
| 32 | */ |
||
| 33 | 19 | public function __construct($pointName, HttpGetRequest $request) |
|
| 39 | |||
| 40 | 8 | public function attach(SplObserver $observer) |
|
| 44 | |||
| 45 | 1 | public function detach(SplObserver $observer) |
|
| 49 | |||
| 50 | 19 | public function detachAll() |
|
| 54 | |||
| 55 | 6 | public function notify() |
|
| 56 | { |
||
| 57 | 6 | foreach ($this->storage as $observer) { |
|
| 58 | 6 | $observer->update($this); |
|
| 59 | 6 | } |
|
| 60 | 6 | } |
|
| 61 | |||
| 62 | 14 | final public function refRequest() |
|
| 66 | |||
| 67 | 1 | public function setRequest(HttpGetRequest $req) |
|
| 71 | |||
| 72 | 7 | final public function refResponse() |
|
| 76 | |||
| 77 | 7 | public function setResponse(HttpGetResponse $res) |
|
| 81 | |||
| 82 | 16 | public function __toString() |
|
| 86 | } |
||
| 87 |