PHP Class spoon2twig

Deprecation:
ファイルを表示 Open project: forkcms/forkcms Class Usage Examples

Public Methods

Method Description
__construct ( )
comma ( string $input ) : string
convertAllFiles ( boolean $force, array $path, string | null $input = null ) Project file converter Will locate ever file in the project and convert in automagicly
dePluralize ( string $noun ) : string Converts a noun until it's ready
displayErrors ( ) Displays all Errors or notices
error ( string $message ) Error or notice collector
fromCamelToSnake ( string $input ) : string
getCorrectSourceVersion ( ) : string Get Correct version looks a the project version to find and return it's source directory
getFile ( string $input ) : string Return the file content of a given file
isFile ( string $file ) : boolean File checker
pregReplaceIterations ( string $fileData ) : string Iteration Converter
pregReplaceSprintf ( string $regex, string $format, string $fileData, $extra = null ) : string preg_replace sprint_f Combines 2 function into one that's more ideal for parsing as it string replaces any found matches with a new given value
ruleParser ( string $fileData ) : string The actual conversion
start ( array $arguments ) Start Converter
timestamp ( integer $int = null ) : float Stamps the time it takes from start to finnish
write ( string $input, string $fileData ) Write saves to content to a new file

Private Methods

Method Description
buildFiles ( array $templatePaths, boolean $force = false ) Builds new Files from a paths array
findFiles ( string $basePath, array $path, string $input = null ) : array Find files in given paths
findThemeFiles ( string $basePath, array $path, string $theme ) : array

Method Details

__construct() public method

public __construct ( )

comma() public method

public comma ( string $input ) : string
$input string
return string

convertAllFiles() public method

Project file converter Will locate ever file in the project and convert in automagicly
public convertAllFiles ( boolean $force, array $path, string | null $input = null )
$force boolean allow forced overwrite
$path array
$input string | null

dePluralize() public method

Converts a noun until it's ready
public dePluralize ( string $noun ) : string
$noun string a noun
return string converted noun

displayErrors() public method

Displays all Errors or notices
public displayErrors ( )

error() public method

Error or notice collector
public error ( string $message )
$message string

fromCamelToSnake() public method

public fromCamelToSnake ( string $input ) : string
$input string
return string

getCorrectSourceVersion() public method

Get Correct version looks a the project version to find and return it's source directory
public getCorrectSourceVersion ( ) : string
return string returns the correct source dir

getFile() public method

Return the file content of a given file
public getFile ( string $input ) : string
$input string file full path
return string file content

isFile() public method

File checker
public isFile ( string $file ) : boolean
$file string file full path
return boolean

pregReplaceIterations() public method

Iteration Converter
public pregReplaceIterations ( string $fileData ) : string
$fileData string file to convert
return string file in converted form

pregReplaceSprintf() public method

preg_replace sprint_f Combines 2 function into one that's more ideal for parsing as it string replaces any found matches with a new given value
public pregReplaceSprintf ( string $regex, string $format, string $fileData, $extra = null ) : string
$regex string the regex
$format string the replace value
$fileData string file content
return string if successful returns file content with replaced data

ruleParser() public method

The actual conversion
public ruleParser ( string $fileData ) : string
$fileData string
return string

start() public method

Start Converter
public start ( array $arguments )
$arguments array A list of arguments from php command line

timestamp() public method

Stamps the time it takes from start to finnish
public timestamp ( integer $int = null ) : float
$int integer how precise you wish to measure
return float

write() public method

Write saves to content to a new file
public write ( string $input, string $fileData )
$input string file full path
$fileData string file content