mirror of
https://github.com/flarum/core.git
synced 2025-10-11 23:14:29 +02:00
51 lines
1.1 KiB
PHP
51 lines
1.1 KiB
PHP
<?php
|
|
|
|
/*
|
|
* This file is part of Flarum.
|
|
*
|
|
* For detailed copyright and license information, please view the
|
|
* LICENSE file that was distributed with this source code.
|
|
*/
|
|
|
|
namespace Flarum\Mail;
|
|
|
|
use Flarum\Settings\SettingsRepositoryInterface;
|
|
use Illuminate\Contracts\Validation\Factory;
|
|
use Illuminate\Mail\Transport\LogTransport;
|
|
use Illuminate\Support\MessageBag;
|
|
use Psr\Log\LoggerInterface;
|
|
use Swift_Transport;
|
|
|
|
class LogDriver implements DriverInterface
|
|
{
|
|
/**
|
|
* @var LoggerInterface
|
|
*/
|
|
private $logger;
|
|
|
|
public function __construct(LoggerInterface $logger)
|
|
{
|
|
$this->logger = $logger;
|
|
}
|
|
|
|
public function availableSettings(): array
|
|
{
|
|
return [];
|
|
}
|
|
|
|
public function validate(SettingsRepositoryInterface $settings, Factory $validator): MessageBag
|
|
{
|
|
return new MessageBag;
|
|
}
|
|
|
|
public function canSend(): bool
|
|
{
|
|
return false;
|
|
}
|
|
|
|
public function buildTransport(SettingsRepositoryInterface $settings): Swift_Transport
|
|
{
|
|
return new LogTransport($this->logger);
|
|
}
|
|
}
|