Skip to content

Add output of debug:messenger information on Messenger doc #13390

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

jpjoao
Copy link
Contributor

@jpjoao jpjoao commented Mar 21, 2020

fixes #13310 :

  • Adds code for a dummy message MyMessage to support Examples;
  • Use MyMessage on handler example so debug:messenger output makes sense;
  • Adds a quick description to what a Message can be as this was missing;

@jpjoao
Copy link
Contributor Author

jpjoao commented Mar 21, 2020

I was wondering if it makes sense to change all the examples on that page to cope with the NewOrder message that is more interesting and could be more useful for explaining the component.
I could either do it in a separated PR or refactor this one.

@javiereguiluz
Copy link
Member

@Nyholm could you please review this proposal? Thanks!

@javiereguiluz javiereguiluz added Messenger help wanted Issues and PRs which are looking for volunteers to complete them. and removed Waiting feedback labels Sep 9, 2020
@@ -68,6 +68,34 @@ Concepts
to use for transport, markers identifying a received message or any sort of
metadata your middleware or transport layer may use.

**Message**
There is no specific requirement for a message, it can be any kind of object except it
should be serializable and unserializable by a Symfony Serializer instance.
Copy link
Contributor

Choose a reason for hiding this comment

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

Actually not. Native serialization mechanism is used by default

@Nyholm
Copy link
Member

Nyholm commented Sep 10, 2020

I like the part of "Debugging the Messenger". But Im not sure the other changes are needed.

Message
-------
Message is a serializable object that holds the data that will be dispatched. It does not need
to extend a class or implement an interface.
Copy link
Contributor

Choose a reason for hiding this comment

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

interface::

And remove the next Example line please


namespace App\Message;

class MyMessage {
Copy link
Contributor

Choose a reason for hiding this comment

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

Opening bracket should be on the next line


class MyMessage {

protected $name = 'name';
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add string typehint


protected $name = 'name';

public function __construct(string $name)
Copy link
Contributor

Choose a reason for hiding this comment

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

If Name property has a default value, why is it needed to provide a name in this example?

Can we remove the default from the property?

use Symfony\Component\Mailer\MailerInterface;
use Symfony\Component\Messenger\Envelope;
use Symfony\Component\Messenger\Transport\Sender\SenderInterface;
use Symfony\Component\Mime\Email;

class ImportantActionToEmailSender implements SenderInterface
class MyMessageToEmailSender implements SenderInterface
Copy link
Contributor

Choose a reason for hiding this comment

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

I would keep the old name

@Nyholm
Copy link
Member

Nyholm commented Sep 10, 2020

@jpjoao If you split this PR into 2 PRs then we can easily merge the fix for #13310

The other changes are a bit more discussions around so it might take longer time for those changes to be merged.

@Nyholm
Copy link
Member

Nyholm commented Oct 23, 2020

Friendly ping

@wouterj wouterj added Waiting feedback and removed help wanted Issues and PRs which are looking for volunteers to complete them. labels Oct 23, 2020
@wouterj
Copy link
Member

wouterj commented Nov 18, 2020

Hi! Thank you for initiating this PR! Unfortunately, there hasn't been much activity on this PR for the past months. So I'm going to close this PR. Feel free to comment (to reopen) or open a new PR with the feedback applied.

As for #13310, I could not see the relation with this PR (the PHPdoc description is not shown). I've created #14567 to add a small tip about the feature mentioned in the issue.

@wouterj wouterj closed this Nov 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Messenger] Show message & handler(s) class description in debug:messen…
7 participants