Bartosz Dziewoński has uploaded a new change for review.
https://gerrit.wikimedia.org/r/156136
Change subject: No space within the ?: operator
......................................................................
No space within the ?: operator
This style is a lot more common in our code.
Change-Id: I7f2fb3716c24c4a95a4c6c4a732b0226c315f242
---
M includes/context/RequestContext.php
M includes/jobqueue/JobRunner.php
M maintenance/getConfiguration.php
M maintenance/sql.php
4 files changed, 5 insertions(+), 5 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/36/156136/1
diff --git a/includes/context/RequestContext.php
b/includes/context/RequestContext.php
index 5178189..091e8da 100644
--- a/includes/context/RequestContext.php
+++ b/includes/context/RequestContext.php
@@ -297,7 +297,7 @@
$e = new Exception;
wfDebugLog( 'recursion-guard', "Recursion detected:\n"
. $e->getTraceAsString() );
- $code = $this->getConfig()->get( 'LanguageCode' ) ? :
'en';
+ $code = $this->getConfig()->get( 'LanguageCode' ) ?:
'en';
$this->lang = Language::factory( $code );
} elseif ( $this->lang === null ) {
$this->recursion = true;
diff --git a/includes/jobqueue/JobRunner.php b/includes/jobqueue/JobRunner.php
index c5e7f2e..617a3a3 100644
--- a/includes/jobqueue/JobRunner.php
+++ b/includes/jobqueue/JobRunner.php
@@ -235,7 +235,7 @@
$content = stream_get_contents( $handle );
flock( $handle, LOCK_UN );
fclose( $handle );
- $backoffs = json_decode( $content, true ) ? : array();
+ $backoffs = json_decode( $content, true ) ?: array();
}
return $backoffs;
@@ -253,7 +253,7 @@
$handle = fopen( $file, 'wb+' );
flock( $handle, LOCK_EX );
$content = stream_get_contents( $handle );
- $cBackoffs = json_decode( $content, true ) ? : array();
+ $cBackoffs = json_decode( $content, true ) ?: array();
foreach ( $backoffs as $type => $timestamp ) {
$cBackoffs[$type] = isset( $cBackoffs[$type] ) ?
$cBackoffs[$type] : 0;
$cBackoffs[$type] = max( $cBackoffs[$type],
$backoffs[$type] );
diff --git a/maintenance/getConfiguration.php b/maintenance/getConfiguration.php
index 1db53f3..d5f6834 100644
--- a/maintenance/getConfiguration.php
+++ b/maintenance/getConfiguration.php
@@ -87,7 +87,7 @@
public function finalSetup() {
parent::finalSetup();
- $this->regex = $this->getOption( 'regex' ) ? :
$this->getOption( 'iregex' );
+ $this->regex = $this->getOption( 'regex' ) ?: $this->getOption(
'iregex' );
if ( $this->regex ) {
$this->regex = '/' . $this->regex . '/';
if ( $this->hasOption( 'iregex' ) ) {
diff --git a/maintenance/sql.php b/maintenance/sql.php
index 389b270..afa3ef7 100644
--- a/maintenance/sql.php
+++ b/maintenance/sql.php
@@ -39,7 +39,7 @@
}
public function execute() {
- $wiki = $this->getOption( 'wikidb' ) ? : false;
+ $wiki = $this->getOption( 'wikidb' ) ?: false;
// Get the appropriate load balancer (for this wiki)
if ( $this->hasOption( 'cluster' ) ) {
$lb = wfGetLBFactory()->getExternalLB(
$this->getOption( 'cluster' ), $wiki );
--
To view, visit https://gerrit.wikimedia.org/r/156136
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7f2fb3716c24c4a95a4c6c4a732b0226c315f242
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits