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

#24 rename package to roave/backward-compatibility-check #50

Merged
merged 21 commits into from
Apr 27, 2018

Conversation

Ocramius
Copy link
Member

Fixes #24

Ocramius added 20 commits April 27, 2018 10:43
…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
@Ocramius Ocramius added this to the 0.0.1 milestone Apr 27, 2018
@@ -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
Copy link
Member Author

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
Copy link
Member Author

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:

  1. cut to the point in the docs
  2. moved docs for the CLI command into the CLI command itself
  3. made the roave bit obnoxiously repetitive: I like throwing free time at OSS, but people can indeed type roave a few times.

$instance = self::new();
$instance->changes = $changes;
return $instance;
if ($empty) {
Copy link
Member Author

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) {
Copy link
Member Author

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;
Copy link
Member Author

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
Copy link
Member

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

@asgrim
Copy link
Member

asgrim commented Apr 27, 2018

Build failures were due to BC breaks indeed, so merging.

@asgrim asgrim merged commit 4b9138b into master Apr 27, 2018
@asgrim asgrim deleted the feature/#24-rename-package branch April 27, 2018 12:07
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.

2 participants