-
Notifications
You must be signed in to change notification settings - Fork 59
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
#24 rename package to roave/backward-compatibility-check
#50
Conversation
…Roave\ApiCompare\DetectChanges\BCBreak`
… `__invoke` The verb is already on the class name This also has the nice side-effect that all `BCBreak` detectors are now composible functions 👍
…d with an empty `Changes`, avoid merging
…red approach
…, which is type-safe
…fter renames)
… empty set of changes is given
@@ -34,6 +34,10 @@ jobs: | |||
php: 7.2 | |||
script: vendor/bin/infection | |||
|
|||
- stage: Verify BC Breaks | |||
php: 7.2 | |||
script: bin/roave-backward-compatibility-check --from=master --to=HEAD |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: this will fail for now, as this patch does indeed lead to BC breaks (namespace changes)
@@ -1,66 +1,54 @@ | |||
# API Compare Tool | |||
# Roave Backward Compatibility Check |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, I aimed at a few things:
- cut to the point in the docs
- moved docs for the CLI command into the CLI command itself
- made the
roave
bit obnoxiously repetitive: I like throwing free time at OSS, but people can indeed typeroave
a few times.
$instance = self::new(); | ||
$instance->changes = $changes; | ||
return $instance; | ||
if ($empty) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found (via Kcachegrind
) that this was really trashing memory and CPU on this side (together with fromArray()
and mergeWith()
)
$new = clone $this; | ||
$new->changes[] = $change; | ||
return $new; | ||
if (! $other->changes) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looked useless at first, but saves us from loads of instantiations
|
||
interface MethodBased | ||
{ | ||
public function __invoke(ReflectionMethod $fromMethod, ReflectionMethod $toMethod) : Changes; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All checkers are now functional interfaces - didn't like the repeated name, nor the compare()
wording, and settled with using just the wording from the class name
@@ -34,6 +34,10 @@ jobs: | |||
php: 7.2 | |||
script: vendor/bin/infection | |||
|
|||
- stage: Verify BC Breaks | |||
php: 7.2 | |||
script: bin/roave-backward-compatibility-check --from=master --to=HEAD |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: this also therefore fixes #26
Build failures were due to BC breaks indeed, so merging. |
Fixes #24