Core Platform Team/Initiative/Stability annotations/newable

List of classes intended to be "newable".

Data objects
includes/title/TitleValue.php includes/Revision/RevisionSlots.php includes/Revision/MutableRevisionRecord.php includes/DerivativeRequest.php includes/MWTimestamp.php includes/mail/MailAddress.php includes/session/Token.php includes/session/SessionId.php includes/user/LoggedOutEditToken.php includes/user/UserIdentityValue.php includes/exception/ErrorPageError.php includes/exception/MWException.php includes/FauxRequest.php includes/libs/Message/MessageValue.php includes/libs/Message/DataMessageValue.php includes/libs/Message/ScalarParam.php includes/libs/Message/ListParam.php includes/libs/HtmlArmor.php includes/session/SessionInfo.php includes/RawMessage.php includes/api/ApiHelpParamValueMessage.php includes/api/ApiMessage.php includes/api/ApiRawMessage.php includes/language/Message.php includes/session/SessionInfo.php

TODO: includes/utils/BatchRowIterator.php includes/media/BitmapMetadataHandler.php includes/libs/objectcache/HashBagOStuff.php includes/libs/objectcache/CachedBagOStuff.php includes/cache/dependency/FileDependency.php includes/config/GlobalVarConfig.php includes/libs/StaticArrayWriter.php includes/libs/StatusValue.php includes/parser/StripState.php includes/StubObject.php ...TextContent hierarchy!

Also: (nearly) all Exceptions!

Tolerated, but need an alternative
includes/ApiMain.php includes/context/DerivativeContext.php includes/GitInfo.php includes/ListToggle.php includes/logging/LogPage.php - this is terrible! includes/logging/ManualLogEntry.php includes/poolcounter/PoolCounterWorkViaCallback.php - needs a factory includes/context/RequestContext.php includes/search/SearchHighlighter.php - should have a factory includes/TitleArrayFromResult.php - should perhaps be part of TitleFactory includes/user/User.php - should get a factory method for anons

TODO: the DiffFormatter hierarchy!

Classes instantiated by extensions that should not be
We will need to provide alternatives for directly instantiating these.

includes/CommentStoreComment.php: FileImporter should use a factory method or mocks when constructing CommentStoreComment in tests. includes/Revision/SlotRecord.php: Wikibase should use a factory method or mocks when constructing SlotRecords in tests. includes/Title.php: several extensions need a better way to represent no title. includes/cache/LinkBatch.php: several extensions should use LinkBatchFactory instead. includes/interwiki/Interwiki.php JsonConfig: FauxInterwikiLookup includes/page/Article.php: several extensions should use Article::newFromTitle instead. includes/page/WikiPage.php: several extensions should use WikiPage::factory instead. includes/diff/Diff.php: several extensions need an alternative, like a TextDiffGenerator service (note that the Diff class used by Wikibase is something else) includes/EditPage.php: several extensions need an alternative, like an EditPageFactory. maintenance/includes/FakeMaintenance.php: OpenIDConnect needs a better way to run a maintenance script. includes/filerepo/LocalRepo.php: some extensions should use RepoGroup instead. includes/MovePage.php: several extensions should use MovePageFactory instead. includes/parser/Parser.php: several extensions should use ParserFactory instead. includes/parser/ParserOptions.php: several extensions should use one of the static factory methods instead. includes/Status.php: several extensions should use the static factory methods in StatusValue instead.