Vendor/phpspreadsheet/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/JAMA/Matrix.php
public function plusEquals(...$args)
    {
        if (count($args) > 0) {
            $match = implode(',', array_map('gettype', $args));

            switch ($match) {
                case 'object':
                    if ($args[0] instanceof self) {
                        $M = $args[0];
                    } else {
                        throw new CalculationException(self::ARGUMENT_TYPE_EXCEPTION);
                    }

                    break;
                case 'array':
                    $M = new self($args[0]);

                    break;
                default:
                    throw new CalculationException(self::POLYMORPHIC_ARGUMENT_EXCEPTION);

                    break;
            }
            $this->checkMatrixDimensions($M);
            for ($i = 0; $i < $this->m; ++$i) {
                for ($j = 0; $j < $this->n; ++$j) {
                    $validValues = true;
                    $value = $M->get($i, $j);
                    if ((is_string($this->A[$i][$j])) && (strlen($this->A[$i][$j]) > 0) && (!is_numeric($this->A[$i][$j]))) {
                        $this->A[$i][$j] = trim($this->A[$i][$j], '"');
                        $validValues &= StringHelper::convertToNumberIfFraction($this->A[$i][$j]);
                    }
                    if ((is_string($value)) && (strlen($value) > 0) && (!is_numeric($value))) {
                        $value = trim($value, '"');
                        $validValues &= StringHelper::convertToNumberIfFraction($value);
                    }
                    if ($validValues) {
                        $this->A[$i][$j] += $value;
                    } else {
                        $this->A[$i][$j] = Functions::NAN();
                    }
                }
            }

            return $this;
        }

        throw new CalculationException(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
    }
public function plusEquals(...$args)
    {
        if (count($args) > 0) {
            $match = implode(',', array_map('gettype', $args));

            switch ($match) {
                case 'object':
                    if ($args[0] instanceof self) {
                        $M = $args[0];
                    } else {
                        throw new CalculationException(self::ARGUMENT_TYPE_EXCEPTION);
                    }

                    break;
                case 'array':
                    $M = new self($args[0]);

                    break;
                default:
                    throw new CalculationException(self::POLYMORPHIC_ARGUMENT_EXCEPTION);

                    break;
            }
            $this->checkMatrixDimensions($M);
            for ($i = 0; $i < $this->m; ++$i) {
                for ($j = 0; $j < $this->n; ++$j) {
                    $validValues = true;
                    $value = $M->get($i, $j);
                    if ((is_string($this->A[$i][$j])) && (strlen($this->A[$i][$j]) > 0) && (!is_numeric($this->A[$i][$j]))) {
                        $this->A[$i][$j] = trim($this->A[$i][$j], '"');
                        $validValues &= StringHelper::convertToNumberIfFraction($this->A[$i][$j]);
                    }
                    if ((is_string($value)) && (strlen($value) > 0) && (!is_numeric($value))) {
                        $value = trim($value, '"');
                        $validValues &= StringHelper::convertToNumberIfFraction($value);
                    }
                    if ($validValues) {
                        $this->A[$i][$j] += $value;
                    } else {
                        $this->A[$i][$j] = Functions::NAN();
                    }
                }
            }

            return $this;
        }

        throw new CalculationException(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
    }
public function plusEquals ( ... $ args ) { if ( count ( $ args ) > 0 ) { $ match = implode ( ',' , array_map ( 'gettype' , $ args ) ) ; switch ( $ match ) { case 'object' : if ( $ args [ 0 ] instanceof self ) { $ M = $ args [ 0 ] ; } else { throw new CalculationException ( self :: ARGUMENT_TYPE_EXCEPTION ) ; } break ; case 'array' : $ M = new self ( $ args [ 0 ] ) ; break ; default : throw new CalculationException ( self :: POLYMORPHIC_ARGUMENT_EXCEPTION ) ; break ; } $ this -> checkMatrixDimensions ( $ M ) ; for ( $ i = 0 ; $ i < $ this -> m ; ++ $ i ) { for ( $ j = 0 ; $ j < $ this -> n ; ++ $ j ) { $ validValues = true ; $ value = $ M -> get ( $ i , $ j ) ; if ( ( is_string ( $ this -> A [ $ i ] [ $ j ] ) ) && ( strlen ( $ this -> A [ $ i ] [ $ j ] ) > 0 ) && ( ! is_numeric ( $ this -> A [ $ i ] [ $ j ] ) ) ) { $ this -> A [ $ i ] [ $ j ] = trim ( $ this -> A [ $ i ] [ $ j ] , '"' ) ; $ validValues &= StringHelper :: convertToNumberIfFraction ( $ this -> A [ $ i ] [ $ j ] ) ; } if ( ( is_string ( $ value ) ) && ( strlen ( $ value ) > 0 ) && ( ! is_numeric ( $ value ) ) ) { $ value = trim ( $ value , '"' ) ; $ validValues &= StringHelper :: convertToNumberIfFraction ( $ value ) ; } if ( $ validValues ) { $ this -> A [ $ i ] [ $ j ] += $ value ; } else { $ this -> A [ $ i ] [ $ j ] = Functions :: NAN ( ) ; } } } return $ this ; } throw new CalculationException ( self :: POLYMORPHIC_ARGUMENT_EXCEPTION ) ; }
plusEquals.

A = A + B

@param mixed $B Matrix/Array

@return Matrix Sum
plusEquals .