\ManiaControl\UtilsFormatter

Class offering Methods to format Texts and Values

Summary

Methods
Properties
Constants
getUsageInformation()
escapeText()
formatTime()
timeElapsedString()
formatTimeH()
formatTimestamp()
stripDirtyCodes()
stripLinks()
stripCodes()
stripColors()
mapCountry()
parseBoolean()
utf8()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

getUsageInformation()

getUsageInformation() 

Gets Information about the Class, and a List of the Public Method

escapeText()

escapeText(string  $text) : string

Return the given Text with Escaping around it

Parameters

string $text

Returns

string

formatTime()

formatTime(integer  $time) : string

Format the given Time (in Milliseconds)

Parameters

integer $time

Returns

string

timeElapsedString()

timeElapsedString(integer  $time, boolean  $short = false) : string

Format an elapsed time String (2 days ago.

..) by a given timestamp

Parameters

integer $time

Input time

boolean $short

Short version

Returns

string —

Formatted elapsed time string

formatTimeH()

formatTimeH(integer  $seconds) : string

Format the given Time (Seconds) to hh:mm:ss

Parameters

integer $seconds

Returns

string

formatTimestamp()

formatTimestamp(integer  $seconds) : string

Convert the given Time (Seconds) to MySQL Timestamp

Parameters

integer $seconds

Returns

string

stripDirtyCodes()

stripDirtyCodes(string  $string) : string

Remove possibly dangerous Codes (Dangerous Codes are Links and Formats that might screw up the following Styling)

Parameters

string $string

Returns

string

stripLinks()

stripLinks(string  $string) : string

Remove Links from the String

Parameters

string $string

Returns

string

stripCodes()

stripCodes(string  $string) : string

Remove all Codes from the String

Parameters

string $string

Returns

string

stripColors()

stripColors(string  $string) : string

Remove Colors from the String

Parameters

string $string

Returns

string

mapCountry()

mapCountry(string  $country) : string

Map Country Names to 3-letter Nation Abbreviations Created by Xymph Based on http://en.wikipedia.org/wiki/List_of_IOC_country_codes See also http://en.wikipedia.org/wiki/Comparison_of_IOC,_FIFA,_and_ISO_3166_country_codes

Parameters

string $country

Returns

string

parseBoolean()

parseBoolean(mixed  $value) : boolean

Parse the given Value into a Bool

Parameters

mixed $value

Returns

boolean

utf8()

utf8(string  $text) : string

Make sure the given Text is encoded in UTF-8

Parameters

string $text

Returns

string