Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .github/workflows/pull-request-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,13 @@ jobs:
- name: Run Composer linter
run: composer validate --strict --no-check-lock

- name: Run PHP unit test suite
run: composer run-script test

- name: Run phpstan
run: composer run-script phpstan

- name: Run lint PHP
run: composer run-script php-lint

# Tests
- name: Run PHP unit test suite
run: composer run-script test

6 changes: 5 additions & 1 deletion src/Email/MessageOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,12 @@ public function __construct(
$this->participants = $participants;
}

public function getSubject(): ?string
public function getSubject(): string
{
if (!\is_string($this->subject)) {
throw new InvalidArgumentException('Invalid subject');
}

return $this->subject;
}

Expand Down
6 changes: 5 additions & 1 deletion src/Email/Participants.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,12 @@ public function __construct(
$this->bcc = $bcc;
}

public function getSender(): ?Address
public function getSender(): Address
{
if (!$this->sender instanceof Address) {
throw new InvalidArgumentException('Invalid sender');
}

return $this->sender;
}

Expand Down
9 changes: 9 additions & 0 deletions src/Exception/ExceptionInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

declare(strict_types=1);

namespace FH\Bundle\MailerBundle\Exception;

interface ExceptionInterface
{
}
11 changes: 11 additions & 0 deletions src/Exception/InvalidArgumentException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

declare(strict_types=1);

namespace FH\Bundle\MailerBundle\Exception;

use InvalidArgumentException as InvalidArgumentExceptionAlias;

class InvalidArgumentException extends InvalidArgumentExceptionAlias implements ExceptionInterface
{
}