-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Fix @return statements to use $this or static when relevant #21054
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 |
---|---|---|
|
@@ -42,7 +42,7 @@ public function __construct(Scope $parent = null) | |
/** | ||
* Opens a new child scope. | ||
* | ||
* @return Scope | ||
* @return self | ||
*/ | ||
public function enter() | ||
{ | ||
|
@@ -52,7 +52,7 @@ public function enter() | |
/** | ||
* Closes current scope and returns parent one. | ||
* | ||
* @return Scope|null | ||
* @return self|null | ||
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. I'm not sure we should prefer using 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.
Personally, i prefer it... so while we're at it 👍 for doing this as well. 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.
I don't 😆 I just don't understand the motivations behind, and there are many places where this was not applied ( 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. Avoid duplicating terms. But you're right, if not done consistently it's not really worth it anyway. 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. I will keep |
||
*/ | ||
public function leave() | ||
{ | ||
|
@@ -67,7 +67,7 @@ public function leave() | |
* @param string $key | ||
* @param mixed $value | ||
* | ||
* @return Scope Current scope | ||
* @return $this | ||
* | ||
* @throws \LogicException | ||
*/ | ||
|
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.
This seems to be inconsistent with a lot of changes below.. where it goes to
static
fornew self
.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.
If
new self
is used, it should beself
anyway.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.
Agree.