mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Math
synced 2024-11-27 17:01:07 +00:00
Use the expression assignment operator to simplify code
Suggested by phan, available since php7.4 Change-Id: I77c189ed451d08125fd6a6a008c55472cf3d046c
This commit is contained in:
parent
9360ca94c4
commit
f9f9f5dcd6
|
@ -1204,7 +1204,7 @@ class MhchemStateMachines {
|
|||
},
|
||||
'output-0' => static function ( &$buffer ) {
|
||||
$ret = [];
|
||||
$buffer["text_"] = $buffer["text_"] ?? "";
|
||||
$buffer["text_"] ??= "";
|
||||
if ( strlen( $buffer["text_"] ) > 4 ) {
|
||||
$a = strlen( $buffer["text_"] ) % 3;
|
||||
if ( $a === 0 ) {
|
||||
|
@ -1226,7 +1226,7 @@ class MhchemStateMachines {
|
|||
},
|
||||
'output-o' => static function ( &$buffer ) {
|
||||
$ret = [];
|
||||
$buffer["text_"] = $buffer["text_"] ?? "";
|
||||
$buffer["text_"] ??= "";
|
||||
if ( strlen( $buffer["text_"] ) > 4 ) {
|
||||
$a = strlen( $buffer["text_"] ) - 3;
|
||||
for ( $i = 0; $i < $a; $i += 3 ) {
|
||||
|
|
Loading…
Reference in a new issue