| 1 | <?php |
||
| 21 | final class DomainEventPublisher |
||
| 22 | { |
||
| 23 | private static $instance; |
||
| 24 | |||
| 25 | private $subscribers; |
||
| 26 | |||
| 27 | private function __construct() |
||
| 31 | |||
| 32 | public function __clone() |
||
| 36 | |||
| 37 | public static function instance() : self |
||
| 45 | |||
| 46 | public function subscriberOfClassName(string $className) : DomainEventSubscriber |
||
| 50 | |||
| 51 | public function subscribe(DomainEventSubscriber $domainEventSubscriber) : void |
||
| 55 | |||
| 56 | public function publish(DomainEvent $domainEvent) : void |
||
| 64 | } |
||
| 65 |
Late static binding only has effect in subclasses. A
finalclass cannot be extended anymore so late static binding cannot occurr. Consider replacingstatic::withself::.To learn more about late static binding, please refer to the PHP core documentation.