Repository: PHPOffice/PhpSpreadsheet (php)

Issue:
[Bug] Is this a typo?
class: `\PhpOffice\PhpSpreadsheet\Style\Style`

file: `phpoffice\phpspreadsheet\src\PhpSpreadsheet\Style\Style.php`

function: `exportArray1`

Is this a typo in:
```php
<?php
...
    $this->exportArray2($exportedArray, 'quotePrefx', $this->getQuotePrefix());
```

Should it be `'quotePrefix'`?

Pull request description:
Fix Typo in Style exportArray quotePrefix
Fix #4422. Add tests.

This is:

- [x] a bugfix
- [ ] a new feature
- [ ] refactoring
- [ ] additional unit tests

Checklist:

- [ ] Changes are covered by unit tests
  - [ ] Changes are covered by existing unit tests
  - [x] New unit tests have been added
- [x] Code style is respected
- [x] Commit message explains **why** the change is made (see https://github.com/erlang/otp/wiki/Writing-good-commit-messages)
- [ ] CHANGELOG.md contains a short summary of the change and a link to the pull request if applicable
- [ ] Documentation is updated as necessary



Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b6da0bd9b..a7c0e63c0 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -38,6 +38,7 @@ and this project adheres to [Semantic Versioning](https://semver.org).
 - Ignore fractional part of Drawing Shadow Alpha. [Issue #4415](https://github.com/PHPOffice/PhpSpreadsheet/issues/4415) [PR #4417](https://github.com/PHPOffice/PhpSpreadsheet/pull/4417)
 - BIN2DEC, OCT2DEC, and HEX2DEC return numbers rather than strings. [Issue #4383](https://github.com/PHPOffice/PhpSpreadsheet/issues/4383) [PR #4389](https://github.com/PHPOffice/PhpSpreadsheet/pull/4389)
 - Fix TREND_BEST_FIT_NO_POLY. [Issue #4400](https://github.com/PHPOffice/PhpSpreadsheet/issues/4400) [PR #4339](https://github.com/PHPOffice/PhpSpreadsheet/pull/4339)
+- Fix typo in Style exportArray quotePrefix. [Issue #4422](https://github.com/PHPOffice/PhpSpreadsheet/issues/4422) [PR #4424](https://github.com/PHPOffice/PhpSpreadsheet/pull/4424)
 - Tweak Spreadsheet clone. [PR #4419](https://github.com/PHPOffice/PhpSpreadsheet/pull/4419)
 - Better handling of Chart DisplayBlanksAs. [Issue #4411](https://github.com/PHPOffice/PhpSpreadsheet/issues/4411) [PR #4414](https://github.com/PHPOffice/PhpSpreadsheet/pull/4414)
 
diff --git a/src/PhpSpreadsheet/Style/Style.php b/src/PhpSpreadsheet/Style/Style.php
index 17d632e9b..7d36489af 100644
--- a/src/PhpSpreadsheet/Style/Style.php
+++ b/src/PhpSpreadsheet/Style/Style.php
@@ -698,7 +698,7 @@ class Style extends Supervisor
         $this->exportArray2($exportedArray, 'font', $this->getFont());
         $this->exportArray2($exportedArray, 'numberFormat', $this->getNumberFormat());
         $this->exportArray2($exportedArray, 'protection', $this->getProtection());
-        $this->exportArray2($exportedArray, 'quotePrefx', $this->getQuotePrefix());
+        $this->exportArray2($exportedArray, 'quotePrefix', $this->getQuotePrefix());
 
         return $exportedArray;
     }


Test patch:
diff --git a/tests/PhpSpreadsheetTests/Style/ExportArrayTest.php b/tests/PhpSpreadsheetTests/Style/ExportArrayTest.php
index 5709d5c0a..7480a4d92 100644
--- a/tests/PhpSpreadsheetTests/Style/ExportArrayTest.php
+++ b/tests/PhpSpreadsheetTests/Style/ExportArrayTest.php
@@ -4,6 +4,7 @@ declare(strict_types=1);
 
 namespace PhpOffice\PhpSpreadsheetTests\Style;
 
+use PhpOffice\PhpSpreadsheet\Cell\DataType;
 use PhpOffice\PhpSpreadsheet\Spreadsheet;
 use PhpOffice\PhpSpreadsheet\Style\Alignment;
 use PhpOffice\PhpSpreadsheet\Style\Border;
@@ -287,4 +288,24 @@ class ExportArrayTest extends TestCase
         );
         $spreadsheet->disconnectWorksheets();
     }
+
+    public function testQuotePrefix(): void
+    {
+        $spreadsheet = new Spreadsheet();
+        $sheet = $spreadsheet->getActiveSheet();
+        $sheet->getCell('A1')
+            ->setValueExplicit('=1+2', DataType::TYPE_STRING);
+        self::assertSame('=1+2', $sheet->getCell('A1')->getCalculatedValue());
+        self::assertTrue($sheet->getStyle('A1')->getQuotePrefix());
+        $sheet->getCell('A2')->setValue('=1+2');
+        self::assertSame(3, $sheet->getCell('A2')->getCalculatedValue());
+        self::assertFalse($sheet->getStyle('A2')->getQuotePrefix());
+        $styleArray1 = $sheet->getStyle('A1')->exportArray();
+        $styleArray2 = $sheet->getStyle('A2')->exportArray();
+        $sheet->getStyle('B1')->applyFromArray($styleArray1);
+        $sheet->getStyle('B2')->applyFromArray($styleArray2);
+        self::assertTrue($sheet->getStyle('B1')->getQuotePrefix());
+        self::assertFalse($sheet->getStyle('B2')->getQuotePrefix());
+        $spreadsheet->disconnectWorksheets();
+    }
 }