Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect BC breaks due to parameter name changes, in line with PHP 8.0 named arguments requirements #266

Merged
merged 9 commits into from
Dec 6, 2021

Conversation

asgrim
Copy link
Member

@asgrim asgrim commented Aug 17, 2020

Fixes #264

@Ocramius
Copy link
Member

Note: also needs to configure the new rule in bin/*.php

@asgrim asgrim mentioned this pull request Jan 18, 2021
asgrim and others added 9 commits December 6, 2021 05:16
…arameter name changes being marked as BC breaks
…eflection:5.0.x` changes

This changes types and symbols that are dictated by interface and dependency changes.
…ameChanged` detector

Ref: https://github.com/Roave/BackwardCompatibilityCheck/pull/266/files#r497631718

This fixes following escaped mutation:

```
Escaped mutants:
================

1) /app/src/DetectChanges/BCBreak/FunctionBased/ParameterNameChanged.php:87    [M] UnwrapArrayIntersectKey

--- Original
+++ New
@@ @@
      */
     private function checkSymbols(array $from, array $to) : iterable
     {
-        foreach (array_intersect_key($from, $to) as $index => $commonParameter) {
+        foreach ($from as $index => $commonParameter) {
             yield from $this->compareParameter($commonParameter, $to[$index]);
         }
     }
```
@Ocramius Ocramius force-pushed the named-parameter-support branch from b91f240 to e4a1527 Compare December 6, 2021 04:48
@Ocramius Ocramius added this to the 6.0.0 milestone Dec 6, 2021
@Ocramius Ocramius added bc break and removed WIP labels Dec 6, 2021
@Ocramius Ocramius changed the title Named parameter support Detect BC breaks due to parameter name changes, in line with PHP 8.0 named arguments requirements Dec 6, 2021
Copy link
Member

@Ocramius Ocramius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@asgrim I've adapted your patch to latest 6.0.x state, and it's good to go 🚢

@Ocramius Ocramius merged commit 7d37292 into 6.0.x Dec 6, 2021
@Ocramius Ocramius deleted the named-parameter-support branch December 6, 2021 04:54
@asgrim
Copy link
Member Author

asgrim commented Dec 6, 2021

Thanks @Ocramius !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PHP8: Named parameters support & opt-out attribute
2 participants