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
feature #4182 Add the possibility to deprecate attributes and nodes on Node (fabpot)
This PR was merged into the 3.x branch.
Discussion
----------
Add the possibility to deprecate attributes and nodes on Node
Commits
-------
18894cf Add the possibility to deprecate attributes and nodes on Node
if ($triggerDeprecation && isset($this->attributeNameDeprecations[$name])) {
118
+
$dep = $this->attributeNameDeprecations[$name];
119
+
if ($dep->getNewName()) {
120
+
trigger_deprecation($dep->getPackage(), $dep->getVersion(), 'Getting attribute "%s" on a "%s" class is deprecated, get the "%s" attribute instead.', $name, static::class, $dep->getNewName());
121
+
} else {
122
+
trigger_deprecation($dep->getPackage(), $dep->getVersion(), 'Getting attribute "%s" on a "%s" class is deprecated.', $name, static::class);
if ($triggerDeprecation && isset($this->attributeNameDeprecations[$name])) {
133
+
$dep = $this->attributeNameDeprecations[$name];
134
+
if ($dep->getNewName()) {
135
+
trigger_deprecation($dep->getPackage(), $dep->getVersion(), 'Setting attribute "%s" on a "%s" class is deprecated, set the "%s" attribute instead.', $name, static::class, $dep->getNewName());
136
+
} else {
137
+
trigger_deprecation($dep->getPackage(), $dep->getVersion(), 'Setting attribute "%s" on a "%s" class is deprecated.', $name, static::class);
if ($triggerDeprecation && isset($this->nodeNameDeprecations[$name])) {
167
+
$dep = $this->nodeNameDeprecations[$name];
168
+
if ($dep->getNewName()) {
169
+
trigger_deprecation($dep->getPackage(), $dep->getVersion(), 'Getting node "%s" on a "%s" class is deprecated, get the "%s" node instead.', $name, static::class, $dep->getNewName());
170
+
} else {
171
+
trigger_deprecation($dep->getPackage(), $dep->getVersion(), 'Getting node "%s" on a "%s" class is deprecated.', $name, static::class);
if ($triggerDeprecation && isset($this->nodeNameDeprecations[$name])) {
182
+
$dep = $this->nodeNameDeprecations[$name];
183
+
if ($dep->getNewName()) {
184
+
trigger_deprecation($dep->getPackage(), $dep->getVersion(), 'Setting node "%s" on a "%s" class is deprecated, set the "%s" node instead.', $name, static::class, $dep->getNewName());
185
+
} else {
186
+
trigger_deprecation($dep->getPackage(), $dep->getVersion(), 'Setting node "%s" on a "%s" class is deprecated.', $name, static::class);
187
+
}
188
+
}
189
+
141
190
if (null !== $this->sourceContext) {
142
191
$node->setSourceContext($this->sourceContext);
143
192
}
@@ -149,6 +198,11 @@ public function removeNode(string $name): void
0 commit comments