-
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
Verify method, function, property, constant and interface changes and report BC breaks #38
Changes from all commits
42def53
709b22a
a2741a9
7c73cd1
ee3bfce
f5d93f0
b522b08
cd198fa
ed255c8
e38ca3a
1de6f6f
7916b00
94b8dd8
ebf80fe
e53bbf2
4684c13
dc8e3f2
51c1d28
d6c8dff
61a83cd
32b58d5
6816ead
f9c41dc
c2173ba
46294b9
299bc52
63e6147
44c01f4
dd5cabd
cc79887
b05cf6b
9e365b8
83f51b7
94eaef4
2d158b6
74bac0e
5a4af0d
0d33cd0
e689e57
15c380c
5c4ce73
b70359d
cc3db45
b583e96
5d38212
2a97ece
f433805
eb3109c
6425f24
9430e96
10e2870
97d2186
c382a88
b3ad51f
dcb4d2c
185d85d
8bd8141
9c5cdfd
06d1633
32a7a58
d22809b
a59a2d2
d4ab86a
3f6b5b2
2019497
bcd0dba
de5d5ed
e781373
bc5bf95
b7f3bbc
3478549
04c635e
a8b3520
28b1596
8115c6e
e1a015e
9ac53f8
23e3de7
ce49948
d17f1bb
ade49b3
161dc76
894efb4
2e9a69f
b005906
33be9dc
bf54571
71a0546
3302bf5
674e46d
74de350
2d52ed3
263a9a9
b9216bc
fe838c2
cde7708
e77df74
c94b665
edb5259
8f30e48
dc4914c
40d50e6
6f87995
2ac4760
783e8b2
f598aa8
424aefc
92c07a7
943dd95
8c62056
361754c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
vendor | ||
infection-log.txt |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,15 @@ | |
|
||
use Roave\ApiCompare\Command; | ||
use Roave\ApiCompare\Comparator; | ||
use Roave\ApiCompare\Comparator\BackwardsCompatibility\ClassBased; | ||
use Roave\ApiCompare\Comparator\BackwardsCompatibility\ClassConstantBased; | ||
use Roave\ApiCompare\Comparator\BackwardsCompatibility\FunctionBased; | ||
use Roave\ApiCompare\Comparator\BackwardsCompatibility\InterfaceBased; | ||
use Roave\ApiCompare\Comparator\BackwardsCompatibility\MethodBased; | ||
use Roave\ApiCompare\Comparator\BackwardsCompatibility\PropertyBased; | ||
use Roave\ApiCompare\Comparator\BackwardsCompatibility\TraitBased; | ||
use Roave\ApiCompare\Comparator\Variance\TypeIsContravariant; | ||
use Roave\ApiCompare\Comparator\Variance\TypeIsCovariant; | ||
use Roave\ApiCompare\Factory\DirectoryReflectorFactory; | ||
use Roave\ApiCompare\Git\GetVersionCollectionFromGitRepository; | ||
use Roave\ApiCompare\Git\GitCheckoutRevisionToTemporaryPath; | ||
|
@@ -31,7 +40,210 @@ | |
new GetVersionCollectionFromGitRepository(), | ||
new PickLastMinorVersionFromCollection(), | ||
new Comparator( | ||
new Comparator\BackwardsCompatibility\ClassBased\PropertyRemoved() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note: this tree of checks is quite huge, but is pretty much describing what kinds of BC breaks we want to rely upon. If we want to make it more "friendly", I can move the instantiation to |
||
new ClassBased\MultipleChecksOnAClass( | ||
new ClassBased\ClassBecameAbstract(), | ||
new ClassBased\ClassBecameInterface(), | ||
new ClassBased\ClassBecameTrait(), | ||
new ClassBased\ClassBecameFinal(), | ||
new ClassBased\ConstantRemoved(), | ||
new ClassBased\PropertyRemoved(), | ||
new ClassBased\MethodRemoved(), | ||
new ClassBased\OpenClassChanged( | ||
new ClassBased\MultipleChecksOnAClass( | ||
new ClassBased\ConstantChanged( | ||
new ClassConstantBased\MultipleChecksOnAClassConstant( | ||
new ClassConstantBased\OnlyPublicClassConstantChanged( | ||
new ClassConstantBased\MultipleChecksOnAClassConstant( | ||
new ClassConstantBased\ClassConstantVisibilityReduced(), | ||
new ClassConstantBased\ClassConstantValueChanged() | ||
) | ||
), | ||
new ClassConstantBased\OnlyProtectedClassConstantChanged( | ||
new ClassConstantBased\MultipleChecksOnAClassConstant( | ||
new ClassConstantBased\ClassConstantVisibilityReduced(), | ||
new ClassConstantBased\ClassConstantValueChanged() | ||
) | ||
) | ||
) | ||
), | ||
new ClassBased\PropertyChanged( | ||
new PropertyBased\MultipleChecksOnAProperty( | ||
new PropertyBased\OnlyPublicPropertyChanged( | ||
new PropertyBased\MultipleChecksOnAProperty( | ||
new PropertyBased\PropertyDocumentedTypeChanged(), | ||
new PropertyBased\PropertyDefaultValueChanged(), | ||
new PropertyBased\PropertyVisibilityReduced(), | ||
new PropertyBased\PropertyScopeChanged() | ||
) | ||
), | ||
new PropertyBased\OnlyProtectedPropertyChanged( | ||
new PropertyBased\MultipleChecksOnAProperty( | ||
new PropertyBased\PropertyDocumentedTypeChanged(), | ||
new PropertyBased\PropertyDefaultValueChanged(), | ||
new PropertyBased\PropertyVisibilityReduced(), | ||
new PropertyBased\PropertyScopeChanged() | ||
) | ||
) | ||
) | ||
), | ||
new ClassBased\MethodChanged( | ||
new MethodBased\MultipleChecksOnAMethod( | ||
new MethodBased\OnlyPublicMethodChanged( | ||
new MethodBased\MultipleChecksOnAMethod( | ||
new MethodBased\MethodBecameFinal(), | ||
new MethodBased\MethodConcretenessChanged(), | ||
new MethodBased\MethodScopeChanged(), | ||
new MethodBased\MethodVisibilityReduced(), | ||
new MethodBased\MethodFunctionDefinitionChanged( | ||
new FunctionBased\MultipleChecksOnAFunction( | ||
new FunctionBased\ParameterByReferenceChanged(), | ||
new FunctionBased\ReturnTypeByReferenceChanged(), | ||
new FunctionBased\RequiredParameterAmountIncreased(), | ||
new FunctionBased\ParameterDefaultValueChanged(), | ||
new FunctionBased\ReturnTypeCovarianceChanged(new TypeIsCovariant()), | ||
new FunctionBased\ReturnTypeChanged(), | ||
new FunctionBased\ParameterTypeContravarianceChanged(new TypeIsContravariant()), | ||
new FunctionBased\ParameterTypeChanged() | ||
) | ||
) | ||
) | ||
), | ||
new MethodBased\OnlyProtectedMethodChanged( | ||
new MethodBased\MultipleChecksOnAMethod( | ||
new MethodBased\MethodBecameFinal(), | ||
new MethodBased\MethodConcretenessChanged(), | ||
new MethodBased\MethodScopeChanged(), | ||
new MethodBased\MethodVisibilityReduced(), | ||
new MethodBased\MethodFunctionDefinitionChanged( | ||
new FunctionBased\MultipleChecksOnAFunction( | ||
new FunctionBased\ParameterByReferenceChanged(), | ||
new FunctionBased\ReturnTypeByReferenceChanged(), | ||
new FunctionBased\RequiredParameterAmountIncreased(), | ||
new FunctionBased\ParameterDefaultValueChanged(), | ||
new FunctionBased\ReturnTypeCovarianceChanged(new TypeIsCovariant()), | ||
new FunctionBased\ReturnTypeChanged(), | ||
new FunctionBased\ParameterTypeContravarianceChanged(new TypeIsContravariant()), | ||
new FunctionBased\ParameterTypeChanged() | ||
) | ||
) | ||
) | ||
) | ||
) | ||
) | ||
) | ||
), | ||
new ClassBased\FinalClassChanged( | ||
new ClassBased\MultipleChecksOnAClass( | ||
new ClassBased\ConstantChanged( | ||
new ClassConstantBased\OnlyPublicClassConstantChanged( | ||
new ClassConstantBased\MultipleChecksOnAClassConstant( | ||
new ClassConstantBased\ClassConstantVisibilityReduced(), | ||
new ClassConstantBased\ClassConstantValueChanged() | ||
) | ||
) | ||
), | ||
new ClassBased\PropertyChanged( | ||
new PropertyBased\OnlyPublicPropertyChanged( | ||
new PropertyBased\MultipleChecksOnAProperty( | ||
new PropertyBased\PropertyDocumentedTypeChanged(), | ||
new PropertyBased\PropertyDefaultValueChanged(), | ||
new PropertyBased\PropertyVisibilityReduced(), | ||
new PropertyBased\PropertyScopeChanged() | ||
) | ||
) | ||
), | ||
new ClassBased\MethodChanged( | ||
new MethodBased\OnlyPublicMethodChanged( | ||
new MethodBased\MultipleChecksOnAMethod( | ||
new MethodBased\MethodBecameFinal(), | ||
new MethodBased\MethodConcretenessChanged(), | ||
new MethodBased\MethodScopeChanged(), | ||
new MethodBased\MethodVisibilityReduced(), | ||
new MethodBased\MethodFunctionDefinitionChanged( | ||
new FunctionBased\MultipleChecksOnAFunction( | ||
new FunctionBased\ParameterByReferenceChanged(), | ||
new FunctionBased\ReturnTypeByReferenceChanged(), | ||
new FunctionBased\RequiredParameterAmountIncreased(), | ||
new FunctionBased\ParameterDefaultValueChanged(), | ||
new FunctionBased\ReturnTypeCovarianceChanged(new TypeIsCovariant()), | ||
new FunctionBased\ParameterTypeContravarianceChanged(new TypeIsContravariant()) | ||
) | ||
) | ||
) | ||
) | ||
) | ||
) | ||
) | ||
), | ||
new InterfaceBased\MultipleChecksOnAnInterface( | ||
new InterfaceBased\InterfaceBecameClass(), | ||
new InterfaceBased\InterfaceBecameTrait(), | ||
new InterfaceBased\MethodAdded(), | ||
new InterfaceBased\UseClassBasedChecksOnAnInterface( | ||
new ClassBased\MultipleChecksOnAClass( | ||
new ClassBased\ConstantRemoved(), | ||
new ClassBased\MethodRemoved(), | ||
new ClassBased\ConstantChanged( | ||
new ClassConstantBased\ClassConstantValueChanged() | ||
), | ||
new ClassBased\MethodChanged( | ||
new MethodBased\MultipleChecksOnAMethod( | ||
new MethodBased\MethodScopeChanged(), | ||
new MethodBased\MethodFunctionDefinitionChanged( | ||
new FunctionBased\MultipleChecksOnAFunction( | ||
new FunctionBased\ParameterByReferenceChanged(), | ||
new FunctionBased\ReturnTypeByReferenceChanged(), | ||
new FunctionBased\RequiredParameterAmountIncreased(), | ||
new FunctionBased\ParameterDefaultValueChanged(), | ||
new FunctionBased\ReturnTypeCovarianceChanged(new TypeIsCovariant()), | ||
new FunctionBased\ReturnTypeChanged(), | ||
new FunctionBased\ParameterTypeContravarianceChanged(new TypeIsContravariant()), | ||
new FunctionBased\ParameterTypeChanged() | ||
) | ||
) | ||
) | ||
) | ||
) | ||
) | ||
), | ||
new TraitBased\MultipleChecksOnATrait( | ||
new TraitBased\TraitBecameInterface(), | ||
new TraitBased\TraitBecameClass(), | ||
new TraitBased\UseClassBasedChecksOnATrait( | ||
new ClassBased\MultipleChecksOnAClass( | ||
new ClassBased\PropertyChanged( | ||
new PropertyBased\MultipleChecksOnAProperty( | ||
new PropertyBased\PropertyDocumentedTypeChanged(), | ||
new PropertyBased\PropertyDefaultValueChanged(), | ||
new PropertyBased\PropertyVisibilityReduced(), | ||
new PropertyBased\PropertyScopeChanged() | ||
) | ||
), | ||
new ClassBased\MethodChanged( | ||
new MethodBased\MultipleChecksOnAMethod( | ||
new MethodBased\MultipleChecksOnAMethod( | ||
new MethodBased\MethodBecameFinal(), | ||
new MethodBased\MethodConcretenessChanged(), | ||
new MethodBased\MethodScopeChanged(), | ||
new MethodBased\MethodVisibilityReduced(), | ||
new MethodBased\MethodFunctionDefinitionChanged( | ||
new FunctionBased\MultipleChecksOnAFunction( | ||
new FunctionBased\ParameterByReferenceChanged(), | ||
new FunctionBased\ReturnTypeByReferenceChanged(), | ||
new FunctionBased\RequiredParameterAmountIncreased(), | ||
new FunctionBased\ParameterDefaultValueChanged(), | ||
new FunctionBased\ReturnTypeCovarianceChanged(new TypeIsCovariant()), | ||
new FunctionBased\ReturnTypeChanged(), | ||
new FunctionBased\ParameterTypeContravarianceChanged(new TypeIsContravariant()), | ||
new FunctionBased\ParameterTypeChanged() | ||
) | ||
) | ||
) | ||
) | ||
) | ||
) | ||
) | ||
) | ||
) | ||
); | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
"require": { | ||
"php": "^7.2", | ||
"roave/security-advisories": "dev-master", | ||
"roave/better-reflection": "^2.0", | ||
"roave/better-reflection": "dev-master", | ||
"symfony/console": "^4.0", | ||
"beberlei/assert": "^2.9", | ||
"symfony/process": "^4.0", | ||
|
@@ -21,7 +21,8 @@ | |
"phpunit/phpunit": "^7.0", | ||
"doctrine/coding-standard": "^4.0", | ||
"squizlabs/php_codesniffer": "^3.2", | ||
"phpstan/phpstan": "^0.9.2" | ||
"phpstan/phpstan": "^0.9.2", | ||
"infection/infection": "^0.8.1" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Adding There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as #38 (comment) - indeed creeped in too much |
||
}, | ||
"autoload": { | ||
"psr-4": { | ||
|
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.
Why do we need unshallow clones? I don't see anything requiring it?
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.
Somewhere in the CI build you are running these checks against the library itself, and this patch already went further than a shallow clone allows.