Skip to content

Commit

Permalink
Upgrade coding standard
Browse files Browse the repository at this point in the history
  • Loading branch information
natanfelles committed Dec 23, 2023
1 parent 33f12aa commit d3a1ea8
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
},
"require-dev": {
"ext-xdebug": "*",
"aplus/coding-standard": "^1.14",
"aplus/coding-standard": "^2.0",
"ergebnis/composer-normalize": "^2.23",
"jetbrains/phpstorm-attributes": "^1.0",
"phpmd/phpmd": "^2.13",
Expand Down
4 changes: 2 additions & 2 deletions src/Debug/EmailCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ public function getActivities() : array
public function getContents() : string
{
\ob_start();
if ( ! isset($this->mailer)) {
if (!isset($this->mailer)) {
echo '<p>This collector has not been added to a Mailer instance.</p>';
return \ob_get_clean(); // @phpstan-ignore-line
}
echo $this->showHeader();
if ( ! $this->hasData()) {
if (!$this->hasData()) {
echo '<p>No messages have been sent.</p>';
return \ob_get_clean(); // @phpstan-ignore-line
}
Expand Down
8 changes: 5 additions & 3 deletions src/Mailer.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ abstract class Mailer
* @param string|null $hostname
*/
public function __construct(
#[SensitiveParameter] array | string $username,
#[SensitiveParameter] string $password = null,
#[SensitiveParameter]
array | string $username,
#[SensitiveParameter]
string $password = null,
string $host = 'localhost',
int $port = 587,
string $hostname = null
Expand Down Expand Up @@ -180,7 +182,7 @@ public function resetLogs() : static
*/
protected function addLog(string $command, string $response) : static
{
if ( ! $this->getConfig('add_logs')) {
if (!$this->getConfig('add_logs')) {
return $this;
}
$this->logs[] = [
Expand Down
2 changes: 1 addition & 1 deletion src/Mailers/SMTPMailer.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public function send(Message $message) : bool

protected function sendMessage(Message $message) : int | false
{
if ( ! $this->connect()) {
if (!$this->connect()) {
return false;
}
$message->setMailer($this);
Expand Down
8 changes: 4 additions & 4 deletions src/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public function setBoundary(string $boundary = null) : static

public function getBoundary() : string
{
if ( ! isset($this->boundary)) {
if (!isset($this->boundary)) {
$this->setBoundary();
}
return $this->boundary;
Expand Down Expand Up @@ -200,7 +200,7 @@ protected function renderHeaders() : string

protected function prepareHeaders() : void
{
if ( ! $this->getDate()) {
if (!$this->getDate()) {
$this->setDate();
}
$multipart = $this->getInlineAttachments() ? 'related' : 'mixed';
Expand Down Expand Up @@ -330,7 +330,7 @@ protected function renderAttachments() : string
$part = '';
$crlf = $this->getCrlf();
foreach ($this->getAttachments() as $attachment) {
if ( ! \is_file($attachment)) {
if (!\is_file($attachment)) {
throw new LogicException('Attachment file not found: ' . $attachment);
}
$filename = \pathinfo($attachment, \PATHINFO_BASENAME);
Expand All @@ -357,7 +357,7 @@ protected function renderInlineAttachments() : string
$part = '';
$crlf = $this->getCrlf();
foreach ($this->getInlineAttachments() as $cid => $filename) {
if ( ! \is_file($filename)) {
if (!\is_file($filename)) {
throw new LogicException('Inline attachment file not found: ' . $filename);
}
$contents = \file_get_contents($filename);
Expand Down

0 comments on commit d3a1ea8

Please sign in to comment.