ItemId::newFromNumber and PropertyId::newFromNumber should no longer be used. Production code calling these methods should be changed to use an EntityIdComposer. Test code that uses these methods should be changed to directly call the constructor of ItemId resp PropertyId.
Description
Details
Related Objects
Event Timeline
Change 335973 had a related patch set uploaded (by Ladsgroup):
Use EntityIdComposer instead EntityId::newFromNumber in repo
Change 335973 merged by jenkins-bot:
Use EntityIdComposer instead EntityId::newFromNumber in repo
Change 337045 had a related patch set uploaded (by Ladsgroup):
Use EntityIdComposer instead EntityId::newFromNumber in client
Change 337806 had a related patch set uploaded (by Thiemo Mättig (WMDE)):
Fix violations caused by to generic, not needed EntityIdComposers
Change 337045 abandoned by Thiemo Mättig (WMDE):
Use EntityIdComposer instead EntityId::newFromNumber in client
Reason:
Using the composer only makes sense if either the entity type is variable, or the repo prefix is (or if there is a chance we will make one of it variable in the near future). Neither is the case here. We know the repo prefix is empty. We know the type is "item". Nothing wrong with using the static constructor then. The "wb_items_per_site" table that is used here (via SiteLinkTable) does not support repo prefixes, and as far as I know it does not need to.
Change 391187 had a related patch set uploaded (by Thiemo Mättig (WMDE); owner: Thiemo Mättig (WMDE)):
[mediawiki/extensions/ArticlePlaceholder@master] Refactor ItemNotabilityFilter to avoid ItemId::newFromNumber
I had a look at the remaining usages and they are all fine. All remaining calls of one of these newFromNumber methods are either done on a number as returned by Int32EntityId::getNumericId, which is well specified and encapsulated. Or they are because of T114904: Migrate wb_items_per_site to using prefixed entity IDs instead of numeric IDs, but that has it's own ticket already.
Change 391187 merged by jenkins-bot:
[mediawiki/extensions/ArticlePlaceholder@master] Refactor ItemNotabilityFilter to avoid ItemId::newFromNumber
Change 337806 abandoned by Thiemo Kreuz (WMDE):
Fix violations caused by to generic, not needed EntityIdComposers