@@ -7,8 +7,10 @@ coding standards and conventions used in the core framework to make it more
77consistent and predictable. You are encouraged to follow them in your own
88code, but you don't need to.
99
10- Method Names
11- ------------
10+ .. _method-names :
11+
12+ Naming a Method
13+ ---------------
1214
1315When an object has a "main" many relation with related "things"
1416(objects, parameters, ...), the method names are normalized:
@@ -77,19 +79,63 @@ must be used instead (where ``XXX`` is the name of the related thing):
7779 ``replaceXXX() ``, on the other hand, cannot add new elements. If an unrecognized
7880 key is passed to ``replaceXXX() `` it must throw an exception.
7981
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+
80126.. _contributing-code-conventions-deprecations :
81127
82128Deprecating Code
83129----------------
84130
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 **.
89135
90136Deprecations 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.
93139
94140A new class (or interface, or trait) cannot be introduced as deprecated, or
95141contain deprecated methods.
@@ -144,26 +190,28 @@ after the use declarations, like in this example from
144190
145191The deprecation must be added to the ``CHANGELOG.md `` file of the impacted component::
146192
147- 4.4.0
148- -----
193+ 4.4
194+ ---
149195
150- * Deprecated the `Deprecated` class, use `Replacement` instead.
196+ * Deprecate the `Deprecated` class, use `Replacement` instead
151197
152198It must also be added to the ``UPGRADE.md `` file of the targeted minor version
153199(``UPGRADE-4.4.md `` in our example)::
154200
155201 DependencyInjection
156202 -------------------
157203
158- * Deprecated the `Deprecated` class, use `Replacement` instead.
204+ * Deprecate the `Deprecated` class, use `Replacement` instead
159205
160206Finally, 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
162210
163211 DependencyInjection
164212 -------------------
165213
166- * Removed the `Deprecated` class, use `Replacement` instead.
214+ * Remove the `Deprecated` class, use `Replacement` instead
167215
168216 All these tasks are mandatory and must be done in the same pull request.
169217
@@ -174,12 +222,14 @@ Removing deprecated code can only be done once every 2 years, on the next major
174222impacted component (``master `` branch).
175223
176224When 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
178228
179- 5.0.0
180- -----
229+ 5.0
230+ ---
181231
182- * Removed the `Deprecated` class, use `Replacement` instead.
232+ * Remove the `Deprecated` class, use `Replacement` instead
183233
184234 This task is mandatory and must be done in the same pull request.
185235
0 commit comments