and more typehints

This commit is contained in:
Dylan K. Taylor
2017-07-14 10:56:51 +01:00
parent b9355387da
commit c3b8be3f60
119 changed files with 598 additions and 541 deletions

View File

@ -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);
}