mirror of
https://github.com/flarum/framework.git
synced 2024-12-12 22:53:37 +08:00
Remove Interface suffix from some classes
This commit is contained in:
parent
ebce765075
commit
7cf0fefbbe
|
@ -2,7 +2,7 @@
|
|||
|
||||
use Flarum\Api\Request;
|
||||
|
||||
interface ActionInterface
|
||||
interface Action
|
||||
{
|
||||
/**
|
||||
* Handle a request to the API, returning an HTTP response.
|
|
@ -7,7 +7,7 @@ use Flarum\Core\Exceptions\ValidationFailureException;
|
|||
use Flarum\Core\Exceptions\PermissionDeniedException;
|
||||
use Zend\Diactoros\Response\JsonResponse;
|
||||
|
||||
abstract class JsonApiAction implements ActionInterface
|
||||
abstract class JsonApiAction implements Action
|
||||
{
|
||||
/**
|
||||
* Handle an API request and return an API response, handling any relevant
|
||||
|
|
|
@ -8,7 +8,7 @@ class AssetManager
|
|||
|
||||
protected $js;
|
||||
|
||||
public function __construct(CompilerInterface $js, CompilerInterface $less)
|
||||
public function __construct(Compiler $js, Compiler $less)
|
||||
{
|
||||
$this->js = $js;
|
||||
$this->less = $less;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php namespace Flarum\Assets;
|
||||
|
||||
interface CompilerInterface
|
||||
interface Compiler
|
||||
{
|
||||
public function addFile($file);
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class RevisionCompiler implements CompilerInterface
|
||||
class RevisionCompiler implements Compiler
|
||||
{
|
||||
protected $files = [];
|
||||
|
||||
|
|
|
@ -3,10 +3,10 @@
|
|||
use Flarum\Core\Discussions\Search\DiscussionSearch;
|
||||
use Flarum\Core\Posts\PostRepository;
|
||||
use Flarum\Core\Search\Search;
|
||||
use Flarum\Core\Search\GambitInterface;
|
||||
use Flarum\Core\Search\Gambit;
|
||||
use LogicException;
|
||||
|
||||
class FulltextGambit implements GambitInterface
|
||||
class FulltextGambit implements Gambit
|
||||
{
|
||||
/**
|
||||
* @var PostRepository
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
use Flarum\Core\Model;
|
||||
|
||||
interface FormatterInterface
|
||||
interface Formatter
|
||||
{
|
||||
/**
|
||||
* Configure the formatter manager before formatting takes place.
|
|
@ -90,7 +90,7 @@ class FormatterManager
|
|||
/**
|
||||
* Instantiate the collected formatters.
|
||||
*
|
||||
* @return FormatterInterface[]
|
||||
* @return Formatter[]
|
||||
*/
|
||||
protected function getFormatters()
|
||||
{
|
||||
|
@ -99,9 +99,9 @@ class FormatterManager
|
|||
foreach ($this->formatters as $formatter) {
|
||||
$formatter = $this->container->make($formatter);
|
||||
|
||||
if (! $formatter instanceof FormatterInterface) {
|
||||
if (! $formatter instanceof Formatter) {
|
||||
throw new LogicException('Formatter ' . get_class($formatter)
|
||||
. ' does not implement ' . FormatterInterface::class);
|
||||
. ' does not implement ' . Formatter::class);
|
||||
}
|
||||
|
||||
$formatters[] = $formatter;
|
||||
|
|
|
@ -6,7 +6,7 @@ use Flarum\Core\Model;
|
|||
* A formatter which formats a block of HTML, while leaving the contents
|
||||
* of specific tags like <code> and <pre> untouched.
|
||||
*/
|
||||
abstract class TextFormatter implements FormatterInterface
|
||||
abstract class TextFormatter implements Formatter
|
||||
{
|
||||
/**
|
||||
* A list of tags to ignore when applying formatting.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php namespace Flarum\Core\Search;
|
||||
|
||||
interface GambitInterface
|
||||
interface Gambit
|
||||
{
|
||||
/**
|
||||
* Apply conditions to the searcher for a bit of the search string.
|
|
@ -90,9 +90,9 @@ class GambitManager
|
|||
|
||||
foreach ($bits as $k => $bit) {
|
||||
foreach ($gambits as $gambit) {
|
||||
if (! $gambit instanceof GambitInterface) {
|
||||
if (! $gambit instanceof Gambit) {
|
||||
throw new LogicException('Gambit ' . get_class($gambit)
|
||||
. ' does not implement ' . GambitInterface::class);
|
||||
. ' does not implement ' . Gambit::class);
|
||||
}
|
||||
|
||||
if ($gambit->apply($search, $bit)) {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php namespace Flarum\Core\Search;
|
||||
|
||||
abstract class RegexGambit implements GambitInterface
|
||||
abstract class RegexGambit implements Gambit
|
||||
{
|
||||
/**
|
||||
* The regex pattern to match the bit against.
|
||||
|
|
|
@ -26,7 +26,7 @@ abstract class Search
|
|||
protected $defaultSort = [];
|
||||
|
||||
/**
|
||||
* @var GambitInterface[]
|
||||
* @var Gambit[]
|
||||
*/
|
||||
protected $activeGambits = [];
|
||||
|
||||
|
@ -87,7 +87,7 @@ abstract class Search
|
|||
/**
|
||||
* Get a list of the gambits that are active in this search.
|
||||
*
|
||||
* @return GambitInterface[]
|
||||
* @return Gambit[]
|
||||
*/
|
||||
public function getActiveGambits()
|
||||
{
|
||||
|
@ -97,10 +97,10 @@ abstract class Search
|
|||
/**
|
||||
* Add a gambit as being active in this search.
|
||||
*
|
||||
* @param GambitInterface $gambit
|
||||
* @param Gambit $gambit
|
||||
* @return void
|
||||
*/
|
||||
public function addActiveGambit(GambitInterface $gambit)
|
||||
public function addActiveGambit(Gambit $gambit)
|
||||
{
|
||||
$this->activeGambits[] = $gambit;
|
||||
}
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
|
||||
use Flarum\Core\Users\UserRepository;
|
||||
use Flarum\Core\Search\Search;
|
||||
use Flarum\Core\Search\GambitInterface;
|
||||
use Flarum\Core\Search\Gambit;
|
||||
|
||||
class FulltextGambit implements GambitInterface
|
||||
class FulltextGambit implements Gambit
|
||||
{
|
||||
/**
|
||||
* @var UserRepository
|
||||
|
|
Loading…
Reference in New Issue
Block a user