Safe replacement of a lot of `!count()` with `=== []`
authorThiemo Kreuz <thiemo.kreuz@wikimedia.de>
Wed, 9 Jan 2019 16:24:36 +0000 (17:24 +0100)
committerThiemo Kreuz <thiemo.kreuz@wikimedia.de>
Tue, 15 Jan 2019 16:28:49 +0000 (17:28 +0100)
commit734a969d5506a80ceabfa2bc61bda79f76d73d5f
treeeaa619f76fce39e07f8e755593bb0cd7c80520ad
parenta4880e9bbfd90642cfa5b852bdabf4101760f092
Safe replacement of a lot of `!count()` with `=== []`

This was originally a global search and replace. I manually checked all
replacements and reverted them if (due to the lack of type hints) either
null (that would be 0 when counted) or a Countable object can end in the
variable or property in question.

Now this patch only touches places where I'm sure nothing can break.

For the sanity of the honorable reviewers this patch is exclusively touching
negated counts. You should not find a single `!== []` in this patch, that
would be a mistake.

Change-Id: I5eafd4d8fccdb53a668be8e6f25a566f9c3a0a95
40 files changed:
includes/Block.php
includes/HistoryBlob.php
includes/api/ApiQueryAllUsers.php
includes/api/ApiQueryBase.php
includes/api/ApiQueryContributors.php
includes/api/ApiQueryInfo.php
includes/api/ApiQueryPageProps.php
includes/api/ApiQueryUserContribs.php
includes/clientpool/SquidPurgeClientPool.php
includes/db/DatabaseOracle.php
includes/editpage/TextboxBuilder.php
includes/filerepo/LocalRepo.php
includes/filerepo/file/ArchivedFile.php
includes/jobqueue/JobQueue.php
includes/jobqueue/JobQueueDB.php
includes/jobqueue/JobQueueGroup.php
includes/jobqueue/JobQueueRedis.php
includes/libs/filebackend/FileBackend.php
includes/libs/filebackend/filejournal/FileJournal.php
includes/libs/lockmanager/FSLockManager.php
includes/libs/lockmanager/PostgreSqlLockManager.php
includes/libs/lockmanager/QuorumLockManager.php
includes/libs/rdbms/ChronologyProtector.php
includes/libs/rdbms/database/Database.php
includes/libs/rdbms/database/DatabaseMysqlBase.php
includes/libs/rdbms/loadbalancer/LoadBalancer.php
includes/mail/EmailNotification.php
includes/parser/Preprocessor_DOM.php
includes/resourceloader/ResourceLoader.php
includes/search/SearchOracle.php
includes/search/SearchSqlite.php
includes/skins/Skin.php
includes/specials/SpecialEditWatchlist.php
includes/specials/SpecialListgrants.php
includes/specials/SpecialPasswordPolicies.php
includes/specials/SpecialRecentchanges.php
includes/specials/SpecialSearch.php
includes/specials/SpecialSpecialpages.php
includes/specials/SpecialTrackingCategories.php
includes/user/User.php