PHP Class spoon2twig

Deprecation:
Afficher le fichier Open project: forkcms/forkcms Class Usage Examples

Méthodes publiques

Méthode 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

Méthode 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 méthode

public __construct ( )

comma() public méthode

public comma ( string $input ) : string
$input string
Résultat string

convertAllFiles() public méthode

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 méthode

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

displayErrors() public méthode

Displays all Errors or notices
public displayErrors ( )

error() public méthode

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

fromCamelToSnake() public méthode

public fromCamelToSnake ( string $input ) : string
$input string
Résultat string

getCorrectSourceVersion() public méthode

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

getFile() public méthode

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

isFile() public méthode

File checker
public isFile ( string $file ) : boolean
$file string file full path
Résultat boolean

pregReplaceIterations() public méthode

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

pregReplaceSprintf() public méthode

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
Résultat string if successful returns file content with replaced data

ruleParser() public méthode

The actual conversion
public ruleParser ( string $fileData ) : string
$fileData string
Résultat string

start() public méthode

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

timestamp() public méthode

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

write() public méthode

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