•  
      request #10358 Plugins hooks should not rely on associative arrays
    Infos
    #10358
    Nicolas Terray (nterray)
    2017-07-03 10:20
    2017-06-22 16:50
    10603
    Details
    Plugins hooks should not rely on associative arrays
    Current usage of events in Tuleap presents some drawbacks:

    * Developers must carefully read the Event::XXX docblock to know what exist as parameters (when docblock exists and when docblock is still accurate),
    * Plugins can sometimes erase data in the array parameters (data given by the core, or data given by previous listeners),
    * Need to add variables' docblock to know that $params['group'] is of type Project,
    * Lack of navigability unless you add @see Event::XXX docblocks everywhere,
    * ...

    The proposal is to send to listeners a real object as event:

    * First class collection instead of associative array
    * Explicit method names instead of inaccurate docblock
    * Logic for managing "output" data is left to the event object, not the listener
    * Type hinting and meaningful @return instead of wild guess
    * Better navigability

    Empty
    Empty
    Empty
    • [ ] enhancement
    • [ ] internal improvement
    Empty
    Stage
    Empty
    Closed
    2017-07-03
    Attachments
    Empty
    References

    Follow-ups