@@ -4,7 +4,7 @@ Our Backwards Compatibility Promise
44Ensuring smooth upgrades of your projects is our first priority. That's why
55we promise you backwards compatibility (BC) for all minor Symfony releases.
66
7- You probably recognize this strategy as `Semantic Versioning `_. In short,
7+ You probably recognize this strategy as `Semantic Versioning `_. In short,
88Semantic Versioning means that only major releases (such as 2.0, 3.0 etc.) are
99allowed to break backwards compatibility. Minor releases (such as 2.5, 2.6 etc.)
1010may introduce new features, but must do so without breaking the existing API of
@@ -211,21 +211,22 @@ Type of Change Regular API
211211============================================== ============== ==============
212212Remove entirely No No
213213Change name or namespace No No
214- Add parent interface Yes [2 ]_No
214+ Add parent interface Yes [2 ]_Yes [ 3 ]_
215215Remove parent interface No No
216216**Methods **
217217Add method Yes [2 ]_ No
218218Remove method No No
219219Change name No No
220+ Move to parent interface Yes Yes
220221Add argument without a default value No No
221222Add argument with a default value Yes [2 ]_ No
222- Remove argument Yes [3 ]_ Yes [3 ]_
223+ Remove argument Yes [4 ]_ Yes [4 ]_
223224Add default value to an argument Yes [2 ]_ No
224225Remove default value of an argument No No
225226Add type hint to an argument No No
226227Remove 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
229230============================================== ============== ==============
230231
231232Changing Classes
@@ -241,17 +242,19 @@ Remove entirely No No
241242Make final Yes [2 ]_ No
242243Make abstract No No
243244Change name or namespace No No
244- Change parent class Yes [6 ]_ Yes [6 ]_
245+ Change parent class Yes [7 ]_ Yes [7 ]_
245246Add interface Yes Yes
246247Remove interface No No
247248**Public Properties **
248249Add public property Yes Yes
249250Remove public property No No
250251Reduce visibility No No
252+ Move to parent class Yes Yes
251253**Protected Properties **
252254Add protected property Yes Yes
253255Remove protected property Yes [2 ]_ No
254256Reduce visibility Yes [2 ]_ No
257+ Move to parent class Yes Yes
255258**Private Properties **
256259Add private property Yes Yes
257260Remove private property Yes Yes
@@ -260,34 +263,37 @@ Add constructor without mandatory arguments Yes [2]_ Yes [2]_
260263Remove constructor Yes [2 ]_ No
261264Reduce visibility of a public constructor No No
262265Reduce visibility of a protected constructor Yes [2 ]_ No
266+ Move to parent class Yes Yes
263267**Public Methods **
264268Add public method Yes Yes
265269Remove public method No No
266270Change name No No
267271Reduce visibility No No
272+ Move to parent class Yes Yes
268273Add argument without a default value No No
269274Add argument with a default value Yes [2 ]_ No
270- Remove argument Yes [3 ]_ Yes [3 ]_
275+ Remove argument Yes [4 ]_ Yes [4 ]_
271276Add default value to an argument Yes [2 ]_ No
272277Remove 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
274279Remove 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
277282**Protected Methods **
278283Add protected method Yes Yes
279284Remove protected method Yes [2 ]_ No
280285Change name No No
281286Reduce visibility Yes [2 ]_ No
287+ Move to parent class Yes Yes
282288Add argument without a default value Yes [2 ]_ No
283289Add argument with a default value Yes [2 ]_ No
284- Remove argument Yes [3 ]_ Yes [3 ]_
290+ Remove argument Yes [4 ]_ Yes [4 ]_
285291Add default value to an argument Yes [2 ]_ No
286292Remove default value of an argument Yes [2 ]_ No
287293Add type hint to an argument Yes [2 ]_ No
288294Remove 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
291297**Private Methods **
292298Add private method Yes Yes
293299Remove private method Yes Yes
@@ -310,10 +316,13 @@ Change return type Yes Yes
310316 .. [2 ]Should be avoided. When done, this change must be documented in the
311317 UPGRADE file.
312318
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
314323 care about additional arguments that you pass to a method.
315324
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
317326 type. The following type changes are allowed:
318327
319328 =================== ==================================================================
@@ -327,7 +336,7 @@ Change return type Yes Yes
327336 interface ``<I> `` any superinterface of ``<I> ``
328337 =================== ==================================================================
329338
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
331340 type. The following type changes are allowed:
332341
333342 =================== ==================================================================
@@ -345,10 +354,10 @@ Change return type Yes Yes
345354 interface ``<I> `` any subinterface or implementing class of ``<I> ``
346355 =================== ==================================================================
347356
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
349358 ancestor of the class.
350359
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
352361 previously generated a fatal error.
353362
354363 .. _Semantic Versioning :http://semver.org/