From f9f9f5dcd6a59fcca3ad89241ff1a788fb29217b Mon Sep 17 00:00:00 2001 From: Umherirrender Date: Sat, 14 Oct 2023 00:53:38 +0200 Subject: [PATCH] Use the expression assignment operator to simplify code Suggested by phan, available since php7.4 Change-Id: I77c189ed451d08125fd6a6a008c55472cf3d046c --- src/TexVC/Mhchem/MhchemStateMachines.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/TexVC/Mhchem/MhchemStateMachines.php b/src/TexVC/Mhchem/MhchemStateMachines.php index 767c7986c..db960eac0 100644 --- a/src/TexVC/Mhchem/MhchemStateMachines.php +++ b/src/TexVC/Mhchem/MhchemStateMachines.php @@ -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 ) {