mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 18:32:55 +00:00
and more typehints
This commit is contained in:
@ -60,7 +60,7 @@ abstract class TextFormat{
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function tokenize($string){
|
||||
public static function tokenize($string) : array{
|
||||
return preg_split("/(" . TextFormat::ESCAPE . "[0123456789abcdefklmnor])/", $string, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE);
|
||||
}
|
||||
|
||||
@ -86,7 +86,7 @@ abstract class TextFormat{
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function toJSON($string){
|
||||
public static function toJSON($string) : string{
|
||||
if(!is_array($string)){
|
||||
$string = self::tokenize($string);
|
||||
}
|
||||
@ -274,7 +274,7 @@ abstract class TextFormat{
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function toHTML($string){
|
||||
public static function toHTML($string) : string{
|
||||
if(!is_array($string)){
|
||||
$string = self::tokenize($string);
|
||||
}
|
||||
@ -390,7 +390,7 @@ abstract class TextFormat{
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function toANSI($string){
|
||||
public static function toANSI($string) : string{
|
||||
if(!is_array($string)){
|
||||
$string = self::tokenize($string);
|
||||
}
|
||||
|
Reference in New Issue
Block a user