Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Commit fffce87

Browse files
authored
Merge pull request #3143 from neeta-wagento/patch-37
Update index.md
2 parents cb1e546 + 41ae670 commit fffce87

File tree

1 file changed

+14
-0
lines changed
  • guides/v2.1/contributor-guide/backward-compatible-development

1 file changed

+14
-0
lines changed

guides/v2.1/contributor-guide/backward-compatible-development/index.md

+14
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,20 @@ Do not remove or rename {% glossarytooltip c57aef7c-97b4-4b2b-a999-8001accef1fe
189189
Do not change argument types.
190190
Instead of changing argument name or type, introduce new event argument with new name or type and deprecate the old argument by adding `@deprecated` annotation before dispatching the event.
191191

192+
Example code:
193+
194+
```php?start_inline=1
195+
$transportObject = new DataObject($transport);
196+
197+
/**
198+
* Event argument `transport` is @deprecated. Use `transport_object` instead.
199+
*/
200+
$this->eventManager->dispatch(
201+
'email_invoice_set_template_vars_before',
202+
['sender' => $this, 'transport' => $transportObject->getData(), 'transport_object' => $transportObject]
203+
);
204+
```
205+
192206
### JS
193207

194208
The following is a list of prohibited JS code changes:

0 commit comments

Comments
 (0)