@@ -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.
@@ -139,26 +185,28 @@ after the use declarations, like in this example from `ServiceRouterLoader`_::
139
185
140
186
The deprecation must be added to the ``CHANGELOG.md `` file of the impacted component::
141
187
142
- 4.4.0
143
- -----
188
+ 4.4
189
+ ---
144
190
145
- * Deprecated the `Deprecated` class, use `Replacement` instead.
191
+ * Deprecate the `Deprecated` class, use `Replacement` instead
146
192
147
193
It must also be added to the ``UPGRADE.md `` file of the targeted minor version
148
194
(``UPGRADE-4.4.md `` in our example)::
149
195
150
196
DependencyInjection
151
197
-------------------
152
198
153
- * Deprecated the `Deprecated` class, use `Replacement` instead.
199
+ * Deprecate the `Deprecated` class, use `Replacement` instead
154
200
155
201
Finally, its consequences must be added to the ``UPGRADE.md `` file of the next major version
156
- (``UPGRADE-5.0.md `` in our example)::
202
+ (``UPGRADE-5.0.md `` in our example):
203
+
204
+ .. code-block :: markdown
157
205
158
206
DependencyInjection
159
207
-------------------
160
208
161
- * Removed the `Deprecated` class, use `Replacement` instead.
209
+ * Remove the `Deprecated` class, use `Replacement` instead
162
210
163
211
All these tasks are mandatory and must be done in the same pull request.
164
212
@@ -169,11 +217,13 @@ Removing deprecated code can only be done once every 2 years, on the next major
169
217
impacted component (``master `` branch).
170
218
171
219
When removing deprecated code, the consequences of the deprecation must be added to the ``CHANGELOG.md `` file
172
- of the impacted component::
220
+ of the impacted component:
221
+
222
+ .. code-block :: markdown
173
223
174
- 5.0.0
175
- -----
224
+ 5.0
225
+ ---
176
226
177
- * Removed the `Deprecated` class, use `Replacement` instead.
227
+ * Remove the `Deprecated` class, use `Replacement` instead
178
228
179
229
This task is mandatory and must be done in the same pull request.
0 commit comments