class ContextGenerator (View source)

Used for context generation.

Constants

TEMPLATE

The template of a context.

Parameters: 1 - name 2 - class 3 - link 4 - keywords array

Properties

static array<string,int> $labelsFlags

Labels and flags that may be used when defining keywords.

$links

Documentation links for each context.

Methods

static array
sortWords(array $arr)

Sorts an array of words.

static array
readWords(array $files)

Reads a list of words and sorts it by type, length and keyword.

static string
printWords(array $words, int $spaces = 8, int $line = 140)

Prints an array of a words in PHP format.

static string
generate(array $options)

Generates a context's class.

static string
formatName(string $name)

Formats context name.

static void
build(string $input, string $output)

Builds a test.

static void
buildAll(string $input, string $output)

Generates recursively all tests preserving the directory structure.

Details

static array sortWords(array $arr)

Sorts an array of words.

Parameters

array $arr

Return Value

array

static array readWords(array $files)

Reads a list of words and sorts it by type, length and keyword.

Parameters

array $files

Return Value

array

static string printWords(array $words, int $spaces = 8, int $line = 140)

Prints an array of a words in PHP format.

Parameters

array $words

the list of words to be formatted

int $spaces

the number of spaces that starts every line

int $line

the length of a line

Return Value

string

static string generate(array $options)

Generates a context's class.

Parameters

array $options

the options for this context

Return Value

string

static string formatName(string $name)

Formats context name.

Parameters

string $name

name to format

Return Value

string

static void build(string $input, string $output)

Builds a test.

Reads the input file, generates the data and writes it back.

Parameters

string $input

the input file

string $output

the output directory

Return Value

void

static void buildAll(string $input, string $output)

Generates recursively all tests preserving the directory structure.

Parameters

string $input

the input directory

string $output

the output directory

Return Value

void