@@ -7,8 +7,10 @@ coding standards and conventions used in the core framework to make it more
7
7
consistent and predictable. You are encouraged to follow them in your own
8
8
code, but you don't need to.
9
9
10
- Method Names
11
- ------------
10
+ .. _method-names :
11
+
12
+ Naming a Method
13
+ ---------------
12
14
13
15
When an object has a "main" many relation with related "things"
14
16
(objects, parameters, ...), the method names are normalized:
@@ -77,19 +79,63 @@ must be used instead (where ``XXX`` is the name of the related thing):
77
79
``replaceXXX() ``, on the other hand, cannot add new elements. If an unrecognized
78
80
key is passed to ``replaceXXX() `` it must throw an exception.
79
81
82
+ Writing a CHANGELOG Entry
83
+ -------------------------
84
+
85
+ When adding a new feature in a minor version or deprecating an existing
86
+ behavior, an entry to the relevant CHANGELOG(s) should be added.
87
+
88
+ New features and deprecations must be described in a file named
89
+ ``CHANGELOG.md `` that should be at the root directory of the modified
90
+ Component, Bridge or Bundle.
91
+
92
+ The file must be written with the Markdown syntax and follow the following
93
+ conventions:
94
+
95
+ * The main title is always ``CHANGELOG ``;
96
+
97
+ * Each entry must be added to a minor version section (like ``5.3 ``) as a list
98
+ element;
99
+
100
+ * No third level sections are allowed;
101
+
102
+ * Messages should follow the commit message conventions: should be short,
103
+ capitalize the line, do not end with a period, use an imperative verb to
104
+ start the line;
105
+
106
+ * New entries must be added on top of the list.
107
+
108
+ Here is a complete example for reference:
109
+
110
+ .. code-block :: markdown
111
+
112
+ CHANGELOG
113
+ =========
114
+
115
+ 5.3
116
+ ---
117
+
118
+ * Add `MagicConfig` that allows configuring things
119
+
120
+ .. note ::
121
+
122
+ The main ``CHANGELOG-* `` files at the ``symfony/symfony `` root directory
123
+ are automatically generated when releases are prepared and should never be
124
+ modified manually.
125
+
80
126
.. _contributing-code-conventions-deprecations :
81
127
82
128
Deprecating Code
83
129
----------------
84
130
85
- From time to time, some classes and/or methods are deprecated in the
86
- framework; that happens when a feature implementation cannot be changed
87
- because of backward compatibility issues, but we still want to propose a
88
- "better" alternative. In that case, the old implementation can be **deprecated **.
131
+ From time to time, some classes and/or methods are deprecated in the framework;
132
+ that happens when a feature implementation cannot be changed because of
133
+ backward compatibility issues, but we still want to propose a "better"
134
+ alternative. In that case, the old implementation can be **deprecated **.
89
135
90
136
Deprecations must only be introduced on the next minor version of the impacted
91
- component (or bundle, or bridge, or contract).
92
- They can exceptionally be introduced on previous supported versions if they are critical.
137
+ component (or bundle, or bridge, or contract). They can exceptionally be
138
+ introduced on previous supported versions if they are critical.
93
139
94
140
A new class (or interface, or trait) cannot be introduced as deprecated, or
95
141
contain deprecated methods.
@@ -144,26 +190,28 @@ after the use declarations, like in this example from
144
190
145
191
The deprecation must be added to the ``CHANGELOG.md `` file of the impacted component::
146
192
147
- 4.4.0
148
- -----
193
+ 4.4
194
+ ---
149
195
150
- * Deprecated the `Deprecated` class, use `Replacement` instead.
196
+ * Deprecate the `Deprecated` class, use `Replacement` instead
151
197
152
198
It must also be added to the ``UPGRADE.md `` file of the targeted minor version
153
199
(``UPGRADE-4.4.md `` in our example)::
154
200
155
201
DependencyInjection
156
202
-------------------
157
203
158
- * Deprecated the `Deprecated` class, use `Replacement` instead.
204
+ * Deprecate the `Deprecated` class, use `Replacement` instead
159
205
160
206
Finally, its consequences must be added to the ``UPGRADE.md `` file of the next major version
161
- (``UPGRADE-5.0.md `` in our example)::
207
+ (``UPGRADE-5.0.md `` in our example):
208
+
209
+ .. code-block :: markdown
162
210
163
211
DependencyInjection
164
212
-------------------
165
213
166
- * Removed the `Deprecated` class, use `Replacement` instead.
214
+ * Remove the `Deprecated` class, use `Replacement` instead
167
215
168
216
All these tasks are mandatory and must be done in the same pull request.
169
217
@@ -174,12 +222,14 @@ Removing deprecated code can only be done once every 2 years, on the next major
174
222
impacted component (``master `` branch).
175
223
176
224
When removing deprecated code, the consequences of the deprecation must be added to the ``CHANGELOG.md `` file
177
- of the impacted component::
225
+ of the impacted component:
226
+
227
+ .. code-block :: markdown
178
228
179
- 5.0.0
180
- -----
229
+ 5.0
230
+ ---
181
231
182
- * Removed the `Deprecated` class, use `Replacement` instead.
232
+ * Remove the `Deprecated` class, use `Replacement` instead
183
233
184
234
This task is mandatory and must be done in the same pull request.
185
235
0 commit comments