•  
      request #13314 Tuleap EventManager should be PSR-14 compliant
    Infos
    #13314
    Manuel Vacelet (vaceletm)
    2019-05-15 11:44
    2019-04-24 17:36
    14062
    Details
    Tuleap EventManager should be PSR-14 compliant

    PSR-14 is the php standard for everything event related.

    Fortunately it's pretty close to our current standard in term of event management so gap to fill is modest and it will provide a nice de-coupling of the event management stuff implemenation (EventManager) over the fact that most (if not all) the code that uses it actually only wants to 'dispatch' stuff.

    In addition to being more "PHP ecosystem friendly" being PSR-14 compliant brings:

    • The ability to stop event propagation (it would be dead code at this point however but would help to simplify the SESSION_BEFORE_LOGIN and SESSION_AFTER_LOGIN mechanism that has been built to deal with that).
    • The ability to simplify a bit events that are being re-used:
    $event = new Stuff();
    $event_manager->processEvent($event);
    $event->getStuff();

    can be simplifyied in

    $event = $event_manager->dispatch(new Stuff());
    $event->getStuff();
    Empty
    Empty
    Empty
    • [ ] enhancement
    • [x] internal improvement
    Empty
    Stage
    Manuel Vacelet (vaceletm)
    Closed
    2019-05-15
    Attachments
    Empty
    References

    Follow-ups