Passed
Pull Request — master (#4440)
by
unknown
12:48
created
src/PhpSpreadsheet/Worksheet/Worksheet.php 2 patches
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -3872,19 +3872,19 @@  discard block
 block discarded – undo
3872 3872
     }
3873 3873
 
3874 3874
 
3875
-     /**
3876
-      * Copy a row, including style, data and height
3877
-      *
3878
-      * @param int $from row that will be copied
3879
-      * @param int $to row that will receive the copy
3880
-      * @return void
3881
-      */
3882
-      public function copyRow($from, $to) {
3875
+        /**
3876
+         * Copy a row, including style, data and height
3877
+         *
3878
+         * @param int $from row that will be copied
3879
+         * @param int $to row that will receive the copy
3880
+         * @return void
3881
+         */
3882
+        public function copyRow($from, $to) {
3883 3883
         $this->getRowDimension($to)->setRowHeight($this->getRowDimension($from)->getRowHeight());
3884 3884
         $fromRowCellIterator = $this->getRowIterator($from,$from)->current()->getCellIterator();
3885 3885
         try {
3886
-          $fromRowCellIterator->setIterateOnlyExistingCells(true);
3887
-          foreach ($fromRowCellIterator as $fromCellIt) {
3886
+            $fromRowCellIterator->setIterateOnlyExistingCells(true);
3887
+            foreach ($fromRowCellIterator as $fromCellIt) {
3888 3888
             $fromCoordinates = $fromCellIt->getCoordinate();
3889 3889
             $toCellCoordinates = $fromCellIt->getColumn().$to;
3890 3890
             // Cache data as trying to save the cells as variables doesn't work
@@ -3896,9 +3896,9 @@  discard block
 block discarded – undo
3896 3896
             $toCell->setValue($value);
3897 3897
             $toCell->setDataType($dataType);
3898 3898
             $this->duplicateStyle($style,$toCellCoordinates);
3899
-          }
3899
+            }
3900 3900
         } catch (\Exception $e) {
3901
-          unset($e); // Do nothing, the row was empty
3901
+            unset($e); // Do nothing, the row was empty
3902 3902
         }
3903 3903
     }
3904 3904
 
Please login to merge, or discard this patch.
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -1116,7 +1116,7 @@  discard block
 block discarded – undo
1116 1116
      *
1117 1117
      * @return $this
1118 1118
      */
1119
-    public function setCellValue(CellAddress|string|array $coordinate, mixed $value, ?IValueBinder $binder = null): static
1119
+    public function setCellValue(CellAddress | string | array $coordinate, mixed $value, ?IValueBinder $binder = null): static
1120 1120
     {
1121 1121
         $cellAddress = Functions::trimSheetFromCellReference(Validations::validateCellAddress($coordinate));
1122 1122
         $this->getCell($cellAddress)->setValue($value, $binder);
@@ -1141,7 +1141,7 @@  discard block
 block discarded – undo
1141 1141
      *
1142 1142
      * @return $this
1143 1143
      */
1144
-    public function setCellValueExplicit(CellAddress|string|array $coordinate, mixed $value, string $dataType): static
1144
+    public function setCellValueExplicit(CellAddress | string | array $coordinate, mixed $value, string $dataType): static
1145 1145
     {
1146 1146
         $cellAddress = Functions::trimSheetFromCellReference(Validations::validateCellAddress($coordinate));
1147 1147
         $this->getCell($cellAddress)->setValueExplicit($value, $dataType);
@@ -1162,7 +1162,7 @@  discard block
 block discarded – undo
1162 1162
      *              the "active" cell, and any previous assignment becomes a disconnected reference because
1163 1163
      *              the active cell has changed.
1164 1164
      */
1165
-    public function getCell(CellAddress|string|array $coordinate): Cell
1165
+    public function getCell(CellAddress | string | array $coordinate): Cell
1166 1166
     {
1167 1167
         $cellAddress = Functions::trimSheetFromCellReference(Validations::validateCellAddress($coordinate));
1168 1168
 
@@ -1307,7 +1307,7 @@  discard block
 block discarded – undo
1307 1307
      * @param array{0: int, 1: int}|CellAddress|string $coordinate Coordinate of the cell as a string, eg: 'C5';
1308 1308
      *               or as an array of [$columnIndex, $row] (e.g. [3, 5]), or a CellAddress object.
1309 1309
      */
1310
-    public function cellExists(CellAddress|string|array $coordinate): bool
1310
+    public function cellExists(CellAddress | string | array $coordinate): bool
1311 1311
     {
1312 1312
         $cellAddress = Validations::validateCellAddress($coordinate);
1313 1313
         [$sheet, $finalCoordinate] = $this->getWorksheetAndCoordinate($cellAddress);
@@ -1397,7 +1397,7 @@  discard block
 block discarded – undo
1397 1397
      *              or passing in an array of [$fromColumnIndex, $fromRow, $toColumnIndex, $toRow] (e.g. [3, 5, 6, 8]),
1398 1398
      *              or a CellAddress or AddressRange object.
1399 1399
      */
1400
-    public function getStyle(AddressRange|CellAddress|int|string|array $cellCoordinate): Style
1400
+    public function getStyle(AddressRange | CellAddress | int | string | array $cellCoordinate): Style
1401 1401
     {
1402 1402
         if (is_string($cellCoordinate)) {
1403 1403
             $cellCoordinate = Validations::definedNameToCoordinate($cellCoordinate, $this);
@@ -1669,7 +1669,7 @@  discard block
 block discarded – undo
1669 1669
      *
1670 1670
      * @return $this
1671 1671
      */
1672
-    public function setBreak(CellAddress|string|array $coordinate, int $break, int $max = -1): static
1672
+    public function setBreak(CellAddress | string | array $coordinate, int $break, int $max = -1): static
1673 1673
     {
1674 1674
         $cellAddress = Functions::trimSheetFromCellReference(Validations::validateCellAddress($coordinate));
1675 1675
 
@@ -1766,7 +1766,7 @@  discard block
 block discarded – undo
1766 1766
      *
1767 1767
      * @return $this
1768 1768
      */
1769
-    public function mergeCells(AddressRange|string|array $range, string $behaviour = self::MERGE_CELL_CONTENT_EMPTY): static
1769
+    public function mergeCells(AddressRange | string | array $range, string $behaviour = self::MERGE_CELL_CONTENT_EMPTY): static
1770 1770
     {
1771 1771
         $range = Functions::trimSheetFromCellReference(Validations::validateCellRange($range));
1772 1772
 
@@ -1882,7 +1882,7 @@  discard block
 block discarded – undo
1882 1882
      *
1883 1883
      * @return $this
1884 1884
      */
1885
-    public function unmergeCells(AddressRange|string|array $range): static
1885
+    public function unmergeCells(AddressRange | string | array $range): static
1886 1886
     {
1887 1887
         $range = Functions::trimSheetFromCellReference(Validations::validateCellRange($range));
1888 1888
 
@@ -1935,7 +1935,7 @@  discard block
 block discarded – undo
1935 1935
      *
1936 1936
      * @return $this
1937 1937
      */
1938
-    public function protectCells(AddressRange|CellAddress|int|string|array $range, string $password = '', bool $alreadyHashed = false, string $name = '', string $securityDescriptor = ''): static
1938
+    public function protectCells(AddressRange | CellAddress | int | string | array $range, string $password = '', bool $alreadyHashed = false, string $name = '', string $securityDescriptor = ''): static
1939 1939
     {
1940 1940
         $range = Functions::trimSheetFromCellReference(Validations::validateCellOrCellRange($range));
1941 1941
 
@@ -1956,7 +1956,7 @@  discard block
 block discarded – undo
1956 1956
      *
1957 1957
      * @return $this
1958 1958
      */
1959
-    public function unprotectCells(AddressRange|CellAddress|int|string|array $range): static
1959
+    public function unprotectCells(AddressRange | CellAddress | int | string | array $range): static
1960 1960
     {
1961 1961
         $range = Functions::trimSheetFromCellReference(Validations::validateCellOrCellRange($range));
1962 1962
 
@@ -1997,7 +1997,7 @@  discard block
 block discarded – undo
1997 1997
      *
1998 1998
      * @return $this
1999 1999
      */
2000
-    public function setAutoFilter(AddressRange|string|array|AutoFilter $autoFilterOrRange): static
2000
+    public function setAutoFilter(AddressRange | string | array | AutoFilter $autoFilterOrRange): static
2001 2001
     {
2002 2002
         if (is_object($autoFilterOrRange) && ($autoFilterOrRange instanceof AutoFilter)) {
2003 2003
             $this->autoFilter = $autoFilterOrRange;
@@ -2142,7 +2142,7 @@  discard block
 block discarded – undo
2142 2142
      *
2143 2143
      * @return $this
2144 2144
      */
2145
-    public function freezePane(null|CellAddress|string|array $coordinate, null|CellAddress|string|array $topLeftCell = null, bool $frozenSplit = false): static
2145
+    public function freezePane(null | CellAddress | string | array $coordinate, null | CellAddress | string | array $topLeftCell = null, bool $frozenSplit = false): static
2146 2146
     {
2147 2147
         $this->panes = [
2148 2148
             'bottomRight' => null,
@@ -2652,7 +2652,7 @@  discard block
 block discarded – undo
2652 2652
      *
2653 2653
      * @return $this
2654 2654
      */
2655
-    public function removeComment(CellAddress|string|array $cellCoordinate): self
2655
+    public function removeComment(CellAddress | string | array $cellCoordinate): self
2656 2656
     {
2657 2657
         $cellAddress = Functions::trimSheetFromCellReference(Validations::validateCellAddress($cellCoordinate));
2658 2658
 
@@ -2677,7 +2677,7 @@  discard block
 block discarded – undo
2677 2677
      * @param array{0: int, 1: int}|CellAddress|string $cellCoordinate Coordinate of the cell as a string, eg: 'C5';
2678 2678
      *               or as an array of [$columnIndex, $row] (e.g. [3, 5]), or a CellAddress object.
2679 2679
      */
2680
-    public function getComment(CellAddress|string|array $cellCoordinate, bool $attachNew = true): Comment
2680
+    public function getComment(CellAddress | string | array $cellCoordinate, bool $attachNew = true): Comment
2681 2681
     {
2682 2682
         $cellAddress = Functions::trimSheetFromCellReference(Validations::validateCellAddress($cellCoordinate));
2683 2683
 
@@ -2742,7 +2742,7 @@  discard block
 block discarded – undo
2742 2742
      *
2743 2743
      * @return $this
2744 2744
      */
2745
-    public function setSelectedCells(AddressRange|CellAddress|int|string|array $coordinate): static
2745
+    public function setSelectedCells(AddressRange | CellAddress | int | string | array $coordinate): static
2746 2746
     {
2747 2747
         if (is_string($coordinate)) {
2748 2748
             $coordinate = Validations::definedNameToCoordinate($coordinate, $this);
@@ -3246,7 +3246,7 @@  discard block
 block discarded – undo
3246 3246
      *
3247 3247
      * @return ($range is non-empty-string ? ($returnRange is true ? array{0: string, 1: string} : string) : ($returnRange is true ? array{0: null, 1: null} : null))
3248 3248
      */
3249
-    public static function extractSheetTitle(?string $range, bool $returnRange = false, bool $unapostrophize = false): array|null|string
3249
+    public static function extractSheetTitle(?string $range, bool $returnRange = false, bool $unapostrophize = false): array | null | string
3250 3250
     {
3251 3251
         if (empty($range)) {
3252 3252
             return $returnRange ? [null, null] : null;
@@ -3881,12 +3881,12 @@  discard block
 block discarded – undo
3881 3881
       */
3882 3882
       public function copyRow($from, $to) {
3883 3883
         $this->getRowDimension($to)->setRowHeight($this->getRowDimension($from)->getRowHeight());
3884
-        $fromRowCellIterator = $this->getRowIterator($from,$from)->current()->getCellIterator();
3884
+        $fromRowCellIterator = $this->getRowIterator($from, $from)->current()->getCellIterator();
3885 3885
         try {
3886 3886
           $fromRowCellIterator->setIterateOnlyExistingCells(true);
3887 3887
           foreach ($fromRowCellIterator as $fromCellIt) {
3888 3888
             $fromCoordinates = $fromCellIt->getCoordinate();
3889
-            $toCellCoordinates = $fromCellIt->getColumn().$to;
3889
+            $toCellCoordinates = $fromCellIt->getColumn() . $to;
3890 3890
             // Cache data as trying to save the cells as variables doesn't work
3891 3891
             $style = $this->getCell($fromCoordinates)->getStyle();
3892 3892
             $value = $this->getCell($fromCoordinates)->getValue();
@@ -3895,7 +3895,7 @@  discard block
 block discarded – undo
3895 3895
             $toCell = $this->getCell($toCellCoordinates);
3896 3896
             $toCell->setValue($value);
3897 3897
             $toCell->setDataType($dataType);
3898
-            $this->duplicateStyle($style,$toCellCoordinates);
3898
+            $this->duplicateStyle($style, $toCellCoordinates);
3899 3899
           }
3900 3900
         } catch (\Exception $e) {
3901 3901
           unset($e); // Do nothing, the row was empty
Please login to merge, or discard this patch.