From f135da0b1112351ec42c548a5e08e059f82f35ad Mon Sep 17 00:00:00 2001 From: MarkBaker Date: Thu, 3 Jun 2021 19:23:58 +0200 Subject: [PATCH] phpstan appeasement --- src/PhpSpreadsheet/Cell/StringValueBinder.php | 12 +++++++++++ .../Cell/StringValueBinderTest.php | 21 +++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/src/PhpSpreadsheet/Cell/StringValueBinder.php b/src/PhpSpreadsheet/Cell/StringValueBinder.php index 1c4e579c..a005f1a7 100644 --- a/src/PhpSpreadsheet/Cell/StringValueBinder.php +++ b/src/PhpSpreadsheet/Cell/StringValueBinder.php @@ -8,12 +8,24 @@ use PhpOffice\PhpSpreadsheet\Shared\StringHelper; class StringValueBinder implements IValueBinder { + /** + * @var bool $convertNull + */ protected $convertNull = true; + /** + * @var bool $convertBoolean + */ protected $convertBoolean = true; + /** + * @var bool $convertNumeric + */ protected $convertNumeric = true; + /** + * @var bool $convertFormula + */ protected $convertFormula = true; public function setNullConversion(bool $suppressConversion = false): self diff --git a/tests/PhpSpreadsheetTests/Cell/StringValueBinderTest.php b/tests/PhpSpreadsheetTests/Cell/StringValueBinderTest.php index 0f9b2f39..2455a4e9 100644 --- a/tests/PhpSpreadsheetTests/Cell/StringValueBinderTest.php +++ b/tests/PhpSpreadsheetTests/Cell/StringValueBinderTest.php @@ -13,6 +13,9 @@ use PHPUnit\Framework\TestCase; class StringValueBinderTest extends TestCase { + /** + * @param mixed $expectedValue + */ protected function createCellStub($expectedValue, string $expectedDataType, bool $quotePrefix = false): Cell { /** @var Style&MockObject $styleStub */ @@ -39,6 +42,9 @@ class StringValueBinderTest extends TestCase /** * @dataProvider providerDataValuesDefault + * + * @param mixed $value + * @param mixed $expectedValue */ public function testStringValueBinderDefaultBehaviour( $value, @@ -82,6 +88,9 @@ class StringValueBinderTest extends TestCase /** * @dataProvider providerDataValuesSuppressNullConversion + * + * @param mixed $value + * @param mixed $expectedValue */ public function testStringValueBinderSuppressNullConversion( $value, @@ -105,6 +114,9 @@ class StringValueBinderTest extends TestCase /** * @dataProvider providerDataValuesSuppressBooleanConversion + * + * @param mixed $value + * @param mixed $expectedValue */ public function testStringValueBinderSuppressBooleanConversion( $value, @@ -129,6 +141,9 @@ class StringValueBinderTest extends TestCase /** * @dataProvider providerDataValuesSuppressNumericConversion + * + * @param mixed $value + * @param mixed $expectedValue */ public function testStringValueBinderSuppressNumericConversion( $value, @@ -159,6 +174,9 @@ class StringValueBinderTest extends TestCase /** * @dataProvider providerDataValuesSuppressFormulaConversion + * + * @param mixed $value + * @param mixed $expectedValue */ public function testStringValueBinderSuppressFormulaConversion( $value, @@ -182,6 +200,9 @@ class StringValueBinderTest extends TestCase /** * @dataProvider providerDataValuesSuppressAllConversion + * + * @param mixed $value + * @param mixed $expectedValue */ public function testStringValueBinderSuppressAllConversion( $value,