-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,8 +23,19 @@ | |
*/ | ||
final class HandledStamp implements StampInterface | ||
{ | ||
/** | ||
* @var mixed | ||
*/ | ||
private $result; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
private $callableName; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
private $handlerAlias; | ||
|
||
/** | ||
|
@@ -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 | ||
{ | ||
|
@@ -77,11 +94,17 @@ public function getResult() | |
return $this->result; | ||
} | ||
|
||
/** | ||
* @return string | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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; | ||
|
There was a problem hiding this comment.
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.