Some methods in the CRUD pattern use &$byref function parameters. Do we need all of them?
Description
Details
Status | Subtype | Assigned | Task | ||
---|---|---|---|---|---|
Resolved | kalle | T266004 Investigate need for &$byref in CRUD and PersistentVisitor | |||
Resolved | kalle | T267116 Implement ApiCRUD, a non secure and generic data modification API. |
Event Timeline
From spending a bit of time testing:
We do need to pass arrays as byref, e.g. in CRUDs when serializing persistent instances to an array which is then sent to the database connection for creating and updating a row. If not, we'll be modifying a new clone of the array which is then thrown away.
We do not need to pass instances of Persistent as byref in order to modify the instance passed down by the caller. This would remove the bulk of all byrefs, e.g. all visitors.
This will be implemented when ApiCRUD is merged.
Change 643508 had a related patch set uploaded (by Karl Wettin (WMSE); owner: Karl Wettin (WMSE)):
[mediawiki/extensions/WikispeechSpeechDataCollector@master] Remove use of &$byref from CRUD
This patch is for CRUD only. PersistentVisitor-refactor will occur in a new patch attached to this task once ApiCRUD has been merged.
Change 643508 merged by jenkins-bot:
[mediawiki/extensions/WikispeechSpeechDataCollector@master] Remove use of &$byref from CRUD
Change 646972 had a related patch set uploaded (by Karl Wettin (WMSE); owner: Karl Wettin (WMSE)):
[mediawiki/extensions/WikispeechSpeechDataCollector@master] Remove &$byref from PersistentVisitor functions
Change 646972 merged by jenkins-bot:
[mediawiki/extensions/WikispeechSpeechDataCollector@master] Remove &$byref from PersistentVisitor functions