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