8000 minor #7611 [BC] Allow more changes when the class/method is final (G… · symfony/symfony-docs@7b7ce88 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7b7ce88

Browse files
committed
minor #7611 [BC] Allow more changes when the class/method is final (GuilhemN)
This PR was squashed before being merged into the 2.7 branch (closes #7611). Discussion ---------- [BC] Allow more changes when the class/method is final Fixes #7597 Commits ------- f5b8dd4 Improve notes 936200c Update 4a3fbed Fix comments a5f6d24 [BC] Allow more changes when the class/method is final
2 parents ad2aa31 + f5b8dd4 commit 7b7ce88

File tree

1 file changed

+36
-22
lines changed

1 file changed

+36
-22
lines changed

contributing/code/bc.rst

Lines changed: 36 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ Symfony's classes:
181181
Type of Change Change Allowed
182182
================================================== ==============
183183
Remove entirely No
184-
Make final No
184+
Make final No [6]_
185185
Make abstract No
186186
Change name or namespace No
187187
Change parent class Yes [4]_
@@ -194,8 +194,8 @@ Reduce visibility No
194194
Move to parent class Yes
195195
**Protected Properties**
196196
Add protected property Yes
197-
Remove protected property No
198-
Reduce visibility No
197+
Remove protected property No [7]_
198+
Reduce visibility No [7]_
199199
Move to parent class Yes
200200
**Private Properties**
201201
Add private property Yes
@@ -204,7 +204,7 @@ Remove private property Yes
204204
Add constructor without mandatory arguments Yes [1]_
205205
Remove constructor No
206206
Reduce visibility of a public constructor No
207-
Reduce visibility of a protected constructor No
207+
Reduce visibility of a protected constructor No [7]_
208208
Move to parent class Yes
209209
**Public Methods**
210210
Add public method Yes
@@ -213,29 +213,29 @@ Change name No
213213
Reduce visibility No
214214
Move to parent class Yes
215215
Add argument without a default value No
216-
Add argument with a default value No
216+
Add argument with a default value No [7]_ [8]_
217217
Remove argument Yes [3]_
218-
Add default value to an argument No
218+
Add default value to an argument No [7]_ [8]_
219219
Remove default value of an argument No
220-
Add type hint to an argument No
221-
Remove type hint of an argument No
222-
Change argument type No
223-
Change return type No
220+
Add type hint to an argument No [7]_ [8]_
221+
Remove type hint of an argument No [7]_ [8]_
222+
Change argument type No [7]_ [8]_
223+
Change return type No [7]_ [8]_
224224
**Protected Methods**
225225
Add protected method Yes
226-
Remove protected method No
227-
Change name No
228-
Reduce visibility No
226+
Remove protected method No [7]_
227+
Change name No [7]_
228+
Reduce visibility No [7]_
229229
Move to parent class Yes
230-
Add argument without a default value No
231-
Add argument with a default value No
230+
Add argument without a default value No [7]_
231+
Add argument with a default value No [7]_ [8]_
232232
Remove argument Yes [3]_
233-
Add default value to an argument No
234-
Remove default value of an argument No
235-
Add type hint to an argument No
236-
Remove type hint of an argument No
237-
Change argument type No
238-
Change return type No
233+
Add default value to an argument No [7]_ [8]_
234+
Remove default value of an argument No [7]_
235+
Add type hint to an argument No [7]_ [8]_
236+
Remove type hint of an argument No [7]_ [8]_
237+
Change argument type No [7]_ [8]_
238+
Change return type No [7]_ [8]_
239239
**Private Methods**
240240
Add private method Yes
241241
Remove private method Yes
@@ -250,7 +250,7 @@ Remove type hint of an argument Yes
250250
Change argument type Yes
251251
Change return type Yes
252252
**Static Methods**
253-
Turn non static into static No
253+
Turn non static into static No [7]_ [8]_
254254
Turn static into non static No
255255
**Constants**
256256
Add constant Yes
@@ -277,6 +277,20 @@ Change value of a constant Yes [1]_ [5]_
277277
Additionally, if a constant will likely be used in objects that are
278278
serialized, the value of a constant should not be changed.
279279
280+
.. [6] Allowed using the ``@final`` annotation.
281+
282+
.. [7] Allowed if the class is final. Classes that received the ``@final``
283+
annotation after their first release are considered final in their
284+
next major version.
285+
Changing an argument type is only possible with a parent type.
286+
Changing a return type is only possible with a child type.
287+
288+
.. [8] Allowed if the method is final. Methods that received the ``@final``
289+
annotation after their first release are considered final in their
290+
next major version.
291+
Changing an argument type is only possible with a parent type.
292+
Changing a return type is only possible with a child type.
293+
280294
.. _Semantic Versioning: http://semver.org/
281295
.. _scalar type: http://php.net/manual/en/function.is-scalar.php
282296
.. _boolean values: http://php.net/manual/en/function.boolval.php

0 commit comments

Comments
 (0)
0