PHP Class ConsoleKit\Utils

Mostrar archivo Open project: maximebf/consolekit Class Usage Examples

Public Methods

Method Description
camelize ( string $string ) : string Returns a dash-cased string into a camelCased string
computeFuncParams ( ReflectionFunctionAbstract $reflection, array $args, array $options, boolean $needTagInDocComment = true ) : array Creates an array of parameters according to the function definition
dashized ( string $string ) : string Returns a camelCased string into a dash-cased string
filterFiles ( array $args, boolean $allowWildcards = true ) : array Extracts files from an array of args
find ( string $filename, array $dirs = [] ) : string Finds the first file that match the filename in any of the specified directories.
get ( array $array, string $key, mixed $default = null ) : mixed Returns the value from $key in $array or $default
join ( string $path1, string $path2 ) : string Joins paths together
mkdir ( string $dir, octal $mode = 511 ) Creates a directory recursively
pipedIn ( ) : string Returns piped in data
touch ( string $filename, string $content = '' ) Creates a file and its directory

Method Details

camelize() public static method

Returns a dash-cased string into a camelCased string
public static camelize ( string $string ) : string
$string string
return string

computeFuncParams() public static method

Creates an array of parameters according to the function definition
public static computeFuncParams ( ReflectionFunctionAbstract $reflection, array $args, array $options, boolean $needTagInDocComment = true ) : array
$reflection ReflectionFunctionAbstract
$args array
$options array
$needTagInDocComment boolean Whether the compute-params tag must be present in the doc comment
return array

dashized() public static method

Returns a camelCased string into a dash-cased string
public static dashized ( string $string ) : string
$string string
return string

filterFiles() public static method

Extracts files from an array of args
public static filterFiles ( array $args, boolean $allowWildcards = true ) : array
$args array
$allowWildcards boolean Whether wildcards are allowed
return array

find() public static method

Finds the first file that match the filename in any of the specified directories.
public static find ( string $filename, array $dirs = [] ) : string
$filename string
$dirs array
return string

get() public static method

Returns the value from $key in $array or $default
public static get ( array $array, string $key, mixed $default = null ) : mixed
$array array
$key string
$default mixed
return mixed

join() public static method

Joins paths together
public static join ( string $path1, string $path2 ) : string
$path1 string
$path2 string
return string

mkdir() public static method

Creates a directory recursively
public static mkdir ( string $dir, octal $mode = 511 )
$dir string
$mode octal

pipedIn() public static method

Returns piped in data
public static pipedIn ( ) : string
return string

touch() public static method

Creates a file and its directory
public static touch ( string $filename, string $content = '' )
$filename string
$content string