Make Status extend StatusValue and start FileBackend update
authorAaron Schulz <aschulz@wikimedia.org>
Fri, 16 Sep 2016 22:55:40 +0000 (15:55 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Sat, 17 Sep 2016 22:45:40 +0000 (15:45 -0700)
commitc64c3ef9a8f33d89df9a801efa6c1d498f8722b1
tree4b3b3bc40315ae6aa1be9791e72cb29c12356090
parentf0d760a0773eaaf840b8e5a1649b5c6a0f705f9d
Make Status extend StatusValue and start FileBackend update

* This avoids code duplication.
* Callers can safely start type-hinting StatusValue as well.
* Also moved the wrap() logic out of Status::__construct(), which
  only wrap() was (and should have been) using. Use "static" as
  well, so subclass behave properly.
* The docs and type-hints in /filebackend are updated as an example.
* A migration pattern is to inject a StatusValue wrapper
  into the backend and use it on all returned statuses, so MediaWiki
  will still get Status for message methods.

Change-Id: Iff9255f34870ea6b0c4b91f6ddc69eea95186aba
20 files changed:
includes/Status.php
includes/filebackend/FSFileBackend.php
includes/filebackend/FileBackend.php
includes/filebackend/FileBackendMultiWrite.php
includes/filebackend/FileBackendStore.php
includes/filebackend/FileOp.php
includes/filebackend/FileOpBatch.php
includes/filebackend/MemoryFileBackend.php
includes/filebackend/SwiftFileBackend.php
includes/filebackend/filejournal/DBFileJournal.php
includes/filebackend/filejournal/FileJournal.php
includes/filebackend/lockmanager/FSLockManager.php
includes/filebackend/lockmanager/LockManager.php
includes/filebackend/lockmanager/MemcLockManager.php
includes/filebackend/lockmanager/MySqlLockManager.php
includes/filebackend/lockmanager/PostgreSqlLockManager.php
includes/filebackend/lockmanager/QuorumLockManager.php
includes/filebackend/lockmanager/ScopedLock.php
includes/filerepo/FileBackendDBRepoWrapper.php
includes/libs/StatusValue.php