123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- <?php
- namespace Hoa\Exception;
- use Hoa\Consistency;
- use Hoa\Event;
- class Exception extends Idle implements Event\Source
- {
-
- public function __construct(
- $message,
- $code = 0,
- $arguments = [],
- $previous = null
- ) {
- parent::__construct($message, $code, $arguments, $previous);
- if (false === Event::eventExists('hoa://Event/Exception')) {
- Event::register('hoa://Event/Exception', __CLASS__);
- }
- $this->send();
- return;
- }
-
- public function send()
- {
- Event::notify(
- 'hoa://Event/Exception',
- $this,
- new Event\Bucket($this)
- );
- return;
- }
- }
- Consistency::flexEntity('Hoa\Exception\Exception');
|