Skip to content

Commit

Permalink
Rename Parsers/ParserInterface to Parser
Browse files Browse the repository at this point in the history
  • Loading branch information
danon committed Nov 22, 2023
1 parent b78b843 commit 88c1e44
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 15 deletions.
8 changes: 4 additions & 4 deletions app/Services/Parser/Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@

namespace Coyote\Services\Parser;

use Coyote\Services\Parser\Parsers\ParserInterface;
use Coyote\Services\Parser\Parsers\Parser;

final class Container
{
/**
* @var ParserInterface[]
* @var Parser[]
*/
private $parsers = [];

/**
* @param ParserInterface $parser
* @param Parser $parser
*/
public function attach(ParserInterface $parser)
public function attach(Parser $parser)
{
$this->parsers[] = $parser;
}
Expand Down
2 changes: 1 addition & 1 deletion app/Services/Parser/Parsers/Censore.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use TRegx\SafeRegex\Exception\PregException;
use TRegx\SafeRegex\preg;

class Censore extends HashParser implements ParserInterface
class Censore extends HashParser implements Parser
{
public function __construct(private WordRepository $word)
{
Expand Down
2 changes: 1 addition & 1 deletion app/Services/Parser/Parsers/Context.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use TRegx\CleanRegex\Pattern;

class Context extends HashParser implements ParserInterface
class Context extends HashParser implements Parser
{
const HEADLINE_REGEXP = '<h([1-6])>(.*?)</h\1>';

Expand Down
2 changes: 1 addition & 1 deletion app/Services/Parser/Parsers/Emphasis.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Coyote\Repositories\Contracts\UserRepositoryInterface as UserRepository;
use Collective\Html\HtmlBuilder;

class Emphasis extends HashParser implements ParserInterface
class Emphasis extends HashParser implements Parser
{
const COLOR = '#B60016';

Expand Down
2 changes: 1 addition & 1 deletion app/Services/Parser/Parsers/Latex.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Coyote\Services\Parser\Parsers;

class Latex extends HashParser implements ParserInterface
class Latex extends HashParser implements Parser
{
public function parse(string $text): string
{
Expand Down
2 changes: 1 addition & 1 deletion app/Services/Parser/Parsers/Markdown.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
use League\CommonMark\Extension\TaskList\TaskListExtension;
use League\CommonMark\MarkdownConverter;

class Markdown implements ParserInterface
class Markdown implements Parser
{
protected array $config = [];

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<?php

namespace Coyote\Services\Parser\Parsers;

interface ParserInterface
interface Parser
{
public function parse(string $text): string;
}
2 changes: 1 addition & 1 deletion app/Services/Parser/Parsers/Prism.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use TRegx\CleanRegex\Pattern;

class Prism implements ParserInterface
class Prism implements Parser
{
const ALIAS = [
'asm' => 'asm6502',
Expand Down
2 changes: 1 addition & 1 deletion app/Services/Parser/Parsers/Purifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use HTMLPurifier;
use HTMLPurifier_Config;

class Purifier implements ParserInterface
class Purifier implements Parser
{
private HTMLPurifier_Config $config;

Expand Down
2 changes: 1 addition & 1 deletion app/Services/Parser/Parsers/Smilies.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
/**
* Class Smilies
*/
class Smilies extends HashParser implements ParserInterface
class Smilies extends HashParser implements Parser
{
private $smilies = [
':)' => 'smile.gif',
Expand Down
2 changes: 1 addition & 1 deletion app/Services/Parser/Parsers/Template.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Coyote\Repositories\Contracts\WikiRepositoryInterface as WikiRepository;

class Template implements ParserInterface
class Template implements Parser
{
const TEMPLATE_REGEXP = "{{Template:(.*?)(\|(.*))*}}";

Expand Down

0 comments on commit 88c1e44

Please sign in to comment.