mirror of
https://github.com/flarum/framework.git
synced 2025-02-23 11:51:51 +08:00
Remove deprecated validation events
This commit is contained in:
parent
a68e2b27a4
commit
46248f601d
@ -9,8 +9,6 @@
|
||||
|
||||
namespace Flarum\Foundation;
|
||||
|
||||
use Flarum\Foundation\Event\Validating;
|
||||
use Illuminate\Contracts\Events\Dispatcher;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Validation\Factory;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
@ -38,11 +36,6 @@ abstract class AbstractValidator
|
||||
*/
|
||||
protected $validator;
|
||||
|
||||
/**
|
||||
* @var Dispatcher
|
||||
*/
|
||||
protected $events;
|
||||
|
||||
/**
|
||||
* @var TranslatorInterface
|
||||
*/
|
||||
@ -50,13 +43,11 @@ abstract class AbstractValidator
|
||||
|
||||
/**
|
||||
* @param Factory $validator
|
||||
* @param Dispatcher $events
|
||||
* @param TranslatorInterface $translator
|
||||
*/
|
||||
public function __construct(Factory $validator, Dispatcher $events, TranslatorInterface $translator)
|
||||
public function __construct(Factory $validator, TranslatorInterface $translator)
|
||||
{
|
||||
$this->validator = $validator;
|
||||
$this->events = $events;
|
||||
$this->translator = $translator;
|
||||
}
|
||||
|
||||
@ -102,13 +93,6 @@ abstract class AbstractValidator
|
||||
|
||||
$validator = $this->validator->make($attributes, $rules, $this->getMessages());
|
||||
|
||||
/**
|
||||
* @deprecated in beta 15, removed in beta 16.
|
||||
*/
|
||||
$this->events->dispatch(
|
||||
new Validating($this, $validator)
|
||||
);
|
||||
|
||||
foreach ($this->configuration as $callable) {
|
||||
$callable($this, $validator);
|
||||
}
|
||||
|
@ -1,42 +0,0 @@
|
||||
<?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\Foundation\Event;
|
||||
|
||||
use Flarum\Foundation\AbstractValidator;
|
||||
use Illuminate\Validation\Validator;
|
||||
|
||||
/**
|
||||
* @deprecated in Beta 15, remove in beta 16. Use the Validator extender instead.
|
||||
* The `Validating` event is called when a validator instance for a
|
||||
* model is being built. This event can be used to add custom rules/extensions
|
||||
* to the validator for when validation takes place.
|
||||
*/
|
||||
class Validating
|
||||
{
|
||||
/**
|
||||
* @var \Flarum\Foundation\AbstractValidator
|
||||
*/
|
||||
public $type;
|
||||
|
||||
/**
|
||||
* @var Validator
|
||||
*/
|
||||
public $validator;
|
||||
|
||||
/**
|
||||
* @param AbstractValidator $type
|
||||
* @param Validator $validator
|
||||
*/
|
||||
public function __construct(AbstractValidator $type, Validator $validator)
|
||||
{
|
||||
$this->type = $type;
|
||||
$this->validator = $validator;
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user