All known callers provide a user, except:
- FileRepo::getUploadStash accepts an optional user, defaulting to null, and passes that on
- UploadFromStash::__construct accepts an optional user, defaulting to false, and passes that on
- The cleanupUploadStash maintenance script doesn't pass a user
- UploadStashTest tests don't pass a user
See codesearch: https://codesearch.wmflabs.org/search/?q=new%20UploadStash%5C(&i=nope&files=&repos=
For #1
All known callers of FileRepo::getUploadStash already provide a user: https://codesearch.wmflabs.org/search/?q=getUploadStash%5C(&i=nope&files=&repos=
For #2
All known callers for UploadFromStash::__construct already provide a userhttps://codesearch.wmflabs.org/search/?q=UploadFromStash&i=nope&files=&repos=
For #3 and 4: Test will hide deprecation, script to be updated
Accordingly, not passing a user to the constructors of UploadStash or UploadFromStash, or to FileRepo::getUploadStash, should be hard deprecated