-
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
Create CompareApi interface #54
Conversation
src/ClassComparator.php
Outdated
use function array_map; | ||
use function sprintf; | ||
|
||
class ClassComparator implements Comparator |
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.
Should be final
now
src/Comparator.php
Outdated
|
||
class Comparator | ||
interface Comparator |
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 think this should be named ApiComparator
or such.
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.
Since there's only a single method, what do you think of using __invoke
and naming this CompareApi
or such?
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.
Done, I think it follows the rest of the classes nicely. What do you think about CompareClass
naming? I'm not sure about it
src/Comparator.php
Outdated
$this->interfaceBasedComparisons = $interfaceBasedComparisons; | ||
$this->traitBasedComparisons = $traitBasedComparisons; | ||
} | ||
|
||
/** | ||
* @param ClassReflector $definedSymbols containing only defined symbols in the compared API |
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 think I messed up the description here. The idea is that $definedSymbols
is the subset of symbols we want to 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.
The $newSourcesWithDependencies
is also wrong - my C&P mistake, sorry :-\
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.
Updated, any better?
ab6b62d
to
3cd9449
Compare
3cd9449
to
0d61716
Compare
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.
Besides the plural naming, this looks good now, thanks!
@@ -67,7 +67,7 @@ function (string $installationPath) use ($composerIo) : Installer { | |||
}, | |||
$astLocator | |||
), | |||
new Comparator( | |||
new CompareClass( |
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.
Probably want to use CompareClasses
, since the API works with multiple classes (plural)
0d61716
to
daa10be
Compare
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.
Awesome, thanks 👍
Closes #28