public static function getMutation(array &$tokens, $index)
    {
        $tokenCount = count($tokens);
        for ($i=$index+1; $i < $tokenCount; $i++) {
            if (is_array($tokens[$i]) && $tokens[$i][0] == T_WHITESPACE) {
                continue;
            } elseif (is_array($tokens[$i]) && $tokens[$i][0] == T_DNUMBER) {
                // Dump the negation - string for negative ints
                if (self::getPreviousToken($tokens, $i) == '-') {
                    $tokens[$i-1] = [
                        T_WHITESPACE,
                        ''
                    ];
                    break;
                }
                // otherwise multiply by -1 to make negative for positive ints
                $num = (float) $tokens[$i][1];
                $replace = -1 * $num;
                $tokens[$i] = [
                    T_DNUMBER,
                    sprintf("%.2f", $replace)
                ];
                break;
            }
        }
    }
public static function getMutation(array &$tokens, $index)
    {
        $tokenCount = count($tokens);
        for ($i=$index+1; $i < $tokenCount; $i++) {
            if (is_array($tokens[$i]) && $tokens[$i][0] == T_WHITESPACE) {
                continue;
            } elseif (is_array($tokens[$i]) && $tokens[$i][0] == T_DNUMBER) {
                
                if (self::getPreviousToken($tokens, $i) == '-') {
                    $tokens[$i-1] = [
                        T_WHITESPACE,
                        ''
                    ];
                    break;
                }
                
                $num = (float) $tokens[$i][1];
                $replace = -1 * $num;
                $tokens[$i] = [
                    T_DNUMBER,
                    sprintf("%.2f", $replace)
                ];
                break;
            }
        }
    }
public static function getMutation ( array & $ tokens , $ index ) { $ tokenCount = count ( $ tokens ) ; for ( $ i = $ index + 1 ; $ i < $ tokenCount ; $ i ++ ) { if ( is_array ( $ tokens [ $ i ] ) && $ tokens [ $ i ] [ 0 ] == T_WHITESPACE ) { continue ; } elseif ( is_array ( $ tokens [ $ i ] ) && $ tokens [ $ i ] [ 0 ] == T_DNUMBER ) { // Dump the negation - string for negative ints if ( self :: getPreviousToken ( $ tokens , $ i ) == '-' ) { $ tokens [ $ i - 1 ] = [ T_WHITESPACE , '' ] ; break ; } // otherwise multiply by -1 to make negative for positive ints $ num = ( float ) $ tokens [ $ i ] [ 1 ] ; $ replace = - 1 * $ num ; $ tokens [ $ i ] = [ T_DNUMBER , sprintf ( "%.2f" , $ replace ) ] ; break ; } } }
Replace any float with its sign inverted (i.e. multiply by -1)

@param array $tokens
@param int $index
@return array
Replace any float with its sign inverted ( i . e . multiply by - 1 )