You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* 3.4:
Add in the DOW crawler documentation code sample to show how to tick checkboxes
Adds the most basic informations about loaders
[symfony#12075] fix some casing
[Contributing] Add more information on deprecations
Copy file name to clipboardExpand all lines: components/config/resources.rst
+2
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,8 @@ Loading Resources
10
10
:phpfunction:`parse_ini_file` function. Therefore, you can only set
11
11
parameters to string values. To set parameters to other data types
12
12
(e.g. boolean, integer, etc), the other loaders are recommended.
13
+
14
+
Loaders populate the application's configuration from different sources like YAML files. The Config component defines the interface for such loaders. The :doc:`Dependency Injection </components/dependency_injection>` and :doc:`Routing </components/routing>` components come with specialized loaders for different file formats.
Copy file name to clipboardExpand all lines: contributing/code/conventions.rst
+74-19
Original file line number
Diff line number
Diff line change
@@ -79,30 +79,46 @@ must be used instead (where ``XXX`` is the name of the related thing):
79
79
80
80
.. _contributing-code-conventions-deprecations:
81
81
82
-
Deprecations
83
-
------------
82
+
Deprecating Code
83
+
----------------
84
84
85
85
From time to time, some classes and/or methods are deprecated in the
86
86
framework; that happens when a feature implementation cannot be changed
87
87
because of backward compatibility issues, but we still want to propose a
88
88
"better" alternative. In that case, the old implementation can be **deprecated**.
89
89
90
+
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.
93
+
94
+
A new class (or interface, or trait) cannot be introduced as deprecated, or
95
+
contain deprecated methods.
96
+
97
+
A new method cannot be introduced as deprecated.
98
+
90
99
A feature is marked as deprecated by adding a ``@deprecated`` phpdoc to
91
100
relevant classes, methods, properties, ...::
92
101
93
102
/**
94
-
* @deprecated since vendor-name/package-name 2.8, to be removed in 3.0. Use XXX instead.
103
+
* @deprecated since Symfony 2.8.
104
+
*/
105
+
106
+
The deprecation message must indicate the version in which the feature was deprecated,
107
+
and whenever possible, how it was replaced::
108
+
109
+
/**
110
+
* @deprecated since Symfony 2.8, use Replacement instead.
95
111
*/
96
112
97
-
The deprecation message should indicate the version when the class/method was
98
-
deprecated, the version when it will be removed, and whenever possible, how
99
-
the feature was replaced.
113
+
When the replacement is in another namespace than the deprecated class, its FQCN must be used::
114
+
115
+
/**
116
+
* @deprecated since Symfony 2.8, use A\B\Replacement instead.
117
+
*/
100
118
101
-
A PHP ``E_USER_DEPRECATED`` error must also be triggered to help people with
102
-
the migration starting one or two minor versions before the version where the
103
-
feature will be removed (depending on the criticality of the removal)::
119
+
A PHP ``E_USER_DEPRECATED`` error must also be triggered to help people with the migration::
104
120
105
-
@trigger_error('XXX() is deprecated since vendor-name/package-name 2.8 and will be removed in 3.0. Use XXX instead.', E_USER_DEPRECATED);
121
+
@trigger_error(sprintf('The "%s" class is deprecated since Symfony 2.8, use "%s" instead.', Deprecated::class, Replacement::class), E_USER_DEPRECATED);
106
122
107
123
Without the `@-silencing operator`_, users would need to opt-out from deprecation
108
124
notices. Silencing swaps this behavior and allows users to opt-in when they are
@@ -113,19 +129,58 @@ the Web Debug Toolbar or by the PHPUnit bridge).
113
129
114
130
When deprecating a whole class the ``trigger_error()`` call should be placed
115
131
between the namespace and the use declarations, like in this example from
@trigger_error('The '.__NAMESPACE__.'\ArrayParserCache class is deprecated since version 3.2 and will be removed in 4.0. Use the Symfony\Component\Cache\Adapter\ArrayAdapter class instead.', E_USER_DEPRECATED);
136
+
use Symfony\Component\Routing\Loader\ContainerLoader;
121
137
122
-
use Symfony\Component\ExpressionLanguage\ParsedExpression;
138
+
@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.4, use "%s" instead.', ServiceRouterLoader::class, ContainerLoader::class), E_USER_DEPRECATED);
0 commit comments