diff --git a/src/Mailer.php b/src/Mailer.php index 69653a6..c1365bd 100644 --- a/src/Mailer.php +++ b/src/Mailer.php @@ -94,6 +94,8 @@ protected function makeConfig(array $config) : array } /** + * @todo Make public in version 4.0.0 + * * @param string $key * * @return mixed @@ -103,6 +105,27 @@ protected function getConfig(string $key) : mixed return $this->config[$key]; } + /** + * @return array + */ + #[ArrayShape([ + 'host' => 'string', + 'port' => 'int', + 'tls' => 'bool', + 'username' => 'string|null', + 'password' => 'string|null', + 'charset' => 'string', + 'crlf' => 'string', + 'connection_timeout' => 'int', + 'response_timeout' => 'int', + 'hostname' => 'string', + 'keep_alive' => 'bool', + ])] + public function getConfigs() : array + { + return $this->config; + } + public function getCrlf() : string { return (string) $this->getConfig('crlf'); diff --git a/tests/Mailers/SMTPMailerTest.php b/tests/Mailers/SMTPMailerTest.php index c46d0c0..245d5c2 100644 --- a/tests/Mailers/SMTPMailerTest.php +++ b/tests/Mailers/SMTPMailerTest.php @@ -127,4 +127,11 @@ public function testLogs() : void $this->smtp->resetLogs(); self::assertEmpty($this->smtp->getLogs()); } + + public function testConfigs() : void + { + foreach ($this->smtp->getConfigs() as $key => $value) { + self::assertIsString($key); + } + } }