Merge "Use string as return type of MMLutil::addPreOperator"

This commit is contained in:
jenkins-bot 2023-09-21 11:52:43 +00:00 committed by Gerrit Code Review
commit 293d0914b1

View file

@ -95,14 +95,14 @@ class MMLutil {
* em or other dimensional unit gets multiplied by pre-operator.
* @param string $size input size i.e-123em
* @param string $operator "plus (+) or minus (-)
* @return string|void ++ => + , -- => +, -+ => -
* @return string ++ => + , -- => +, -+ => -
*/
public static function addPreOperator( string $size, string $operator ) {
public static function addPreOperator( string $size, string $operator ): string {
$emtr = trim( $size );
$ok = preg_match( "/^(\+|\-)$/", $operator );
$ok = preg_match( "/^([+\-])$/", $operator );
if ( !$ok ) {
return;
return '';
}
switch ( $emtr[0] ) {
case "-":