Skip to content
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

Merged
merged 4 commits into from
Jan 30, 2023
Merged

Return $this instead of void #213

merged 4 commits into from
Jan 30, 2023

Conversation

phpfui
Copy link
Contributor

@phpfui 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;

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
/**

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

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
*/

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

@zbateson zbateson merged commit 7fe46a4 into zbateson:master Jan 30, 2023
@phpfui phpfui deleted the ReturnStatic branch July 10, 2023 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants