1
0
mirror of https://github.com/flarum/core.git synced 2025-10-27 05:31:29 +01:00

Remove deprecated code from beta 16 (#2705)

This commit is contained in:
Alexander Skvortsov
2021-03-19 14:13:50 -04:00
committed by GitHub
parent 374189d48e
commit 908d087e00
40 changed files with 59 additions and 689 deletions

View File

@@ -1,38 +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\User\Event;
use Flarum\User\User;
/**
* @deprecated beta 16, remove in beta 17. Use Auth extender instead.
*/
class CheckingPassword
{
/**
* @var User
*/
public $user;
/**
* @var string
*/
public $password;
/**
* @param User $user
* @param string $password
*/
public function __construct($user, $password)
{
$this->user = $user;
$this->password = $password;
}
}

View File

@@ -1,39 +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\User\Event;
use Flarum\Query\QueryCriteria;
use Flarum\Search\SearchState;
/**
* @deprecated beta 16, remove beta 17
*/
class Searching
{
/**
* @var \Flarum\User\Search\SearchState
*/
public $search;
/**
* @var QueryCriteria
*/
public $criteria;
/**
* @param SearchState $search
* @param QueryCriteria $criteria
*/
public function __construct(SearchState $search, QueryCriteria $criteria)
{
$this->search = $search;
$this->criteria = $criteria;
}
}

View File

@@ -9,11 +9,8 @@
namespace Flarum\User\Search;
use Flarum\Query\QueryCriteria;
use Flarum\Search\AbstractSearcher;
use Flarum\Search\GambitManager;
use Flarum\Search\SearchState;
use Flarum\User\Event\Searching;
use Flarum\User\User;
use Flarum\User\UserRepository;
use Illuminate\Contracts\Events\Dispatcher;
@@ -49,14 +46,4 @@ class UserSearcher extends AbstractSearcher
{
return $this->users->query()->whereVisibleTo($actor);
}
/**
* @deprecated along with the Searching event, remove in Beta 17.
*/
protected function mutateSearch(SearchState $search, QueryCriteria $criteria)
{
parent::mutateSearch($search, $criteria);
$this->events->dispatch(new Searching($search, $criteria));
}
}

View File

@@ -24,7 +24,6 @@ use Flarum\Post\Post;
use Flarum\User\DisplayName\DriverInterface;
use Flarum\User\Event\Activated;
use Flarum\User\Event\AvatarChanged;
use Flarum\User\Event\CheckingPassword;
use Flarum\User\Event\Deleted;
use Flarum\User\Event\EmailChanged;
use Flarum\User\Event\EmailChangeRequested;
@@ -343,7 +342,7 @@ class User extends AbstractModel
*/
public function checkPassword($password)
{
$valid = static::$dispatcher->until(new CheckingPassword($this, $password));
$valid = false;
foreach (static::$passwordCheckers as $checker) {
$result = $checker($this, $password);
@@ -355,7 +354,7 @@ class User extends AbstractModel
}
}
return $valid || false;
return $valid;
}
/**