@@ -4,7 +4,7 @@ Our Backwards Compatibility Promise
4
4
Ensuring smooth upgrades of your projects is our first priority. That's why
5
5
we promise you backwards compatibility (BC) for all minor Symfony releases.
6
6
7
- You probably recognize this strategy as `Semantic Versioning `_. In short,
7
+ You probably recognize this strategy as `Semantic Versioning `_. In short,
8
8
Semantic Versioning means that only major releases (such as 2.0, 3.0 etc.) are
9
9
allowed to break backwards compatibility. Minor releases (such as 2.5, 2.6 etc.)
10
10
may introduce new features, but must do so without breaking the existing API of
@@ -211,21 +211,22 @@ Type of Change Regular API
211
211
============================================== ============== ==============
212
212
Remove entirely No No
213
213
Change name or namespace No No
214
- Add parent interface Yes [2 ]_ No
214
+ Add parent interface Yes [2 ]_ Yes [ 3 ]_
215
215
Remove parent interface No No
216
216
**Methods **
217
217
Add method Yes [2 ]_ No
218
218
Remove method No No
219
219
Change name No No
220
+ Move to parent interface Yes Yes
220
221
Add argument without a default value No No
221
222
Add argument with a default value Yes [2 ]_ No
222
- Remove argument Yes [3 ]_ Yes [3 ]_
223
+ Remove argument Yes [4 ]_ Yes [4 ]_
223
224
Add default value to an argument Yes [2 ]_ No
224
225
Remove default value of an argument No No
225
226
Add type hint to an argument No No
226
227
Remove type hint of an argument Yes [2 ]_ No
227
- Change argument type Yes [2 ]_ [4 ]_ No
228
- Change return type Yes [2 ]_ [5 ]_ No
228
+ Change argument type Yes [2 ]_ [5 ]_ No
229
+ Change return type Yes [2 ]_ [6 ]_ No
229
230
============================================== ============== ==============
230
231
231
232
Changing Classes
@@ -241,17 +242,19 @@ Remove entirely No No
241
242
Make final Yes [2 ]_ No
242
243
Make abstract No No
243
244
Change name or namespace No No
244
- Change parent class Yes [6 ]_ Yes [6 ]_
245
+ Change parent class Yes [7 ]_ Yes [7 ]_
245
246
Add interface Yes Yes
246
247
Remove interface No No
247
248
**Public Properties **
248
249
Add public property Yes Yes
249
250
Remove public property No No
250
251
Reduce visibility No No
252
+ Move to parent class Yes Yes
251
253
**Protected Properties **
252
254
Add protected property Yes Yes
253
255
Remove protected property Yes [2 ]_ No
254
256
Reduce visibility Yes [2 ]_ No
257
+ Move to parent class Yes Yes
255
258
**Private Properties **
256
259
Add private property Yes Yes
257
260
Remove private property Yes Yes
@@ -260,34 +263,37 @@ Add constructor without mandatory arguments Yes [2]_ Yes [2]_
260
263
Remove constructor Yes [2 ]_ No
261
264
Reduce visibility of a public constructor No No
262
265
Reduce visibility of a protected constructor Yes [2 ]_ No
266
+ Move to parent class Yes Yes
263
267
**Public Methods **
264
268
Add public method Yes Yes
265
269
Remove public method No No
266
270
Change name No No
267
271
Reduce visibility No No
272
+ Move to parent class Yes Yes
268
273
Add argument without a default value No No
269
274
Add argument with a default value Yes [2 ]_ No
270
- Remove argument Yes [3 ]_ Yes [3 ]_
275
+ Remove argument Yes [4 ]_ Yes [4 ]_
271
276
Add default value to an argument Yes [2 ]_ No
272
277
Remove default value of an argument No No
273
- Add type hint to an argument Yes [7 ]_ No
278
+ Add type hint to an argument Yes [8 ]_ No
274
279
Remove type hint of an argument Yes [2 ]_ No
275
- Change argument type Yes [2 ]_ [4 ]_ No
276
- Change return type Yes [2 ]_ [5 ]_ No
280
+ Change argument type Yes [2 ]_ [5 ]_ No
281
+ Change return type Yes [2 ]_ [6 ]_ No
277
282
**Protected Methods **
278
283
Add protected method Yes Yes
279
284
Remove protected method Yes [2 ]_ No
280
285
Change name No No
281
286
Reduce visibility Yes [2 ]_ No
287
+ Move to parent class Yes Yes
282
288
Add argument without a default value Yes [2 ]_ No
283
289
Add argument with a default value Yes [2 ]_ No
284
- Remove argument Yes [3 ]_ Yes [3 ]_
290
+ Remove argument Yes [4 ]_ Yes [4 ]_
285
291
Add default value to an argument Yes [2 ]_ No
286
292
Remove default value of an argument Yes [2 ]_ No
287
293
Add type hint to an argument Yes [2 ]_ No
288
294
Remove type hint of an argument Yes [2 ]_ No
289
- Change argument type Yes [2 ]_ [4 ]_ No
290
- Change return type Yes [2 ]_ [5 ]_ No
295
+ Change argument type Yes [2 ]_ [5 ]_ No
296
+ Change return type Yes [2 ]_ [6 ]_ No
291
297
**Private Methods **
292
298
Add private method Yes Yes
293
299
Remove private method Yes Yes
@@ -310,10 +316,13 @@ Change return type Yes Yes
310
316
.. [2 ] Should be avoided. When done, this change must be documented in the
311
317
UPGRADE file.
312
318
313
- .. [3 ] Only the last argument(s) of a method may be removed, as PHP does not
319
+ .. [3 ] The added parent interface must not introduce any new methods that don't
320
+ exist in the interface already.
321
+
322
+ .. [4 ] Only the last argument(s) of a method may be removed, as PHP does not
314
323
care about additional arguments that you pass to a method.
315
324
316
- .. [4 ] The argument type may only be changed to a compatible or less specific
325
+ .. [5 ] The argument type may only be changed to a compatible or less specific
317
326
type. The following type changes are allowed:
318
327
319
328
=================== ==================================================================
@@ -327,7 +336,7 @@ Change return type Yes Yes
327
336
interface ``<I> `` any superinterface of ``<I> ``
328
337
=================== ==================================================================
329
338
330
- .. [5 ] The return type may only be changed to a compatible or more specific
339
+ .. [6 ] The return type may only be changed to a compatible or more specific
331
340
type. The following type changes are allowed:
332
341
333
342
=================== ==================================================================
@@ -345,10 +354,10 @@ Change return type Yes Yes
345
354
interface ``<I> `` any subinterface or implementing class of ``<I> ``
346
355
=================== ==================================================================
347
356
348
- .. [6 ] When changing the parent class, the original parent class must remain an
357
+ .. [7 ] When changing the parent class, the original parent class must remain an
349
358
ancestor of the class.
350
359
351
- .. [7 ] A type hint may only be added if passing a value with a different type
360
+ .. [8 ] A type hint may only be added if passing a value with a different type
352
361
previously generated a fatal error.
353
362
354
363
.. _Semantic Versioning : http://semver.org/
0 commit comments