Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/core23/willitbreak
BC break table for php development using semver
https://github.com/core23/willitbreak
Last synced: 9 days ago
JSON representation
BC break table for php development using semver
- Host: GitHub
- URL: https://github.com/core23/willitbreak
- Owner: core23
- Created: 2016-05-29T13:00:53.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-06-04T05:39:40.000Z (over 8 years ago)
- Last Synced: 2024-10-11T13:13:03.207Z (about 1 month ago)
- Size: 1000 Bytes
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.MD
Awesome Lists containing this project
README
# BC break table for php
The following tables will give you a short overview which changes are allowed in your code or if they result in a BC break.
## Modification on classes
| type | add method | remove method | add method stub | remove method stub | make abstract | remove abstract | make final | remove final | add interface | remove interface |
|----------------|------------|----------------|-----------------|--------------------|---------------|-----------------|------------|--------------|---------------|------------------|
| class | ok | BREAK | - | - | BREAK | - | BREAK | ok | ok | ok |
| abstract class | ok | BREAK | BREAK | BREAK | - | ok | - | - | depends*1 | ok |
| final class | ok | BREAK | - | - | - | - | - | ok | ok | ok |
| interface | BREAK | - | BREAK | ok | - | - | - | - | BREAK | ok |
| trait | BREAK | BREAK | BREAK | ok | - | - | - | - | - | - |
Adding / Removing methods for private methods are always alowed.
## Modification on methods
### Normal class
| method type | make final | remove final | increase visibility | decrease visiblity | add parameter | add optional parameter | remove parameter | remove optional parameter | change signature |
|-----------------|------------|--------------|---------------------|--------------------|---------------|------------------------|------------------|---------------------------|------------------|
| final public | - | ok | - | BREAK | BREAK | ok | BREAK | BREAK | BREAK |
| final protected | - | ok | ok | BREAK | BREAK | ok | BREAK | BREAK | BREAK |
| public | BREAK | ok | - | BREAK | BREAK | BREAK | BREAK | BREAK | BREAK |
| protected | BREAK | ok | BREAK | BREAK | BREAK | BREAK | BREAK | BREAK | BREAK |
| private | - | - | ok | - | ok | ok | ok | ok | ok |
### Abstract class
| method type | make abstract | remove abstract | make final | remove final | increase visibility | decrease visiblity | add parameter | add optional parameter | remove parameter | remove optional parameter | change signature |
|--------------------|---------------|-----------------|------------|--------------|---------------------|--------------------|---------------|------------------------|------------------|---------------------------|------------------|
| final public | - | - | - | ok | - | BREAK | BREAK | ok | BREAK | BREAK | BREAK |
| final protected | - | - | - | ok | ok | BREAK | BREAK | ok | BREAK | BREAK | BREAK |
| abstract public | - | depends*1 | - | - | BREAK | BREAK | BREAK | ok | BREAK | BREAK | BREAK |
| abstract protected | - | depends*1 | - | - | BREAK | BREAK | BREAK | ok | BREAK | BREAK | BREAK |
| public | BREAK | - | BREAK | - | - | BREAK | BREAK | BREAK | BREAK | BREAK | BREAK |
| protected | BREAK | - | BREAK | - | BREAK | BREAK | BREAK | BREAK | BREAK | BREAK | BREAK |
| private | - | - | - | - | ok | - | ok | ok | ok | ok | ok |
### Final class
| method type | increase visibility | decrease visiblity | add parameter | add optional parameter | remove parameter | remove optional parameter | change signature |
|-------------|---------------------|--------------------|---------------|------------------------|------------------|---------------------------|------------------|
| public | - | BREAK | BREAK | ok | BREAK | BREAK | BREAK |
| protected | ok | ok | ok | ok | ok | ok | ok |
| private | ok | - | ok | ok | ok | ok | ok |
### Interface
| method type | add parameter | add optional parameter | remove parameter | remove optional parameter | change signature |
|-------------|---------------|------------------------|------------------|---------------------------|------------------|
| public | BREAK | BREAK | BREAK | BREAK | BREAK |
### Trait
| method type | make abstract | remove abstract | increase visibility | decrease visiblity | add parameter | add optional parameter | remove parameter | remove optional parameter | change signature |
|--------------------|---------------|-----------------|---------------------|--------------------|---------------|------------------------|------------------|---------------------------|------------------|
| abstract public | - | | - | | | | | | |
| abstract protected | - | | | | | | | | |
| public | | - | - | | | | | | |
| protected | | - | | | | | | | |
| private | - | - | | - | ok | ok | ok | ok | ok |
The `final` keyword has no impact to traits, because you can't extend a trait.
*1 ok, if you implement all methods