mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-07 20:08:53 +00:00
[ticket/17490] Add type hints to enforce some types
PHPBB-17490
This commit is contained in:
parent
930c87e97a
commit
91c325174f
2 changed files with 11 additions and 12 deletions
|
@ -15,6 +15,7 @@ namespace phpbb\messenger\method;
|
|||
|
||||
use Symfony\Component\Mailer\Transport;
|
||||
use Symfony\Component\Mailer\Mailer;
|
||||
use Symfony\Component\Mailer\Transport\AbstractTransport;
|
||||
use Symfony\Component\Mailer\Transport\TransportInterface;
|
||||
use Symfony\Component\Mime\Address;
|
||||
use Symfony\Component\Mime\Email as symfony_email;
|
||||
|
@ -39,16 +40,16 @@ class email extends base
|
|||
*
|
||||
* Symfony Mailer transport DSN
|
||||
*/
|
||||
protected $dsn = '';
|
||||
protected string $dsn = '';
|
||||
|
||||
/** @var symfony_email */
|
||||
protected $email;
|
||||
protected symfony_email $email;
|
||||
|
||||
/** @var Address From address */
|
||||
protected $from;
|
||||
protected Address $from;
|
||||
|
||||
/** @var Headers Email headers */
|
||||
protected $headers;
|
||||
protected Headers $headers;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
|
@ -60,16 +61,16 @@ class email extends base
|
|||
* symfony_email::PRIORITY_LOW
|
||||
* symfony_email::PRIORITY_LOWEST
|
||||
*/
|
||||
protected $mail_priority = symfony_email::PRIORITY_NORMAL;
|
||||
protected int $mail_priority = symfony_email::PRIORITY_NORMAL;
|
||||
|
||||
/** @var \phpbb\messenger\queue */
|
||||
protected $queue;
|
||||
|
||||
/** @var Address */
|
||||
protected $reply_to;
|
||||
protected Address $reply_to;
|
||||
|
||||
/** @var \Symfony\Component\Mailer\Transport\AbstractTransport */
|
||||
protected $transport;
|
||||
/** @var AbstractTransport */
|
||||
protected AbstractTransport $transport;
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
|
@ -454,9 +455,9 @@ class email extends base
|
|||
/**
|
||||
* Get mailer transport object
|
||||
*
|
||||
* @return ?TransportInterface Symfony Mailer transport object
|
||||
* @return TransportInterface Symfony Mailer transport object
|
||||
*/
|
||||
public function get_transport(): ?TransportInterface
|
||||
public function get_transport(): TransportInterface
|
||||
{
|
||||
return $this->transport;
|
||||
}
|
||||
|
|
|
@ -139,7 +139,6 @@ class phpbb_messenger_method_email_test extends \phpbb_test_case
|
|||
|
||||
public function test_set_transport()
|
||||
{
|
||||
$this->assertNull($this->method_email->get_transport());
|
||||
$this->assertEmpty($this->method_email->get_dsn());
|
||||
|
||||
$config_values = [
|
||||
|
@ -179,7 +178,6 @@ class phpbb_messenger_method_email_test extends \phpbb_test_case
|
|||
$this->config->set('email_package_size', 100);
|
||||
$email_reflection = new \ReflectionClass($this->method_email);
|
||||
$email_property = $email_reflection->getProperty('email');
|
||||
$this->assertNull($email_property->getValue($this->method_email));
|
||||
|
||||
$use_queue_property = $email_reflection->getProperty('use_queue');
|
||||
$this->assertFalse($use_queue_property->getValue($this->method_email));
|
||||
|
|
Loading…
Add table
Reference in a new issue