remove usage of getenv from codebase (#1861)

This commit is contained in:
Kevin Papst
2020-08-02 01:02:04 +02:00
committed by GitHub
parent 6f8c0e3cb6
commit 476e6ca150
14 changed files with 122 additions and 123 deletions

View File

@@ -11,14 +11,22 @@ namespace App\Configuration;
class MailConfiguration
{
/**
* @var string
*/
private $mailFrom;
public function __construct(string $mailFrom)
{
$this->mailFrom = $mailFrom;
}
public function getFromAddress(): ?string
{
$from = getenv('MAILER_FROM');
if ($from === false || empty($from)) {
if (empty($this->mailFrom)) {
return null;
}
return $from;
return $this->mailFrom;
}
}