ColdTrick / event_manager

Manage events in Elgg
https://elgg.org/plugins/736695
27 stars 37 forks source link

PHP Fatal error: Cannot use ::class with dynamic class name #174

Closed rohit1290 closed 2 years ago

rohit1290 commented 2 years ago

The following line is generating PHP Fatal error: Cannot use ::class with dynamic class name.

https://github.com/ColdTrick/event_manager/blob/8ffd3138a591e5a46221c866693dffc1b2e260ca/classes/ColdTrick/EventManager/Notifications/CreateEventEventHandler.php#L88

Elgg version: 4.1.3 Plugin Version: https://github.com/ColdTrick/event_manager/commit/8ffd3138a591e5a46221c866693dffc1b2e260ca PHP version: 7.4.16

Possible Fix: if (get_class($handler) !== self::class) {

jdalsem commented 2 years ago

thanks for reporting... it did work on PHP 8.1... maybe you were on a lower version? I changed it to use an instanceof check (which made more sense anyway)