aboutsummaryrefslogtreecommitdiffstats
path: root/includes/resourceloader/ResourceLoader.php
diff options
context:
space:
mode:
authorThiemo Kreuz <thiemo.kreuz@wikimedia.de>2019-01-09 17:24:36 +0100
committerThiemo Kreuz <thiemo.kreuz@wikimedia.de>2019-01-15 17:28:49 +0100
commit734a969d5506a80ceabfa2bc61bda79f76d73d5f (patch)
treeeaa619f76fce39e07f8e755593bb0cd7c80520ad /includes/resourceloader/ResourceLoader.php
parenta4880e9bbfd90642cfa5b852bdabf4101760f092 (diff)
downloadmediawikicore-734a969d5506a80ceabfa2bc61bda79f76d73d5f.tar.gz
mediawikicore-734a969d5506a80ceabfa2bc61bda79f76d73d5f.zip
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
Diffstat (limited to 'includes/resourceloader/ResourceLoader.php')
-rw-r--r--includes/resourceloader/ResourceLoader.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/includes/resourceloader/ResourceLoader.php b/includes/resourceloader/ResourceLoader.php
index 9570e038a8f6..c513aed018f4 100644
--- a/includes/resourceloader/ResourceLoader.php
+++ b/includes/resourceloader/ResourceLoader.php
@@ -781,7 +781,7 @@ class ResourceLoader implements LoggerAwareInterface {
}
// Save response to file cache unless there are errors
- if ( isset( $fileCache ) && !$this->errors && !count( $missing ) ) {
+ if ( isset( $fileCache ) && !$this->errors && $missing === [] ) {
// Cache single modules and images...and other requests if there are enough hits
if ( ResourceFileCache::useFileCache( $context ) ) {
if ( $fileCache->isCacheWorthy() ) {
@@ -1036,7 +1036,7 @@ class ResourceLoader implements LoggerAwareInterface {
$out = '';
$states = [];
- if ( !count( $modules ) && !count( $missing ) ) {
+ if ( $modules === [] && $missing === [] ) {
return <<<MESSAGE
/* This file is the Web entry point for MediaWiki's ResourceLoader:
<https://www.mediawiki.org/wiki/ResourceLoader>. In this request,