PHP Class Jarves\Tools

Show file Open project: jarves/jarves Class Usage Examples

Public Methods

Method Description
camelcase2Char ( $value, $char = '_' )
camelcase2Underscore ( $value )
char2Camelcase ( $value, $char = '_' )
dbQuote ( $value, $table = '' )
filterArrayByBlacklist ( array | string $array, array | string $blacklist ) : array
getArrayPath ( array $array, string $dotPath ) : mixed Returns the value of a $dotPath in $array.
getArrayTrace ( $exception )
getFileExtension ( string $path ) : string | boolean Returns the lowercased file extension of $path.
getRelativePath ( string $from, string $to ) : string Returns a relative path from $path to $current.
indentString ( $string, $size = 2, $char = ' ' )
listToArray ( string $string ) : array
setArrayPath ( &$array, string $dotPath, mixed $value ) : mixed Sets the value of a $dotPath in $array.
underscore2Camelcase ( $value )
urlDecode ( $string )
urlEncode ( $string )

Method Details

camelcase2Char() public static method

public static camelcase2Char ( $value, $char = '_' )

camelcase2Underscore() public static method

public static camelcase2Underscore ( $value )

char2Camelcase() public static method

public static char2Camelcase ( $value, $char = '_' )

dbQuote() public static method

public static dbQuote ( $value, $table = '' )

filterArrayByBlacklist() public static method

public static filterArrayByBlacklist ( array | string $array, array | string $blacklist ) : array
$array array | string array or comma separated list
$blacklist array | string array or comma separated list
return array

getArrayPath() public static method

(['a' => ['b' => 5]], 'a.b') = 5
public static getArrayPath ( array $array, string $dotPath ) : mixed
$array array
$dotPath string
return mixed

getArrayTrace() public static method

public static getArrayTrace ( $exception )

getFileExtension() public static method

Returns the lowercased file extension of $path.
public static getFileExtension ( string $path ) : string | boolean
$path string
return string | boolean false if not '.' is present in $path.

getRelativePath() public static method

Returns a relative path from $path to $current.
public static getRelativePath ( string $from, string $to ) : string
$from string
$to string relative to this
return string relative path without trailing slash

indentString() public static method

public static indentString ( $string, $size = 2, $char = ' ' )

listToArray() public static method

public static listToArray ( string $string ) : array
$string string a comma separated list of values
return array

setArrayPath() public static method

(['a' => ['b' => 5]], 'a.b', 6) = ['a' => ['b' => 6]]
public static setArrayPath ( &$array, string $dotPath, mixed $value ) : mixed
$dotPath string
$value mixed
return mixed

underscore2Camelcase() public static method

public static underscore2Camelcase ( $value )

urlDecode() public static method

public static urlDecode ( $string )

urlEncode() public static method

public static urlEncode ( $string )