-
-
Notifications
You must be signed in to change notification settings - Fork 58
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
Return $this instead of void #213
Conversation
phpfui
commented
Jan 16, 2023
- Added return $this; to all methods that did not return anything.
- Added return type of self for most methods. Only PHP 7.4 and higher support a return type of static, which is technically better.
- Removed return type of void on proxies and other class hierarchies that are not supported by PHP 7.1, but they still return $this.
{ | ||
if ($isStartToken) { | ||
$tokens->next(); | ||
} elseif ($tokens->valid() && !$this->isEndToken($tokens->current())) { | ||
foreach ($this->getSubConsumers() as $consumer) { | ||
if ($consumer->isStartToken($tokens->current())) { | ||
return; | ||
return $this; |
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.
Line indented incorrectly; expected at least 20 spaces, found 18
src/Message.php
Outdated
@@ -250,7 +255,10 @@ public function getAttachmentCount() : int | |||
return \count($this->getAllAttachmentParts()); | |||
} | |||
|
|||
public function addAttachmentPart($resource, string $mimeType, ?string $filename = null, string $disposition = 'attachment', string $encoding = 'base64') : void | |||
/** |
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.
Spaces must be used to indent lines; tabs are not allowed
src/Message.php
Outdated
@@ -250,7 +255,10 @@ public function getAttachmentCount() : int | |||
return \count($this->getAllAttachmentParts()); | |||
} | |||
|
|||
public function addAttachmentPart($resource, string $mimeType, ?string $filename = null, string $disposition = 'attachment', string $encoding = 'base64') : void | |||
/** | |||
* @return static |
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.
Spaces must be used to indent lines; tabs are not allowed
src/Message.php
Outdated
public function addAttachmentPart($resource, string $mimeType, ?string $filename = null, string $disposition = 'attachment', string $encoding = 'base64') : void | ||
/** | ||
* @return static | ||
*/ |
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.
Spaces must be used to indent lines; tabs are not allowed