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

Update index.md #3143

Merged
merged 4 commits into from
Nov 6, 2018
Merged

Update index.md #3143

merged 4 commits into from
Nov 6, 2018

Conversation

neeta-wagento
Copy link
Contributor

@neeta-wagento neeta-wagento commented Oct 20, 2018

This PR is a:

  • Content update

Summary

Add example code to remove event as an event cannot be removed, add a comment near old one that it is deprecated and add one more event dispatching, with corrected name.

Additional information

List all affected URLs

@jeff-matthews jeff-matthews added the Technical Updates to the code or processes that alter the technical content of the doc label Oct 22, 2018
@neeta-wagento
Copy link
Contributor Author

neeta-wagento commented Oct 31, 2018

Hello @jeff-matthews !

Is there any update on this PR ?

Thank you!

@jeff-matthews
Copy link
Contributor

Hi @neeta-wagento! Yes, we'll work on this today.

@dshevtsov, please work with @neeta-wagento to merge this PR so she can get credit for Squashtoberfest.

@dshevtsov dshevtsov requested a review from buskamuza October 31, 2018 16:13
@dshevtsov
Copy link
Collaborator

dshevtsov commented Oct 31, 2018

It requires a tech review.
@buskamuza please review whether the contributed code example mets our current policy of backward compatibility.

@@ -189,6 +189,21 @@ Do not remove or rename {% glossarytooltip c57aef7c-97b4-4b2b-a999-8001accef1fe
Do not change argument types.
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.


{% collapsible Example Code %} {% highlight php startinline %} /**
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{% collapsible Example Code %} {% highlight php startinline %} /**
Example:
```php?start_inline=1
/**

@dshevtsov dshevtsov added 2.1.x 2.2.x 2.3.x Magento 2.3 related changes labels Oct 31, 2018
$transportObject = new DataObject($transport);

/**
* Event argument `transport` is @deprecated. Use `transportObject` instead.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure it makes sense to use backticks in the comments, they have no meaning in PhpStorm.

Copy link
Collaborator

@dshevtsov dshevtsov Oct 31, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The DevDocs team plans to implement a documentation generator for PHP API Reference that supports Markdown in the nearest future.


$transportObject = new DataObject($transport);

/**
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to move this section to the left to align with the line above?

*/
$this->eventManager->dispatch(
'email_invoice_set_template_vars_before',
['sender' => $this, 'transport' => $transportObject->getData(), 'transportObject' => $transportObject]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest to use underscore for parameter names this is seem to be the convention used in most places.

Copy link
Collaborator

@dshevtsov dshevtsov Nov 1, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@melnikovi please clarify what do you mean by term parameter. I didn't find this convention in our coding standards. Let me know if we should add one.

FYI Consider to use the Insert a suggestion feature on GitHub (<cmd-g>) to commit your suggested change.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Array indexes (transport, transportObject). We can add it as a suggestion

dshevtsov and others added 2 commits November 1, 2018 09:04
…index.md

Co-Authored-By: neeta-wagento <neeta@wagento.com>
…index.md

Co-Authored-By: neeta-wagento <neeta@wagento.com>
@dshevtsov dshevtsov added the Waiting for Response Waiting for response from internal/external parties label Nov 1, 2018

$transportObject = new DataObject($transport);

/**
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/**
/**

$transportObject = new DataObject($transport);

/**
* Event argument `transport` is @deprecated. Use `transportObject` instead.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Event argument `transport` is @deprecated. Use `transportObject` instead.
* Event argument `transport` is @deprecated. Use `transportObject` instead.


/**
* Event argument `transport` is @deprecated. Use `transportObject` instead.
*/
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
*/
*/

*/
$this->eventManager->dispatch(
'email_invoice_set_template_vars_before',
['sender' => $this, 'transport' => $transportObject->getData(), 'transportObject' => $transportObject]
Copy link
Collaborator

@dshevtsov dshevtsov Nov 1, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@melnikovi please clarify what do you mean by term parameter. I didn't find this convention in our coding standards. Let me know if we should add one.

FYI Consider to use the Insert a suggestion feature on GitHub (<cmd-g>) to commit your suggested change.

/**
* Event argument `transport` is @deprecated. Use `transportObject` instead.
*/
$this->eventManager->dispatch(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$this->eventManager->dispatch(
$this->eventManager->dispatch(

* Event argument `transport` is @deprecated. Use `transportObject` instead.
*/
$this->eventManager->dispatch(
'email_invoice_set_template_vars_before',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'email_invoice_set_template_vars_before',
'email_invoice_set_template_vars_before',

*/
$this->eventManager->dispatch(
'email_invoice_set_template_vars_before',
['sender' => $this, 'transport' => $transportObject->getData(), 'transportObject' => $transportObject]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
['sender' => $this, 'transport' => $transportObject->getData(), 'transportObject' => $transportObject]
['sender' => $this, 'transport' => $transportObject->getData(), 'transport_object' => $transportObject]

$this->eventManager->dispatch(
'email_invoice_set_template_vars_before',
['sender' => $this, 'transport' => $transportObject->getData(), 'transportObject' => $transportObject]
);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
);
);

@dshevtsov
Copy link
Collaborator

@neeta-wagento please review and apply the suggested changes

@dshevtsov dshevtsov merged commit fffce87 into magento:master Nov 6, 2018
@dshevtsov dshevtsov removed the Waiting for Response Waiting for response from internal/external parties label Nov 6, 2018
magento-devops-reposync-svc pushed a commit that referenced this pull request Sep 15, 2022
[DATA-4181] Added role to ProductViewPrice
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
2.1.x 2.2.x 2.3.x Magento 2.3 related changes Technical Updates to the code or processes that alter the technical content of the doc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants