mirror of
https://github.com/openclassify/openclassify.git
synced 2026-02-09 14:56:13 -06:00
34 lines
729 B
PHP
34 lines
729 B
PHP
<?php
|
|
|
|
namespace VStelmakh\UrlHighlight\Encoder;
|
|
|
|
/**
|
|
* Use this interface to create custom encoders
|
|
*/
|
|
interface EncoderInterface
|
|
{
|
|
/**
|
|
* Decode provided string using specified algorithm
|
|
*
|
|
* @param string $string
|
|
* @return string
|
|
*/
|
|
public function decode(string $string): string;
|
|
|
|
/**
|
|
* Return regex to match provided char in encoded string
|
|
*
|
|
* @param string $char
|
|
* @param string $delimiter
|
|
* @return string
|
|
*/
|
|
public function getEncodedCharRegex(string $char, string $delimiter = '/'): string;
|
|
|
|
/**
|
|
* Return array of specific chars used in encoder
|
|
*
|
|
* @return string[]|null
|
|
*/
|
|
public function getSupportedChars(): ?array;
|
|
}
|