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

Verify method, function, property, constant and interface changes and report BC breaks #38

Merged
merged 111 commits into from
Apr 26, 2018
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
111 commits
Select commit Hold shift + click to select a range
42def53
Adding an utility to check if covariance is being respected in a type…
Ocramius Apr 15, 2018
709b22a
Simplified nested conditional that could have been a boolean expression
Ocramius Apr 15, 2018
a2741a9
Simplified more nested conditionals that could have been boolean expr…
Ocramius Apr 15, 2018
7c73cd1
Completed covariance and contravariance type comparators
Ocramius Apr 15, 2018
ee3bfce
Adding IDE hints for the reflection issues around the `Reflector` int…
Ocramius Apr 15, 2018
f5d93f0
Adding IDE hints for the reflection issues around the `Reflector` int…
Ocramius Apr 15, 2018
b522b08
Considering type nullability in variance and covariance checks
Ocramius Apr 15, 2018
cd198fa
Using an internal `ReflectionType` to preload target `ReflectionClass…
Ocramius Apr 15, 2018
ed255c8
Revert "Using an internal `ReflectionType` to preload target `Reflect…
Ocramius Apr 16, 2018
e38ca3a
Leveraging improved `ReflectionType` API from https://github.com/Roav…
Ocramius Apr 16, 2018
1de6f6f
Type BC break detector that can detect variance issues with return ty…
Ocramius Apr 16, 2018
7916b00
Coverage declarations
Ocramius Apr 16, 2018
94b8dd8
Multi function-based checker
Ocramius Apr 16, 2018
ebf80fe
Verifying covariance also on `ReflectionMethod`, not just on `Reflect…
Ocramius Apr 16, 2018
e53bbf2
Parameter type contravariance checks
Ocramius Apr 16, 2018
4684c13
Improved `Change` wording for return type covariance checks
Ocramius Apr 16, 2018
dc8e3f2
Naive `RequiredParameterAmountIncreased` BC checker
Ocramius Apr 16, 2018
51c1d28
Massively simplified `RequiredParameterAmountIncreased` checker by le…
Ocramius Apr 16, 2018
d6c8dff
BC comparator detecting default value changes
Ocramius Apr 16, 2018
61a83cd
Cleaning up comparator so it detects class and function changes via i…
Ocramius Apr 16, 2018
32b58d5
Passing a dummy `FunctionBased` comparator to the `Comparator` constr…
Ocramius Apr 16, 2018
6816ead
BC compliance check that verifies is a class became `final`
Ocramius Apr 16, 2018
f9c41dc
#41 detect by-ref to by-val return value changes as BC breaks
Ocramius Apr 16, 2018
c2173ba
#41 detect by-ref to/from by-val parameter changes as BC breaks
Ocramius Apr 16, 2018
46294b9
Removing duplicate testing of open class to final class => moved to d…
Ocramius Apr 16, 2018
299bc52
Verifying that migrating between accessible static-methods and instan…
Ocramius Apr 16, 2018
63e6147
Detecting property default value changes
Ocramius Apr 16, 2018
44c01f4
Detecting property scope changes
Ocramius Apr 16, 2018
dd5cabd
Comparator looking for reduced property visibility
Ocramius Apr 16, 2018
cc79887
Removing duplicate over-complicated `PropertyVisibilityReduced` checker
Ocramius Apr 16, 2018
b05cf6b
BC compliance detector that looks for API documentation type changes …
Ocramius Apr 16, 2018
9e365b8
Adding `MultiPropertyBased` checker that spans over multiple `Propert…
Ocramius Apr 16, 2018
83f51b7
Start to build method-based BC comparators
Ocramius Apr 16, 2018
94eaef4
Wrapper class that checks methods against function checks when a meth…
Ocramius Apr 16, 2018
2d158b6
Adding `ClassConstant`-based checks
Ocramius Apr 16, 2018
74bac0e
Moved constant value checks into their own `ConstantBased` checks nam…
Ocramius Apr 16, 2018
5a4af0d
Removed plural from singular type variable
Ocramius Apr 16, 2018
0d33cd0
Adding checker for constant visibility reduction - prevents decreasin…
Ocramius Apr 16, 2018
e689e57
Making it clear that current `ConstantBased` checks are actually `Cla…
Ocramius Apr 16, 2018
15c380c
Moving `MethodScopeChanged` into the `MethodBased` namespace, working…
Ocramius Apr 16, 2018
5c4ce73
Moved method visibility reduction checks to their own `MethodBased` n…
Ocramius Apr 16, 2018
b70359d
BC comparator to check for added interface methods
Ocramius Apr 16, 2018
cc3db45
Delegating almost all `Comparator` operations into the specific `Roav…
Ocramius Apr 16, 2018
b583e96
Wiring up the comparator! All aboard! \o/
Ocramius Apr 16, 2018
5d38212
Corrected inline hint syntax as per phpstan reports
Ocramius Apr 16, 2018
2a97ece
Bumping BetterReflection version to a development version (required t…
Ocramius Apr 16, 2018
f433805
Un-shallow clone so that we don't get errors when trying to perform d…
Ocramius Apr 16, 2018
eb3109c
Verifying that `PropertyDocumentedTypeChanged` does not consider `pri…
Ocramius Apr 16, 2018
6425f24
Removing unused interface implementations from `Roave\ApiCompare\Chan…
Ocramius Apr 16, 2018
9430e96
Revert "Removing unused interface implementations from `Roave\ApiComp…
Ocramius Apr 16, 2018
10e2870
Verifying that sub-comparators are not used when symbols disappear fr…
Ocramius Apr 16, 2018
97d2186
Changing a method from concrete to `abstract` is a BC break - added a…
Ocramius Apr 17, 2018
c382a88
BC check for classes becoming abstract
Ocramius Apr 17, 2018
b3ad51f
BC check for classes becoming interfaces
Ocramius Apr 17, 2018
dcb4d2c
Adding a way to check multiple interface changes at once
Ocramius Apr 17, 2018
185d85d
Adding a BC check to see if an interface became a class
Ocramius Apr 17, 2018
8bd8141
BC check to verify if a method became `final`
Ocramius Apr 17, 2018
9c5cdfd
Requiring `roave/better-reflection` as `dev-master`, since https://gi…
Ocramius Apr 18, 2018
06d1633
Re-introduced comment about why visibility checks work on strings too
Ocramius Apr 18, 2018
32a7a58
Abstraction to retrieve the name of a function or a method
Ocramius Apr 18, 2018
d22809b
Abstraction to retrieve the name of a property
Ocramius Apr 18, 2018
a59a2d2
Re-using function/property name abstractions across the codebase to d…
Ocramius Apr 18, 2018
d4ab86a
Re-introduced comment about why visibility checks work on strings too
Ocramius Apr 18, 2018
3f6b5b2
Comparator that only checks accessible properties
Ocramius Apr 18, 2018
2019497
Deferring "visibility" checks to `AccessiblePropertyChanged` - `priva…
Ocramius Apr 18, 2018
bcd0dba
Change checker to verify only accessible methods
Ocramius Apr 18, 2018
de5d5ed
Segregated checking accessible methods in the `AccessibleMethodChange…
Ocramius Apr 18, 2018
e781373
Introduced a `PropertyChanged` comparator that verifies all shared pr…
Ocramius Apr 18, 2018
bc5bf95
Using the `PropertyChanged` comparator instead of having dedicated co…
Ocramius Apr 18, 2018
b7f3bbc
Introduced a `MethodChanged` comparator that verifies all shared meth…
Ocramius Apr 18, 2018
3478549
Using the `MethodChanged` comparator instead of having dedicated code…
Ocramius Apr 18, 2018
04c635e
Introduced a `ConstantChanged` comparator that verifies all shared co…
Ocramius Apr 18, 2018
a8b3520
Verifying that `array` -> `iterable` is not covariant, while `iterabl…
Ocramius Apr 18, 2018
28b1596
Using the `ConstantChanged` comparator instead of having dedicated co…
Ocramius Apr 18, 2018
8115c6e
Verifying `Changes#mergeWith()` API
Ocramius Apr 18, 2018
e1a015e
Utilities to verify open/closed class changes
Ocramius Apr 18, 2018
9ac53f8
Checker that verifies if a function parameter changed type (at all)
Ocramius Apr 18, 2018
23e3de7
Checker that verifies if a function return type changed (at all)
Ocramius Apr 18, 2018
ce49948
Checking if a non-final class has invariant changes, while final clas…
Ocramius Apr 18, 2018
d17f1bb
Correcting phpstan detected static analysis issues
Ocramius Apr 18, 2018
ade49b3
Corrected phpcs detected issues
Ocramius Apr 18, 2018
161dc76
XSD reference for phpcs and phpunit
Ocramius Apr 18, 2018
894efb4
Applying `doctrine/coding-standard` changes
Ocramius Apr 18, 2018
2e9a69f
Applying `doctrine/coding-standard` changes, excluding problematic paths
Ocramius Apr 18, 2018
b005906
Renamed `Multi*Based` classes to `MultipleChecksOnA*` for clarity
Ocramius Apr 22, 2018
33be9dc
Added filters to check only public/protected methods
Ocramius Apr 22, 2018
bf54571
Checks to verify only public/protected properties
Ocramius Apr 22, 2018
71a0546
Filters to check only public or protected class constants
Ocramius Apr 22, 2018
3302bf5
Naming consistency: `Change` (imperative) vs `Changed` (past/query-form)
Ocramius Apr 22, 2018
674e46d
Moved reflection-based checks out of the `Reflector#reflect()` call t…
Ocramius Apr 22, 2018
74de350
Corrected reference to non-existing interface (which was renamed)
Ocramius Apr 22, 2018
2d52ed3
Applied CS changes according to configured coding standards
Ocramius Apr 22, 2018
263a9a9
Separating `public` and `protected` checks for class BC detection - f…
Ocramius Apr 22, 2018
b9216bc
Introduced basic trait-based checks
Ocramius Apr 22, 2018
fe838c2
BC compliance checks to verify if a class/trait/interface became one …
Ocramius Apr 22, 2018
cde7708
Removed unused imports
Ocramius Apr 22, 2018
e77df74
Adapters to use class-based checks on interfaces/traits
Ocramius Apr 22, 2018
c94b665
Verifying `Changes#count()` behavior
Ocramius Apr 22, 2018
edb5259
Verifying that `iterable` and non-`array` scalars are not covariant i…
Ocramius Apr 22, 2018
8f30e48
Removed redundant `Comparator` check, as detected by mutation tests
Ocramius Apr 22, 2018
dc4914c
Verifying that a single change in the result is sufficient to trigger…
Ocramius Apr 22, 2018
40d50e6
Getting rid of possible issues with `in_array()`, which doesn't guara…
Ocramius Apr 22, 2018
6f87995
Using non-strict `in_array()` checks to avoid copying data around wit…
Ocramius Apr 22, 2018
2ac4760
Documented `ArrayHelpers` as `@internal`
Ocramius Apr 22, 2018
783e8b2
Removed redundant `getOption() !== null` check - the option is either…
Ocramius Apr 22, 2018
f598aa8
Adding `infection/infection` to the build matrix
Ocramius Apr 22, 2018
424aefc
Treating class, interface and trait as completely distinct symbols wi…
Ocramius Apr 22, 2018
92c07a7
Automated CS fixes as per our phpcs rules
Ocramius Apr 22, 2018
943dd95
#38 removed same-class assertions as per @asgrim's review
Ocramius Apr 25, 2018
8c62056
#38 imported constants are before imported functions
Ocramius Apr 25, 2018
361754c
#38 s/interface became a class/trait became a class/ as per @asgrim's…
Ocramius Apr 25, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
vendor
infection-log.txt
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ jobs:
php: 7.2
script: vendor/bin/phpcs

- stage: Mutation Tests
php: 7.2
script: vendor/bin/infection

cache:
directories:
- $HOME/.composer/cache
193 changes: 148 additions & 45 deletions bin/api-compare.php

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Copy link
Member

Choose a reason for hiding this comment

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

Adding infection/infection could've been a separate PR :/

Copy link
Member Author

Choose a reason for hiding this comment

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

Same as #38 (comment) - indeed creeped in too much

},
"autoload": {
"psr-4": {
Expand Down
Loading