@@ -1177,6 +1177,11 @@ public function setCellValueByColumnAndRow($columnIndex, $row, $value)
11771177 * or as an array of [$columnIndex, $row] (e.g. [3, 5]), or a CellAddress object.
11781178 * @param mixed $value Value of the cell
11791179 * @param string $dataType Explicit data type, see DataType::TYPE_*
1180+ * Note that PhpSpreadsheet does not validate that the value and datatype are consistent, in using this
1181+ * method, then it is your responsibility as an end-user developer to validate that the value and
1182+ * the datatype match.
1183+ * If you do mismatch value and datatpe, then the value you enter may be changed to match the datatype
1184+ * that you specify.
11801185 *
11811186 * @return $this
11821187 */
@@ -1199,6 +1204,11 @@ public function setCellValueExplicit($coordinate, $value, $dataType)
11991204 * @param int $row Numeric row coordinate of the cell
12001205 * @param mixed $value Value of the cell
12011206 * @param string $dataType Explicit data type, see DataType::TYPE_*
1207+ * Note that PhpSpreadsheet does not validate that the value and datatype are consistent, in using this
1208+ * method, then it is your responsibility as an end-user developer to validate that the value and
1209+ * the datatype match.
1210+ * If you do mismatch value and datatpe, then the value you enter may be changed to match the datatype
1211+ * that you specify.
12021212 *
12031213 * @return $this
12041214 */
@@ -1770,6 +1780,10 @@ public function mergeCells($range)
17701780 $ numberRows = $ lastRow - $ firstRow ;
17711781 $ numberColumns = $ lastColumnIndex - $ firstColumnIndex ;
17721782
1783+ if ($ numberRows === 1 && $ numberColumns === 1 ) {
1784+ return $ this ;
1785+ }
1786+
17731787 // create upper left cell if it does not already exist
17741788 $ upperLeft = "{$ firstColumn }{$ firstRow }" ;
17751789 if (!$ this ->cellExists ($ upperLeft )) {
0 commit comments