mirror of
https://github.com/flarum/framework.git
synced 2024-11-25 09:41:49 +08:00
Inject Symfony translator contract, not Laravel's
The Laravel changes with v6, and our translator is primarily an implementation of the Symfony contract.
This commit is contained in:
parent
e4077ab4ad
commit
7fd23ff950
|
@ -15,10 +15,10 @@ use Flarum\Frontend\Document;
|
||||||
use Flarum\Http\UrlGenerator;
|
use Flarum\Http\UrlGenerator;
|
||||||
use Flarum\Settings\SettingsRepositoryInterface;
|
use Flarum\Settings\SettingsRepositoryInterface;
|
||||||
use Flarum\User\User;
|
use Flarum\User\User;
|
||||||
use Illuminate\Contracts\Translation\Translator;
|
|
||||||
use Illuminate\Contracts\View\Factory;
|
use Illuminate\Contracts\View\Factory;
|
||||||
use Illuminate\Support\Arr;
|
use Illuminate\Support\Arr;
|
||||||
use Psr\Http\Message\ServerRequestInterface as Request;
|
use Psr\Http\Message\ServerRequestInterface as Request;
|
||||||
|
use Symfony\Component\Translation\TranslatorInterface;
|
||||||
|
|
||||||
class Index
|
class Index
|
||||||
{
|
{
|
||||||
|
@ -42,14 +42,19 @@ class Index
|
||||||
*/
|
*/
|
||||||
protected $url;
|
protected $url;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var TranslatorInterface
|
||||||
|
*/
|
||||||
|
protected $translator;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Client $api
|
* @param Client $api
|
||||||
* @param Factory $view
|
* @param Factory $view
|
||||||
* @param SettingsRepositoryInterface $settings
|
* @param SettingsRepositoryInterface $settings
|
||||||
* @param UrlGenerator $url
|
* @param UrlGenerator $url
|
||||||
* @param Translator $translator
|
* @param TranslatorInterface $translator
|
||||||
*/
|
*/
|
||||||
public function __construct(Client $api, Factory $view, SettingsRepositoryInterface $settings, UrlGenerator $url, Translator $translator)
|
public function __construct(Client $api, Factory $view, SettingsRepositoryInterface $settings, UrlGenerator $url, TranslatorInterface $translator)
|
||||||
{
|
{
|
||||||
$this->api = $api;
|
$this->api = $api;
|
||||||
$this->view = $view;
|
$this->view = $view;
|
||||||
|
|
|
@ -14,7 +14,7 @@ use Flarum\Mail\Job\SendRawEmailJob;
|
||||||
use Flarum\Settings\SettingsRepositoryInterface;
|
use Flarum\Settings\SettingsRepositoryInterface;
|
||||||
use Flarum\User\Event\Registered;
|
use Flarum\User\Event\Registered;
|
||||||
use Illuminate\Contracts\Queue\Queue;
|
use Illuminate\Contracts\Queue\Queue;
|
||||||
use Illuminate\Contracts\Translation\Translator;
|
use Symfony\Component\Translation\TranslatorInterface;
|
||||||
|
|
||||||
class AccountActivationMailer
|
class AccountActivationMailer
|
||||||
{
|
{
|
||||||
|
@ -34,7 +34,7 @@ class AccountActivationMailer
|
||||||
protected $url;
|
protected $url;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Translator
|
* @var TranslatorInterface
|
||||||
*/
|
*/
|
||||||
protected $translator;
|
protected $translator;
|
||||||
|
|
||||||
|
@ -42,9 +42,9 @@ class AccountActivationMailer
|
||||||
* @param \Flarum\Settings\SettingsRepositoryInterface $settings
|
* @param \Flarum\Settings\SettingsRepositoryInterface $settings
|
||||||
* @param Queue $queue
|
* @param Queue $queue
|
||||||
* @param UrlGenerator $url
|
* @param UrlGenerator $url
|
||||||
* @param Translator $translator
|
* @param TranslatorInterface $translator
|
||||||
*/
|
*/
|
||||||
public function __construct(SettingsRepositoryInterface $settings, Queue $queue, UrlGenerator $url, Translator $translator)
|
public function __construct(SettingsRepositoryInterface $settings, Queue $queue, UrlGenerator $url, TranslatorInterface $translator)
|
||||||
{
|
{
|
||||||
$this->settings = $settings;
|
$this->settings = $settings;
|
||||||
$this->queue = $queue;
|
$this->queue = $queue;
|
||||||
|
|
|
@ -15,10 +15,10 @@ use Flarum\Settings\SettingsRepositoryInterface;
|
||||||
use Flarum\User\PasswordToken;
|
use Flarum\User\PasswordToken;
|
||||||
use Flarum\User\UserRepository;
|
use Flarum\User\UserRepository;
|
||||||
use Illuminate\Contracts\Queue\Queue;
|
use Illuminate\Contracts\Queue\Queue;
|
||||||
use Illuminate\Contracts\Translation\Translator;
|
|
||||||
use Illuminate\Contracts\Validation\Factory;
|
use Illuminate\Contracts\Validation\Factory;
|
||||||
use Illuminate\Database\Eloquent\ModelNotFoundException;
|
use Illuminate\Database\Eloquent\ModelNotFoundException;
|
||||||
use Illuminate\Validation\ValidationException;
|
use Illuminate\Validation\ValidationException;
|
||||||
|
use Symfony\Component\Translation\TranslatorInterface;
|
||||||
|
|
||||||
class RequestPasswordResetHandler
|
class RequestPasswordResetHandler
|
||||||
{
|
{
|
||||||
|
@ -43,7 +43,7 @@ class RequestPasswordResetHandler
|
||||||
protected $url;
|
protected $url;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Translator
|
* @var TranslatorInterface
|
||||||
*/
|
*/
|
||||||
protected $translator;
|
protected $translator;
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ class RequestPasswordResetHandler
|
||||||
* @param SettingsRepositoryInterface $settings
|
* @param SettingsRepositoryInterface $settings
|
||||||
* @param Queue $queue
|
* @param Queue $queue
|
||||||
* @param UrlGenerator $url
|
* @param UrlGenerator $url
|
||||||
* @param Translator $translator
|
* @param TranslatorInterface $translator
|
||||||
* @param Factory $validatorFactory
|
* @param Factory $validatorFactory
|
||||||
*/
|
*/
|
||||||
public function __construct(
|
public function __construct(
|
||||||
|
@ -65,7 +65,7 @@ class RequestPasswordResetHandler
|
||||||
SettingsRepositoryInterface $settings,
|
SettingsRepositoryInterface $settings,
|
||||||
Queue $queue,
|
Queue $queue,
|
||||||
UrlGenerator $url,
|
UrlGenerator $url,
|
||||||
Translator $translator,
|
TranslatorInterface $translator,
|
||||||
Factory $validatorFactory
|
Factory $validatorFactory
|
||||||
) {
|
) {
|
||||||
$this->users = $users;
|
$this->users = $users;
|
||||||
|
|
|
@ -14,7 +14,7 @@ use Flarum\Mail\Job\SendRawEmailJob;
|
||||||
use Flarum\Settings\SettingsRepositoryInterface;
|
use Flarum\Settings\SettingsRepositoryInterface;
|
||||||
use Flarum\User\Event\EmailChangeRequested;
|
use Flarum\User\Event\EmailChangeRequested;
|
||||||
use Illuminate\Contracts\Queue\Queue;
|
use Illuminate\Contracts\Queue\Queue;
|
||||||
use Illuminate\Contracts\Translation\Translator;
|
use Symfony\Component\Translation\TranslatorInterface;
|
||||||
|
|
||||||
class EmailConfirmationMailer
|
class EmailConfirmationMailer
|
||||||
{
|
{
|
||||||
|
@ -34,11 +34,11 @@ class EmailConfirmationMailer
|
||||||
protected $url;
|
protected $url;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Translator
|
* @var TranslatorInterface
|
||||||
*/
|
*/
|
||||||
protected $translator;
|
protected $translator;
|
||||||
|
|
||||||
public function __construct(SettingsRepositoryInterface $settings, Queue $queue, UrlGenerator $url, Translator $translator)
|
public function __construct(SettingsRepositoryInterface $settings, Queue $queue, UrlGenerator $url, TranslatorInterface $translator)
|
||||||
{
|
{
|
||||||
$this->settings = $settings;
|
$this->settings = $settings;
|
||||||
$this->queue = $queue;
|
$this->queue = $queue;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user