chore: cleanup, add PHPStan type annotations
This commit is contained in:
@@ -14,6 +14,9 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class Mailer
|
||||
{
|
||||
/**
|
||||
* @param array<string, mixed> $defaults
|
||||
*/
|
||||
public function __construct(
|
||||
private readonly MailerInterface $mailer,
|
||||
private readonly BodyRendererInterface $bodyRenderer,
|
||||
@@ -22,6 +25,10 @@ class Mailer
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $context
|
||||
* @param array<string, mixed> $options
|
||||
*/
|
||||
public function createAndSendEmail(array $context, array $options): void
|
||||
{
|
||||
$config = $this->resolveConfig($options);
|
||||
@@ -35,6 +42,10 @@ class Mailer
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $context
|
||||
* @param array<string, mixed> $config
|
||||
*/
|
||||
public function create(array $context, array $config): TemplatedEmail
|
||||
{
|
||||
$email = (new TemplatedEmail())
|
||||
@@ -73,6 +84,10 @@ class Mailer
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $options
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
private function resolveConfig(array $options): array
|
||||
{
|
||||
$resolver = new OptionsResolver();
|
||||
|
||||
Reference in New Issue
Block a user