@@ -194,7 +194,8 @@ Add default value to a parameter Yes [2]_ No
194194Remove default value of a parameter No No
195195Add type hint to a parameter No No
196196Remove type hint of a parameter Yes [2 ]_ No
197- Change return type Yes [2 ]_ [4 ]_ No
197+ Change parameter type Yes [2 ]_ [4 ]_ No
198+ Change return type Yes [2 ]_ [5 ]_ No
198199============================================== ============== ==============
199200
200201
@@ -211,7 +212,7 @@ Remove entirely No No
211212Make final Yes [2 ]_ No
212213Make abstract No No
213214Change name or namespace No No
214- Change parent class Yes [5 ]_ Yes [5 ]_
215+ Change parent class Yes [6 ]_ Yes [6 ]_
215216Add interface Yes Yes
216217Remove interface No No
217218**Public Properties **
@@ -237,9 +238,10 @@ Add parameter with a default value Yes [2]_ No
237238Remove parameter Yes [3 ]_ Yes [3 ]_
238239Add default value to a parameter Yes [2 ]_ No
239240Remove default value of a parameter No No
240- Add type hint to a parameter Yes [6 ]_ No
241+ Add type hint to a parameter Yes [7 ]_ No
241242Remove type hint of a parameter Yes [2 ]_ No
242- Change return type Yes [2 ]_ [4 ]_ No
243+ Change parameter type Yes [2 ]_ [4 ]_ No
244+ Change return type Yes [2 ]_ [5 ]_ No
243245**Protected Methods **
244246Add protected method Yes Yes
245247Remove protected method Yes [2 ]_ No
@@ -252,7 +254,8 @@ Add default value to a parameter Yes [2]_ No
252254Remove default value of a parameter Yes [2 ]_ No
253255Add type hint to a parameter Yes [2 ]_ No
254256Remove type hint of a parameter Yes [2 ]_ No
255- Change return type Yes [2 ]_ [4 ]_ No
257+ Change parameter type Yes [2 ]_ [4 ]_ No
258+ Change return type Yes [2 ]_ [5 ]_ No
256259================================================== ============== ==============
257260
258261
@@ -264,8 +267,22 @@ Change return type Yes [2]_ [4]_ No
264267
265268 .. [3 ] Only the last parameter(s) of a method may be removed.
266269
267- .. [4 ] The return type may only be changed to compatible types. The following
268- type changes are allowed:
270+ .. [4 ] The parameter type may only be changed to a compatible or less specific
271+ type. The following type changes are allowed:
272+
273+ =================== ==================================================================
274+ Original Type New Type
275+ =================== ==================================================================
276+ boolean any `scalar type `_ with equivalent `boolean values `_
277+ string any `scalar type `_ or object with equivalent `string values `_
278+ integer any `scalar type `_ with equivalent `integer values `_
279+ float any `scalar type `_ with equivalent `float values `_
280+ class ``<C> `` any superclass or interface of ``<C> ``
281+ interface ``<I> `` any superinterface of ``<I> ``
282+ =================== ==================================================================
283+
284+ .. [5 ] The return type may only be changed to a compatible or more specific
285+ type. The following type changes are allowed:
269286
270287 =================== ==================================================================
271288 Original Type New Type
@@ -282,10 +299,10 @@ Change return type Yes [2]_ [4]_ No
282299 interface ``<I> `` any subinterface or implementing class of ``<I> ``
283300 =================== ==================================================================
284301
285- .. [5 ] When changing the parent class, the original parent class must remain an
302+ .. [6 ] When changing the parent class, the original parent class must remain an
286303 ancestor of the class.
287304
288- .. [6 ] A type hint may only be added if passing a value with a different type
305+ .. [7 ] A type hint may only be added if passing a value with a different type
289306 previously generated a fatal error.
290307
291308 .. _scalar type : http://php.net/manual/en/function.is-scalar.php
0 commit comments