Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[HackDay][Messanger]Improve PHP DocBlock for Messanger Stamps #29529

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
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion 25 src/Symfony/Component/Messenger/Stamp/HandledStamp.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,19 @@
*/
final class HandledStamp implements StampInterface
{
/**
* @var mixed
*/
private $result;

/**
* @var string
Copy link
Member

Choose a reason for hiding this comment

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

We don't add @var phpdoc on properties in Symfony, especially when the constructor allows IDEs to infer it already.

*/
private $callableName;

/**
* @var string
*/
private $handlerAlias;

/**
Expand All @@ -38,7 +49,13 @@ public function __construct($result, string $callableName, string $handlerAlias
}

/**
* @param mixed $result The returned value of the message handler
* @param callable $handler
* @param mixed $result The returned value of the message handler
* @param string|null $handlerAlias
*
* @return HandledStamp
*
* @throws \ReflectionException
*/
public static function fromCallable(callable $handler, $result, string $handlerAlias = null): self
{
Expand Down Expand Up @@ -77,11 +94,17 @@ public function getResult()
return $this->result;
}

/**
* @return string
Copy link
Member

Choose a reason for hiding this comment

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

Please remove this phpdoc. We don't add it when it provides no value compared to the signature. Here, it only duplicates the return type.

Copy link
Member

Choose a reason for hiding this comment

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

actually, this applies to most places changed in that PR.

*/
public function getCallableName(): string
{
return $this->callableName;
}

/**
* @return string|null
*/
public function getHandlerAlias(): ?string
{
return $this->handlerAlias;
Expand Down
23 changes: 23 additions & 0 deletions 23 src/Symfony/Component/Messenger/Stamp/SentStamp.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,43 @@
*/
final class SentStamp implements StampInterface
{
/**
* @var string
*/
private $senderClass;

/**
* @var string|null
*/
private $senderAlias;

/**
* SentStamp constructor.
*
* @param string $senderClass
* @param string|null $senderAlias
*/
public function __construct(string $senderClass, string $senderAlias = null)
{
$this->senderAlias = $senderAlias;
$this->senderClass = $senderClass;
}

/**
* Returns sender class.
*
* @return string
*/
public function getSenderClass(): string
{
return $this->senderClass;
}

/**
* Returns sender alias.
*
* @return string|null
*/
public function getSenderAlias(): ?string
{
return $this->senderAlias;
Expand Down
11 changes: 11 additions & 0 deletions 11 src/Symfony/Component/Messenger/Stamp/SerializerStamp.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,24 @@
*/
final class SerializerStamp implements StampInterface
{
/**
* @var array
*/
private $context;

/**
* SerializerStamp constructor.
*
* @param array $context
*/
public function __construct(array $context)
{
$this->context = $context;
}

/**
* @return array
*/
public function getContext(): array
{
return $this->context;
Expand Down
8 changes: 8 additions & 0 deletions 8 src/Symfony/Component/Messenger/Stamp/ValidationStamp.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,24 @@
*/
final class ValidationStamp implements StampInterface
{
/**
* @var string[]|GroupSequence
*/
private $groups;

/**
* ValidationStamp constructor.
*
* @param string[]|GroupSequence $groups
*/
public function __construct($groups)
{
$this->groups = $groups;
}

/**
* @return string[]|GroupSequence
*/
public function getGroups()
{
return $this->groups;
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.