Skip to content

Commit 0e925cb

Browse files
committed
Added tables with safe operations
1 parent 79ca9f7 commit 0e925cb

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

contributing/code/bc.rst

+52
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,30 @@ means that:
4646
* You can safely implement the interface.
4747

4848

49+
Safe Operations
50+
~~~~~~~~~~~~~~~
51+
52+
The following table summarizes the safe operations when using our interfaces:
53+
54+
============================================== ============== ==============
55+
Operation Normal API
56+
============================================== ============== ==============
57+
Type hint against Safe Safe
58+
Use method Safe Safe
59+
**When Implementing**
60+
Implement method Not Safe Safe
61+
Add custom method Not Safe Not Safe
62+
Add custom method parameter Not Safe Not Safe
63+
Add parameter default value Safe Safe
64+
============================================== ============== ==============
65+
66+
4967
Allowed Changes
5068
~~~~~~~~~~~~~~~
5169

70+
This table tells you which changes you are allowed to do when working on
71+
Symfony code:
72+
5273
============================================== ============== ==============
5374
Type of Change Normal API
5475
============================================== ============== ==============
@@ -79,6 +100,8 @@ Normal Classes
79100

80101
All classes in the ``Symfony`` namespace are **safe for use**. That means that:
81102

103+
* You can safely type hint against the class' name.
104+
82105
* You can safely create new instances.
83106

84107
* You can safely extend the class.
@@ -123,9 +146,38 @@ that:
123146
* You can safely override public or protected methods.
124147

125148

149+
Safe Operations
150+
~~~~~~~~~~~~~~~
151+
152+
The following table summarizes the safe operations when using our classes:
153+
154+
============================================== ============== ==============
155+
Operation Normal API
156+
============================================== ============== ==============
157+
Type hint against Safe Safe
158+
Create instance Safe Safe
159+
Extend Safe Safe
160+
Use public property Safe Safe
161+
Use protected property Not Safe Safe
162+
Use public method Safe Safe
163+
Use protected method Not Safe Safe
164+
**When Extending**
165+
Override public property Safe Safe
166+
Override protected property Not Safe Safe
167+
Override public method Not Safe Safe
168+
Override protected method Not Safe Safe
169+
Add custom method Not Safe Not Safe
170+
Add custom method parameter Not Safe Not Safe
171+
Add parameter default value Safe Safe
172+
============================================== ============== ==============
173+
174+
126175
Allowed Changes
127176
~~~~~~~~~~~~~~~
128177

178+
This table tells you which changes you are allowed to do when working on
179+
Symfony code:
180+
129181
================================================== ============== ==============
130182
Type of Change Normal API
131183
================================================== ============== ==============

0 commit comments

Comments
 (0)