Commit 0d9801a
authored
chore(deps): update composer dev tooling dependencies (#494)
This PR contains the following updates:
| Package | Change |
[Age](https://docs.renovatebot.com/merge-confidence/) |
[Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|
| [php-cs-fixer/shim](https://redirect.github.com/PHP-CS-Fixer/shim) |
`^3.95.12` → `^3.95.17` |

|

|
|
[phpstan/phpstan](https://redirect.github.com/phpstan/phpstan-phar-composer-source)
| `^2.2.5` → `^2.2.6` |

|

|
|
[phpstan/phpstan-deprecation-rules](https://redirect.github.com/phpstan/phpstan-deprecation-rules)
| `^2.0.4` → `^2.0.5` |

|

|
|
[phpstan/phpstan-strict-rules](https://redirect.github.com/phpstan/phpstan-strict-rules)
| `^2.0.11` → `^2.0.12` |

|

|
| [phpunit/phpunit](https://phpunit.de/)
([source](https://redirect.github.com/sebastianbergmann/phpunit)) |
`^13.2.4` → `^13.2.5` |

|

|
| [rector/rector](https://getrector.com/)
([source](https://redirect.github.com/rectorphp/rector)) | `^2.5.5` →
`^2.5.8` |

|

|
---
### Release Notes
<details>
<summary>PHP-CS-Fixer/shim (php-cs-fixer/shim)</summary>
###
[`v3.95.17`](https://redirect.github.com/PHP-CS-Fixer/shim/compare/v3.95.16...v3.95.17)
[Compare
Source](https://redirect.github.com/PHP-CS-Fixer/shim/compare/v3.95.16...v3.95.17)
###
[`v3.95.16`](https://redirect.github.com/PHP-CS-Fixer/shim/compare/v3.95.15...v3.95.16)
[Compare
Source](https://redirect.github.com/PHP-CS-Fixer/shim/compare/v3.95.15...v3.95.16)
###
[`v3.95.15`](https://redirect.github.com/PHP-CS-Fixer/shim/compare/v3.95.14...v3.95.15)
[Compare
Source](https://redirect.github.com/PHP-CS-Fixer/shim/compare/v3.95.14...v3.95.15)
###
[`v3.95.14`](https://redirect.github.com/PHP-CS-Fixer/shim/compare/v3.95.13...v3.95.14)
[Compare
Source](https://redirect.github.com/PHP-CS-Fixer/shim/compare/v3.95.13...v3.95.14)
###
[`v3.95.13`](https://redirect.github.com/PHP-CS-Fixer/shim/compare/v3.95.12...v3.95.13)
[Compare
Source](https://redirect.github.com/PHP-CS-Fixer/shim/compare/v3.95.12...v3.95.13)
</details>
<details>
<summary>phpstan/phpstan-phar-composer-source
(phpstan/phpstan)</summary>
###
[`v2.2.6`](https://redirect.github.com/phpstan/phpstan-phar-composer-source/compare/2.2.5...2.2.6)
[Compare
Source](https://redirect.github.com/phpstan/phpstan-phar-composer-source/compare/2.2.5...2.2.6)
</details>
<details>
<summary>phpstan/phpstan-deprecation-rules
(phpstan/phpstan-deprecation-rules)</summary>
###
[`v2.0.5`](https://redirect.github.com/phpstan/phpstan-deprecation-rules/releases/tag/2.0.5)
[Compare
Source](https://redirect.github.com/phpstan/phpstan-deprecation-rules/compare/2.0.4...2.0.5)
-
[67bedd6](http://github.com/phpstan/phpstan-deprecation-rules/commit/67bedd65c24bc72840afc45aed48b1059dd44bec)
- Update github-actions
([#​197](https://redirect.github.com/phpstan/phpstan-deprecation-rules/issues/197))
-
[6be8bd3](http://github.com/phpstan/phpstan-deprecation-rules/commit/6be8bd30992a3b494a1b336fb8fd7720c6b62124)
- Update actions/cache action to v6
([#​198](https://redirect.github.com/phpstan/phpstan-deprecation-rules/issues/198))
-
[0b310ec](http://github.com/phpstan/phpstan-deprecation-rules/commit/0b310ec104c3b64432b052cae7ca9fcb6fccbbdf)
- Update github-actions to v3.0.1
([#​195](https://redirect.github.com/phpstan/phpstan-deprecation-rules/issues/195))
-
[782d848](http://github.com/phpstan/phpstan-deprecation-rules/commit/782d84883a94a6a34c99eb345bbf350d46ef3c53)
- Update github-actions to v7
([#​196](https://redirect.github.com/phpstan/phpstan-deprecation-rules/issues/196))
-
[85fff9d](http://github.com/phpstan/phpstan-deprecation-rules/commit/85fff9d86819f64977ab527a77b9dbf08512aaff)
- Update github-actions to
[`f3e473d`](https://redirect.github.com/phpstan/phpstan-deprecation-rules/commit/f3e473d)
([#​194](https://redirect.github.com/phpstan/phpstan-deprecation-rules/issues/194))
-
[54db580](http://github.com/phpstan/phpstan-deprecation-rules/commit/54db58033f3606c70ff7604282ca34be25594472)
- Update github-actions
([#​193](https://redirect.github.com/phpstan/phpstan-deprecation-rules/issues/193))
-
[99aff1a](http://github.com/phpstan/phpstan-deprecation-rules/commit/99aff1a0142839dced7671b14aa63449d9561bfe)
- Replace deprecated actions/create-release with
softprops/action-gh-release
-
[971f8e1](http://github.com/phpstan/phpstan-deprecation-rules/commit/971f8e10b06f29725c309d47b44675be18896a7d)
- Bump GitHub Actions across major versions
-
[89fef35](http://github.com/phpstan/phpstan-deprecation-rules/commit/89fef35dd0a35f8abab64d126c88b0257caabe71)
- Bump GitHub Actions within their current majors
-
[0652358](http://github.com/phpstan/phpstan-deprecation-rules/commit/06523588ee96e35e71bf70fc6bbb8cc268367efd)
- Update github-actions
-
[02119cc](http://github.com/phpstan/phpstan-deprecation-rules/commit/02119cc63068d32845ae52af575dc1730426968d)
- Update github-actions
-
[389c78c](http://github.com/phpstan/phpstan-deprecation-rules/commit/389c78c846b5f3d7440ca0043a585e17722fe7e5)
- latest infection does not support PHP 8.2
([#​189](https://redirect.github.com/phpstan/phpstan-deprecation-rules/issues/189))
-
[899202d](http://github.com/phpstan/phpstan-deprecation-rules/commit/899202d27ad83f94b53a66b073f34e726a50be5b)
- Update release-toot.yml
([#​188](https://redirect.github.com/phpstan/phpstan-deprecation-rules/issues/188))
-
[016d677](http://github.com/phpstan/phpstan-deprecation-rules/commit/016d6774a39797e4778289ab34394950ea5563a1)
- name-collision-detector
([#​187](https://redirect.github.com/phpstan/phpstan-deprecation-rules/issues/187))
-
[945df12](http://github.com/phpstan/phpstan-deprecation-rules/commit/945df122fa7700b0b71c4706d0429c893d4be745)
- Delete .github/workflows/claude-react-on-comment.yml
-
[a70b8b1](http://github.com/phpstan/phpstan-deprecation-rules/commit/a70b8b14ee07aaa1e12b3be65d2638e87281ac98)
- Remove default branch determination from workflow
-
[1faeb2e](http://github.com/phpstan/phpstan-deprecation-rules/commit/1faeb2e4bfb10867614401eade4e6715528c620a)
- Lint workflows
-
[534891e](http://github.com/phpstan/phpstan-deprecation-rules/commit/534891e29a578d43d53db0e4beb65c2cb22b6253)
- \[StepSecurity] ci: Harden GitHub Actions
-
[3acc664](http://github.com/phpstan/phpstan-deprecation-rules/commit/3acc66489633ef131e7010f7e2e3b0be803feeab)
- Remove PHPSTAN\_BOT\_TOKEN from checkout step
-
[49efeb2](http://github.com/phpstan/phpstan-deprecation-rules/commit/49efeb2561ee7cd4290e4da0ff641272f4d38449)
- React on issues opened and fall back to issue body
-
[319c3f6](http://github.com/phpstan/phpstan-deprecation-rules/commit/319c3f690d71a09b174044650e40bab57b41dd51)
- Add PHP 8.5 to CI matrix for lint, tests, and static analysis
-
[73feeba](http://github.com/phpstan/phpstan-deprecation-rules/commit/73feeba6587fc7a205087a6bbb2333317e066bd9)
- Add missing export-ignore entries to .gitattributes
-
[c6d73e5](http://github.com/phpstan/phpstan-deprecation-rules/commit/c6d73e54aa9e78d4d14c0d9d54192bfd9f6a2058)
- Add CLAUDE.md with project documentation
-
[f9f68eb](http://github.com/phpstan/phpstan-deprecation-rules/commit/f9f68ebdf86aafaed916a29cfebff5defe805109)
- Add Claude React on Comment workflow
</details>
<details>
<summary>phpstan/phpstan-strict-rules
(phpstan/phpstan-strict-rules)</summary>
###
[`v2.0.12`](https://redirect.github.com/phpstan/phpstan-strict-rules/releases/tag/2.0.12)
[Compare
Source](https://redirect.github.com/phpstan/phpstan-strict-rules/compare/2.0.11...2.0.12)
-
[2bc5ae1](http://github.com/phpstan/phpstan-strict-rules/commit/2bc5ae19ae965663b62ac907ee6342c3903ec93b)
- Allow GMP and BCMath\Number in arithmetic operations
([#​311](https://redirect.github.com/phpstan/phpstan-strict-rules/issues/311))
-
[70e3081](http://github.com/phpstan/phpstan-strict-rules/commit/70e3081149c71ac5a4f30c04d63777f59406ed71)
- Update github-actions
([#​324](https://redirect.github.com/phpstan/phpstan-strict-rules/issues/324))
-
[07a17dd](http://github.com/phpstan/phpstan-strict-rules/commit/07a17dd283ad2915fa257a2f59de7beffa9f4de7)
- Update github-actions to v7
([#​325](https://redirect.github.com/phpstan/phpstan-strict-rules/issues/325))
-
[de9bdda](http://github.com/phpstan/phpstan-strict-rules/commit/de9bdda24a7924833189e7a04107603a32cf1805)
- Update github-actions
([#​322](https://redirect.github.com/phpstan/phpstan-strict-rules/issues/322))
-
[80870ec](http://github.com/phpstan/phpstan-strict-rules/commit/80870ece60e57b2bc89d31bae545484f7689766f)
- Replace deprecated actions/create-release with
softprops/action-gh-release
-
[109c14f](http://github.com/phpstan/phpstan-strict-rules/commit/109c14f0d5237f9d2c5e70b85a7fa7d78cc0ec2f)
- Bump GitHub Actions across major versions
-
[ebf31ff](http://github.com/phpstan/phpstan-strict-rules/commit/ebf31ff68b8d8f6dc0735bbaaafa65bef1d2f711)
- Bump GitHub Actions within their current majors
-
[727c193](http://github.com/phpstan/phpstan-strict-rules/commit/727c193407f4e4fd061801f8cb11e2c5e6653881)
- Update github-actions
-
[cc56619](http://github.com/phpstan/phpstan-strict-rules/commit/cc5661912edd0abce5e3c749921dbc2f2a8659d3)
- Update github-actions
-
[1e72841](http://github.com/phpstan/phpstan-strict-rules/commit/1e72841e71acf2d12acf73f4161edb611d8a62e8)
- Update release-toot.yml
([#​319](https://redirect.github.com/phpstan/phpstan-strict-rules/issues/319))
-
[ada7e60](http://github.com/phpstan/phpstan-strict-rules/commit/ada7e60c4a1eb2fac3cbf9cafb506a5eab5d319b)
- CI: move name-collision job into build.yml
([#​318](https://redirect.github.com/phpstan/phpstan-strict-rules/issues/318))
-
[470946d](http://github.com/phpstan/phpstan-strict-rules/commit/470946d87bb06c0fe8a1ebae56b838b3c7529383)
- Add missing export-ignore entries to .gitattributes
([#​315](https://redirect.github.com/phpstan/phpstan-strict-rules/issues/315))
-
[8b14a8e](http://github.com/phpstan/phpstan-strict-rules/commit/8b14a8e31941d5edad80e0e2837cdc4ffc54171c)
- name-collision-detector
([#​314](https://redirect.github.com/phpstan/phpstan-strict-rules/issues/314))
</details>
<details>
<summary>sebastianbergmann/phpunit (phpunit/phpunit)</summary>
###
[`v13.2.5`](https://redirect.github.com/sebastianbergmann/phpunit/releases/tag/13.2.5):
PHPUnit 13.2.5
[Compare
Source](https://redirect.github.com/sebastianbergmann/phpunit/compare/13.2.4...13.2.5)
##### Changed
- Messages for tests that are skipped because of an unsatisfied
`RequiresPhp`, `RequiresPhpunit`, or `RequiresPhpExtension` version
requirement now include the version that is actually being used
- Warning messages about incomplete version requirements as well as
version requirements without a version comparison operator, and the
error message for invalid version requirements, now include the full
version requirement and explain what is expected
##### Fixed
-
[#​6825](https://redirect.github.com/sebastianbergmann/phpunit/pull/6825):
Forwarding to previous error handler can result in infinite recursion
-
[#​6831](https://redirect.github.com/sebastianbergmann/issues/pull/6831):
PHPUnit's error handler does not respect `@` error suppression and
forwards suppressed warnings to previous error handler
-
[#​6833](https://redirect.github.com/sebastianbergmann/phpunit/issues/6833):
`assertArrayHasKey()` does not accept `ArrayAccess` implementations with
a specific value type when test code is analysed with PHPStan at level 9
-
[#​6854](https://redirect.github.com/sebastianbergmann/phpunit/issues/6854):
Deprecation triggered in first-party code is wrongly classified as
indirect when the first-party code is called from third-party code
- Test classes were not sorted relative to each other when tests were
ordered by duration
***
Learn how to install or update PHPUnit 13.2 in the
[documentation](https://docs.phpunit.de/en/13.2/installation.html).
##### Keep up to date with PHPUnit:
- You can follow
[@​phpunit@phpc.social](https://phpc.social/@​phpunit) to
stay up to date with PHPUnit's development.
- You can subscribe to the [PHPUnit
Updates](https://phpunit.de/newsletter) newsletter to receive updates
about and tips for PHPUnit.
</details>
<details>
<summary>rectorphp/rector (rector/rector)</summary>
###
[`v2.5.8`](https://redirect.github.com/rectorphp/rector/releases/tag/2.5.8):
Released Rector 2.5.8
[Compare
Source](https://redirect.github.com/rectorphp/rector/compare/2.5.7...2.5.8)
#### New Features :partying\_face:
- \[dx] Add "if" set with if/else/ternary rules
([#​8199](https://redirect.github.com/rectorphp/rector-src/pull/8199))
- \[DeadCode] Add RemoveDeadInstanceOfAssertRector
([#​8202](https://redirect.github.com/rectorphp/rector-src/pull/8202))
- \[DeadCode] Add RemoveDoubleSelfAssignRector
([#​8203](https://redirect.github.com/rectorphp/rector-src/pull/8203))
- \[DeadCode] Add RemoveParentDelegatingClassMethodRector
([#​8204](https://redirect.github.com/rectorphp/rector-src/pull/8204))
- \[DeadCode] Add RemoveDefaultValueFromAssignedPropertyRector
([#​8207](https://redirect.github.com/rectorphp/rector-src/pull/8207))
- \[TypeDeclaration] Fix incomplete type on yield variable + yield from
in AddParamTypeBasedOnPHPUnitDataProviderRector
([#​8206](https://redirect.github.com/rectorphp/rector-src/pull/8206))
<br>
#### Bugfixes 🐛
- Fix LogicalToBooleanRector: parenthesize assignments nested under
unary/binary operators
([#​8184](https://redirect.github.com/rectorphp/rector-src/pull/8184))
- \[TypeDeclaration] Skip trait methods on ParamTypeByMethodCallType
rules
([#​8189](https://redirect.github.com/rectorphp/rector-src/pull/8189))
- \[Php80] Skip promotion when property type is wider than constructor
param on ClassPropertyAssignToConstructorPromotionRector
([#​8170](https://redirect.github.com/rectorphp/rector-src/pull/8170)),
Thanks [@​ximki-vinki](https://redirect.github.com/ximki-vinki)!
- \[Php85] Skip outer spread on NestedFuncCallsToPipeOperatorRector
([#​8191](https://redirect.github.com/rectorphp/rector-src/pull/8191))
- \[DeadCode] Fix crash on float version arg in ConditionResolver
([#​8192](https://redirect.github.com/rectorphp/rector-src/pull/8192))
- Make NestedFuncCallsToPipeOperatorRector minimum depth configurable
([#​8193](https://redirect.github.com/rectorphp/rector-src/pull/8193))
- Fix codeception data provider detection
([#​8194](https://redirect.github.com/rectorphp/rector-src/pull/8194)),
Thanks
[@​d-mitrofanov-v](https://redirect.github.com/d-mitrofanov-v)!
- Make PHPStan DI-Container available in bootstrap files
([#​8190](https://redirect.github.com/rectorphp/rector-src/pull/8190)),
Thanks [@​staabm](https://redirect.github.com/staabm)!
- \[Privatization] Skip Symfony Command protected static property in
PrivatizeFinalClassPropertyRector
([#​8201](https://redirect.github.com/rectorphp/rector-src/pull/8201))
- Bump to PHPStan ^2.2.6 and Fix its Container compatibility in
RichParser
([#​8208](https://redirect.github.com/rectorphp/rector-src/pull/8208))
<br>
#### Removed 💀
- skip @​ return this on
RemoveReturnTagIncompatibleWithNativeTypeRector on Traits
([#​8185](https://redirect.github.com/rectorphp/rector-src/pull/8185))
- \[DeadCode] Skip string scalar sub type on
RemoveReturnTagIncompatibleWithNativeTypeRector
([#​8186](https://redirect.github.com/rectorphp/rector-src/pull/8186))
<br>
#### rectorphp/rector-symfony 🎵
- \[Symfony73] Remove empty configure() method in
CommandHelpToAttributeRector
([#​969](https://redirect.github.com/rectorphp/rector-symfony/pull/969))
- \[Symfony73] Keep AbstractExtension when Twig extension overrides a
built-in function/filter
([#​968](https://redirect.github.com/rectorphp/rector-symfony/pull/968))
- \[Symfony73] Wrap scalar groups option in array in
ConstraintOptionsToNamedArgumentsRector
([#​967](https://redirect.github.com/rectorphp/rector-symfony/pull/967))
- \[Symfony61] Remove empty configure() method even with empty body
([#​966](https://redirect.github.com/rectorphp/rector-symfony/pull/966))
- \[Symfony61] Remove now empty configure() method in
CommandConfigureToAttributeRector
([#​965](https://redirect.github.com/rectorphp/rector-symfony/pull/965))
- \[CodeQuality] Respect typeGuardedClasses and skip closure-only
returns in ResponseReturnTypeControllerActionRector
([#​964](https://redirect.github.com/rectorphp/rector-symfony/pull/964))
- \[Symfony44] Return 1 instead of (int) false in
ConsoleExecuteReturnIntRector
([#​963](https://redirect.github.com/rectorphp/rector-symfony/pull/963))
- \[CodeQuality] Add union and method call return type support to
ResponseReturnTypeControllerActionRector
([#​961](https://redirect.github.com/rectorphp/rector-symfony/pull/961))
- \[Twig30] Add new set for Twig 30
([#​960](https://redirect.github.com/rectorphp/rector-symfony/pull/960)),
Thanks [@​MrYamous](https://redirect.github.com/MrYamous)
<br>
#### rectorphp/rector-doctrine 🟠
- \[DataFixtures 17] add new set for doctrine data-fixtures 17
([#​487](https://redirect.github.com/rectorphp/rector-doctrine/pull/487)),
Thanks [@​MrYamous](https://redirect.github.com/MrYamous)
<br>
#### rectorphp/rector-phpunit 🟢
- \[PHPUnit 13] Add PHPUnit 13 config set
([#​733](https://redirect.github.com/rectorphp/rector-phpunit/pull/733))
- \[CodeQuality] Skip super global variables on
AssertIssetToSpecificMethodRector
([#​732](https://redirect.github.com/rectorphp/rector-phpunit/pull/732))
- \[CodeQuality] Skip anonymous classes in AssertClassToThisAssertRector
([#​729](https://redirect.github.com/rectorphp/rector-phpunit/pull/729))
- \[CodeQuality] Move AssertClassToThisAssertRector hook from Class\_ to
ClassMethod
([#​728](https://redirect.github.com/rectorphp/rector-phpunit/pull/728))
- AssertEqualsToSameRector: skip arrays whose actual value key order is
not provably identical
([#​727](https://redirect.github.com/rectorphp/rector-phpunit/pull/727))
###
[`v2.5.7`](https://redirect.github.com/rectorphp/rector/releases/tag/2.5.7):
Released Rector 2.5.7
[Compare
Source](https://redirect.github.com/rectorphp/rector/compare/2.5.6...2.5.7)
This release sharpens the PHPUnit code-quality sets, adds a focused
**narrow asserts** set, deprecates two blurry Symfony web-test rules,
and fixes a handful of docblock false-positives in dead-code removal.
#### New Features 🎉
##### PHPUnit: `PHPUNIT_NARROW_ASSERTS` set
A new set focused on narrowing broad asserts to their specific, more
descriptive method — e.g. `assertTrue(isset($a['b']))` →
`assertArrayHasKey('b', $a)`. ([rector-phpunit #​716])
```php
use Rector\PHPUnit\Set\PHPUnitSetList;
return RectorConfig::configure()
->withSets([PHPUnitSetList::PHPUNIT_NARROW_ASSERTS]);
```
<br>
##### `withPreparedSets()` gains `phpunitNarrowAsserts` +
`phpunitMockToStub`
The 2 PHPUnit sets are now toggleable like any other prepared set.
([#​8178])
```php
return RectorConfig::configure()
->withPreparedSets(
phpunitNarrowAsserts: true,
phpunitMockToStub: true,
);
```
<br>
##### PHPUnit: flip `with($this->callback(...))` on void methods to
`willReturnCallback()`
`VoidMethodWithCallbackToWillReturnCallbackRector` (renamed + refocused)
drops the pointless `return` value and types the closure as `void`,
matching the mocked void method. ([rector-phpunit #​724])
```diff
$this->createMock(SomeClass::class)
->method('run')
- ->with($this->callback(function ($arg) {
- echo $arg;
-
- return true;
- }));
+ ->willReturnCallback(function ($arg): void {
+ echo $arg;
+ });
```
##### Console: `-v` as alias for `--version`
Since the `verbose` option was removed, `-v` now prints the version.
([#​8177])
```bash
vendor/bin/rector -v
# Rector 2.x.x
```
<br>
#### Improvements 🔧
- **\[StaticTypeMapper]** Map phpstan-special scalar types
(`literal-string`, `numeric-string`, …) to their real PHPStan types
instead of a bogus `ObjectType`, so precise docblocks survive dead-code
cleanup ([#​8176])
- **\[PHPUnit CodeQuality]** Verify assert method name exists on the
`Assert` class via reflection before transforming ([rector-phpunit
#​720])
- **\[PHPUnit CodeQuality]** Simplify single-statement void callback in
`CallbackSingleAssertToSimplerRector` ([rector-phpunit #​722])
- **\[PHPUnit CodeQuality]** Collapse all instanceof asserts for
multiple nullable instances in a single run ([rector-phpunit
#​721])
- **\[PHPUnit CodeQuality]** Use `atLeast()` instead of `exactly()` in
`DecorateWillReturnMapWithExpectsMockRector` ([rector-phpunit
#​719])
<br>
#### Bug Fixes 🐛
- **\[DeadCode]** Preserve generic `@return` tags in
`RemoveReturnTagIncompatibleWithNativeTypeRector` ([#​8183])
- **\[DeadCode]** Skip templated type in
`RemoveReturnTagIncompatibleWithNativeTypeRector` ([#​8180])
- **\[DeadCode]** Skip PHPStan type alias in
`RemoveReturnTagIncompatibleWithNativeTypeRector` ([#​8179])
- **\[CodeQuality]** Skip abstract class in
`CompleteDynamicPropertiesRector` ([#​8182])
- **\[Php71]** Skip magic `@method` in `RemoveExtraParametersRector`
([#​8181])
- **\[PHPUnit]** Skip `with()` multiple arguments in
`VoidMethodWithCallbackToWillReturnCallbackRector` ([rector-phpunit
#​725])
- **\[PHPUnit]** Skip `new` object instances in
`NarrowIdenticalWithConsecutiveRector` — each `new` is a fresh instance,
collapsing them changes intent ([rector-phpunit #​726])
- **\[PHPUnit]** Skip mock property removal when used in a trait
([rector-phpunit #​723])
- **\[PHPUnit]** Skip nested value compare in
`CallbackSingleAssertToSimplerRector` ([rector-phpunit #​718])
- **\[PHPUnit]** Skip union types in `AssertEqualsToSameRector` to
preserve loose comparison ([rector-phpunit #​717])
<br>
#### Deprecations 💀
##### Symfony: `WebTestCaseAssertIsSuccessfulRector` +
`WebTestCaseAssertResponseCodeRector`
Both rules hide the asserted behavior and force a different assert
method per status code, splitting one clear assertion into several
implicit ones. Asserting the HTTP status code directly is clearer and
uniform. ([rector-symfony #​958])
***
[#​8176]:
https://redirect.github.com/rectorphp/rector-src/pull/8176
[#​8177]:
https://redirect.github.com/rectorphp/rector-src/pull/8177
[#​8178]:
https://redirect.github.com/rectorphp/rector-src/pull/8178
[#​8179]:
https://redirect.github.com/rectorphp/rector-src/pull/8179
[#​8180]:
https://redirect.github.com/rectorphp/rector-src/pull/8180
[#​8181]:
https://redirect.github.com/rectorphp/rector-src/pull/8181
[#​8182]:
https://redirect.github.com/rectorphp/rector-src/pull/8182
[#​8183]:
https://redirect.github.com/rectorphp/rector-src/pull/8183
[rector-phpunit #​716]:
https://redirect.github.com/rectorphp/rector-phpunit/pull/716
[rector-phpunit #​717]:
https://redirect.github.com/rectorphp/rector-phpunit/pull/717
[rector-phpunit #​718]:
https://redirect.github.com/rectorphp/rector-phpunit/pull/718
[rector-phpunit #​719]:
https://redirect.github.com/rectorphp/rector-phpunit/pull/719
[rector-phpunit #​720]:
https://redirect.github.com/rectorphp/rector-phpunit/pull/720
[rector-phpunit #​721]:
https://redirect.github.com/rectorphp/rector-phpunit/pull/721
[rector-phpunit #​722]:
https://redirect.github.com/rectorphp/rector-phpunit/pull/722
[rector-phpunit #​723]:
https://redirect.github.com/rectorphp/rector-phpunit/pull/723
[rector-phpunit #​724]:
https://redirect.github.com/rectorphp/rector-phpunit/pull/724
[rector-phpunit #​725]:
https://redirect.github.com/rectorphp/rector-phpunit/pull/725
[rector-phpunit #​726]:
https://redirect.github.com/rectorphp/rector-phpunit/pull/726
[rector-symfony #​958]:
https://redirect.github.com/rectorphp/rector-symfony/pull/958
###
[`v2.5.6`](https://redirect.github.com/rectorphp/rector/releases/tag/2.5.6):
Released Rector 2.5.6
[Compare
Source](https://redirect.github.com/rectorphp/rector/compare/2.5.5...2.5.6)
#### New Features 🥳
- \[DeadCode] Add `RemoveReturnTagIncompatibleWithNativeTypeRector`
([#​8172](https://redirect.github.com/rectorphp/rector-src/pull/8172))
```diff
final class SomeClass
{
- /**
- * @​return SomeObject
- */
public function getName(): string
{
return $this->someObject->getName();
}
}
```
- \[TypeDeclarationDocblocks] Add `MergePhpstanDocTagIntoNativeRector`
to merge `@phpstan-*` doc tags into native tags
([#​8171](https://redirect.github.com/rectorphp/rector-src/pull/8171))
```diff
final class SomeClass
{
/**
- * @​var Collection
- *
- * @​phpstan-var Collection<int, string>
+ * @​var Collection<int, string>
*/
private $items;
}
```
#### Bugfixes 🐛
- \[Php81] Skip array dim fetch args in
`NullToStrictStringFuncCallArgRector`
([#​8164](https://redirect.github.com/rectorphp/rector-src/pull/8164))
- Fix scoper to clean up prefix under `getRuleDefinition()` method,
parts 1–5
([#​8165](https://redirect.github.com/rectorphp/rector-src/pull/8165),
[#​8166](https://redirect.github.com/rectorphp/rector-src/pull/8166),
[#​8167](https://redirect.github.com/rectorphp/rector-src/pull/8167),
[#​8168](https://redirect.github.com/rectorphp/rector-src/pull/8168),
[#​8169](https://redirect.github.com/rectorphp/rector-src/pull/8169))
- Bump `phpstan/phpdoc-parser` to `^2.3.3`
([#​8174](https://redirect.github.com/rectorphp/rector-src/pull/8174))
***
#### PHPUnit 🧪
New rules and changes from
[rector-phpunit](https://redirect.github.com/rectorphp/rector-phpunit).
##### New Rules
- \[CodeQuality] Add `AssertClassToThisAssertRector`
([#​707](https://redirect.github.com/rectorphp/rector-phpunit/pull/707))
```diff
use PHPUnit\Framework\Assert;
use PHPUnit\Framework\TestCase;
final class SomeClass extends TestCase
{
public function run()
{
- Assert::assertEquals('expected', $result);
+ $this->assertEquals('expected', $result);
}
}
```
- \[CodeQuality] Add `BareCreateMockAssignToDirectUseRector` — inline a
single-use `createMock()` assignment
([#​708](https://redirect.github.com/rectorphp/rector-phpunit/pull/708))
```diff
final class SomeTest extends TestCase
{
public function test()
{
- $someObject = $this->createMock(SomeClass::class);
- $this->process($someObject);
+ $this->process($this->createMock(SomeClass::class));
}
private function process(SomeClass $someObject): void
{
}
}
```
- \[CodeQuality] Add `WillReturnCallbackFallbackToThrowRector` — throw
on an unexpected extra consecutive call
([#​710](https://redirect.github.com/rectorphp/rector-phpunit/pull/710))
```diff
$this->someServiceMock->expects($matcher)
->method('run')
->willReturnCallback(function () use ($matcher) {
if ($matcher->numberOfInvocations() === 1) {
return 1;
}
+
+ throw new \PHPUnit\Framework\Exception(sprintf('Method should not be called for the %dth time', $matcher->numberOfInvocations()));
});
```
- \[CodeQuality] Add `RemoveReturnFromVoidMethodMockCallbackRector` —
type a void mock callback and drop its value return
([#​711](https://redirect.github.com/rectorphp/rector-phpunit/pull/711))
```diff
$this->createMock(SomeClass::class)
->method('run')
- ->willReturnCallback(function ($arg) {
+ ->willReturnCallback(function ($arg): void {
echo $arg;
-
- return true;
});
```
*(`SomeClass::run()` returns `void`.)*
- \[CodeQuality] Add `CallbackSingleAssertToSimplerRector` — collapse a
`with()` callback with a sole `assertSame()` to `equalTo()`
([#​714](https://redirect.github.com/rectorphp/rector-phpunit/pull/714))
```diff
$builder->expects($this->exactly(2))
->method('add')
- ->with($this->callback(function ($type): bool {
- $this->assertSame(TextType::class, $type);
-
- return true;
- }));
+ ->with($this->equalTo(TextType::class));
```
##### Improvements
- \[CodeQuality] Skip `TestCase` suffix classes in
`RemoveNeverUsedMockPropertyRector`
([#​709](https://redirect.github.com/rectorphp/rector-phpunit/pull/709))
- \[CodeQuality] Produce void callbacks with bare return in
`WithCallbackIdenticalToStandaloneAssertsRector`
([#​712](https://redirect.github.com/rectorphp/rector-phpunit/pull/712))
- \[CodeQuality] Handle `return throw` and `return null` in void mock
callbacks
([#​713](https://redirect.github.com/rectorphp/rector-phpunit/pull/713))
</details>
---
### Configuration
📅 **Schedule**: (UTC)
- Branch creation
- At any time (no schedule defined)
- Automerge
- At any time (no schedule defined)
🚦 **Automerge**: Enabled.
♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.
👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config
help](https://redirect.github.com/renovatebot/renovate/discussions) if
that's undesired.
---
- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box
---
This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/Lendable/composer-license-checker).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yNjUuMSIsInVwZGF0ZWRJblZlciI6IjQ0LjMuMiIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsicmVub3ZhdGUiXX0=-->
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>1 parent b7ef735 commit 0d9801a
2 files changed
Lines changed: 55 additions & 53 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | | - | |
23 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
24 | 24 | | |
25 | | - | |
26 | | - | |
27 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments