From 3bf29c7e20908ccb511bf85a436c5212e5b56258 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Nov 2023 15:12:49 +0000 Subject: [PATCH] Bump phpstan/phpstan-phpunit from 1.3.14 to 1.3.15 Bumps [phpstan/phpstan-phpunit](https://github.com/phpstan/phpstan-phpunit) from 1.3.14 to 1.3.15. - [Release notes](https://github.com/phpstan/phpstan-phpunit/releases) - [Commits](https://github.com/phpstan/phpstan-phpunit/compare/1.3.14...1.3.15) --- updated-dependencies: - dependency-name: phpstan/phpstan-phpunit dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- composer.lock | 26 +++++++-------- docs/changes/1.x/1.2.0.md | 3 +- phpstan-baseline.neon | 5 --- .../Reader/Word2007/ElementTest.php | 33 ++++++++++++------- 4 files changed, 36 insertions(+), 31 deletions(-) diff --git a/composer.lock b/composer.lock index 56c51464eb..23452781b4 100644 --- a/composer.lock +++ b/composer.lock @@ -1567,16 +1567,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.10.32", + "version": "1.10.40", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "c47e47d3ab03137c0e121e77c4d2cb58672f6d44" + "reference": "93c84b5bf7669920d823631e39904d69b9c7dc5d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/c47e47d3ab03137c0e121e77c4d2cb58672f6d44", - "reference": "c47e47d3ab03137c0e121e77c4d2cb58672f6d44", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/93c84b5bf7669920d823631e39904d69b9c7dc5d", + "reference": "93c84b5bf7669920d823631e39904d69b9c7dc5d", "shasum": "" }, "require": { @@ -1625,20 +1625,20 @@ "type": "tidelift" } ], - "time": "2023-08-24T21:54:50+00:00" + "time": "2023-10-30T14:48:31+00:00" }, { "name": "phpstan/phpstan-phpunit", - "version": "1.3.14", + "version": "1.3.15", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-phpunit.git", - "reference": "614acc10c522e319639bf38b0698a4a566665f04" + "reference": "70ecacc64fe8090d8d2a33db5a51fe8e88acd93a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/614acc10c522e319639bf38b0698a4a566665f04", - "reference": "614acc10c522e319639bf38b0698a4a566665f04", + "url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/70ecacc64fe8090d8d2a33db5a51fe8e88acd93a", + "reference": "70ecacc64fe8090d8d2a33db5a51fe8e88acd93a", "shasum": "" }, "require": { @@ -1675,9 +1675,9 @@ "description": "PHPUnit extensions and rules for PHPStan", "support": { "issues": "https://github.com/phpstan/phpstan-phpunit/issues", - "source": "https://github.com/phpstan/phpstan-phpunit/tree/1.3.14" + "source": "https://github.com/phpstan/phpstan-phpunit/tree/1.3.15" }, - "time": "2023-08-25T09:46:39+00:00" + "time": "2023-10-09T18:58:39+00:00" }, { "name": "phpunit/php-code-coverage", @@ -5122,9 +5122,7 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": { - "phpstan/phpstan-phpunit": 0 - }, + "stability-flags": [], "prefer-stable": false, "prefer-lowest": false, "platform": { diff --git a/docs/changes/1.x/1.2.0.md b/docs/changes/1.x/1.2.0.md index 60ffd9eac2..16d16a47d0 100644 --- a/docs/changes/1.x/1.2.0.md +++ b/docs/changes/1.x/1.2.0.md @@ -40,4 +40,5 @@ - Bump mpdf/mpdf from 8.1.6 to 8.2.0 by [@dependabot](https://github.com/dependabot) in [#2480](https://github.com/PHPOffice/PHPWord/pull/2480) - Bump phpunit/phpunit from 9.6.11 to 9.6.13 by [@dependabot](https://github.com/dependabot) in [#2481](https://github.com/PHPOffice/PHPWord/pull/2481) - Bump tecnickcom/tcpdf from 6.6.2 to 6.6.5 by [@dependabot](https://github.com/dependabot) in [#2482](https://github.com/PHPOffice/PHPWord/pull/2482) -- Bump phpmd/phpmd from 2.13.0 to 2.14.1 by [@dependabot](https://github.com/dependabot) in [#2483](https://github.com/PHPOffice/PHPWord/pull/2483) \ No newline at end of file +- Bump phpmd/phpmd from 2.13.0 to 2.14.1 by [@dependabot](https://github.com/dependabot) in [#2483](https://github.com/PHPOffice/PHPWord/pull/2483) +- Bump phpstan/phpstan-phpunit from 1.3.14 to 1.3.15 by [@dependabot](https://github.com/dependabot) in [#2494](https://github.com/PHPOffice/PHPWord/pull/2494) \ No newline at end of file diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 2dd69c7278..088d4c5427 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -1690,11 +1690,6 @@ parameters: count: 1 path: tests/PhpWordTests/PhpWordTest.php - - - message: "#^Call to an undefined method PhpOffice\\\\PhpWord\\\\Element\\\\AbstractElement\\:\\:getElements\\(\\)\\.$#" - count: 1 - path: tests/PhpWordTests/Reader/Word2007/ElementTest.php - - message: "#^Call to an undefined method PhpOffice\\\\PhpWord\\\\Element\\\\AbstractElement\\:\\:getRows\\(\\)\\.$#" count: 1 diff --git a/tests/PhpWordTests/Reader/Word2007/ElementTest.php b/tests/PhpWordTests/Reader/Word2007/ElementTest.php index 9c002236ed..f96d8ac1a2 100644 --- a/tests/PhpWordTests/Reader/Word2007/ElementTest.php +++ b/tests/PhpWordTests/Reader/Word2007/ElementTest.php @@ -17,7 +17,9 @@ namespace PhpOffice\PhpWordTests\Reader\Word2007; +use PhpOffice\PhpWord\Element\Text; use PhpOffice\PhpWord\Element\TrackChange; +use PhpOffice\PhpWord\Style\Font; use PhpOffice\PhpWordTests\AbstractTestReader; /** @@ -60,7 +62,7 @@ public function testReadAlternateContent(): void $elements = $phpWord->getSection(0)->getElements(); self::assertInstanceOf('PhpOffice\PhpWord\Element\TextRun', $elements[0]); - self::assertInstanceOf('PhpOffice\PhpWord\Element\Text', $elements[0]->getElement(0)); + self::assertInstanceOf(Text::class, $elements[0]->getElement(0)); $text = $elements[0]; self::assertEquals('Test node value', trim($text->getElement(0)->getText())); } @@ -84,7 +86,7 @@ public function testReadTextBreak(): void /** @var \PhpOffice\PhpWord\Element\TextRun $textRun */ $textRun = $elements[0]; self::assertInstanceOf('PhpOffice\PhpWord\Element\TextBreak', $textRun->getElement(0)); - self::assertInstanceOf('PhpOffice\PhpWord\Element\Text', $textRun->getElement(1)); + self::assertInstanceOf(Text::class, $textRun->getElement(1)); self::assertEquals('test string', $textRun->getElement(1)->getText()); } @@ -107,7 +109,7 @@ public function testSmartTag(): void self::assertInstanceOf('PhpOffice\PhpWord\Element\TextRun', $elements[0]); /** @var \PhpOffice\PhpWord\Element\TextRun $textRun */ $textRun = $elements[0]; - self::assertInstanceOf('PhpOffice\PhpWord\Element\Text', $textRun->getElement(0)); + self::assertInstanceOf(Text::class, $textRun->getElement(0)); self::assertEquals('test string', $textRun->getElement(0)->getText()); } @@ -145,11 +147,20 @@ public function testReadListItemRunWithFormatting(): void self::assertEquals(0, $sections->getElement(0)->getDepth()); $listElements = $sections->getElement(0)->getElements(); - self::assertInstanceOf('PhpOffice\PhpWord\Element\Text', $listElements[0]); - self::assertEquals('Two', $listElements[0]->getText()); - self::assertEquals(' with ', $listElements[1]->getText()); - self::assertEquals('bold', $listElements[2]->getText()); - self::assertTrue($listElements[2]->getFontStyle()->isBold()); + /** @var Text $listElement0 */ + $listElement0 = $listElements[0]; + self::assertInstanceOf(Text::class, $listElement0); + self::assertEquals('Two', $listElement0->getText()); + /** @var Text $listElement1 */ + $listElement1 = $listElements[1]; + self::assertEquals(' with ', $listElement1->getText()); + /** @var Text $listElement2 */ + $listElement2 = $listElements[2]; + self::assertEquals('bold', $listElement2->getText()); + /** @var Font $listElement2FontStyle */ + $listElement2FontStyle = $listElement2->getFontStyle(); + self::assertInstanceOf(Font::class, $listElement2FontStyle); + self::assertTrue($listElement2FontStyle->isBold()); } /** @@ -214,11 +225,11 @@ public function testReadTab(): void self::assertInstanceOf('PhpOffice\PhpWord\Element\TextRun', $elements[0]); /** @var \PhpOffice\PhpWord\Element\TextRun $textRun */ $textRun = $elements[0]; - self::assertInstanceOf('PhpOffice\PhpWord\Element\Text', $textRun->getElement(0)); + self::assertInstanceOf(Text::class, $textRun->getElement(0)); self::assertEquals('One', $textRun->getElement(0)->getText()); - self::assertInstanceOf('PhpOffice\PhpWord\Element\Text', $textRun->getElement(1)); + self::assertInstanceOf(Text::class, $textRun->getElement(1)); self::assertEquals("\t", $textRun->getElement(1)->getText()); - self::assertInstanceOf('PhpOffice\PhpWord\Element\Text', $textRun->getElement(2)); + self::assertInstanceOf(Text::class, $textRun->getElement(2)); self::assertEquals('Two', $textRun->getElement(2)->getText()); }