class php_exporter

Class php_exporter Crawls through a list of files and grabs all php-events

Properties

protected string $path
protected string $root_path
protected string $min_version
protected string $max_version
protected string $current_file
protected string $current_event
protected int $current_event_line
protected array $events
protected array $file_lines

Methods

__construct(string $phpbb_root_path, mixed $extension = null, string $min_version = null, string $max_version = null)

No description

array
get_events()

Get the list of all events

null
set_current_event(string $name, int $line)

Set current event data

null
set_content(array $content)

Set the content of this file

int
crawl_phpbb_directory_php()

Crawl the phpBB/ directory for php events

array
get_recursive_file_list()

Returns a list of files in $dir

string
export_events_for_wiki(string $action = '') deprecated

Format the php events as a wiki table

string
export_events_for_rst(string $action = '')

Format the PHP events as a rst table

string
export_events_for_bbcode(string $action = '')

Format the PHP events as a BBCode list

int
crawl_php_file(string $file)

No description

bool
version_is_filtered(string $version)

The version to check

string
get_event_name(int $event_line, bool $is_dispatch)

Find the name of the event inside the dispatch() line

string
preg_match_event_name()

Returns a regex match for the event name

array
get_vars_from_array()

Find the $vars array

array
get_vars_from_single_line_array(string $line, bool $throw_multiline = true)

Find the variables in single line array

array
get_vars_from_multi_line_array()

Find the variables in single line array

array
get_vars_from_docblock()

Find the $vars array

int
find_since()

Find the "@since" Information line

array
find_changed(string $tag_name)

Find the "@changed" Information lines

int
find_event()

Find the "@event" Information line

int
find_tag(string $find_tag, array $disallowed_tags, int $skip_to_line = 0)

Find a "@*" Information line

int
find_description()

Find a "@*" Information line

string
validate_since(string $line)

Validate "@since" Information

string
validate_changed(string $line)

Validate "@changed" Information

string
validate_event(string $event_name, string $line)

Validate "@event" Information

null
validate_vars_docblock_array(array $vars_array, array $vars_docblock)

Validates that two arrays contain the same strings

Details

at line 55
__construct(string $phpbb_root_path, mixed $extension = null, string $min_version = null, string $max_version = null)

No description

Parameters

string $phpbb_root_path
mixed $extension

String 'vendor/ext' to filter, null for phpBB core

string $min_version
string $max_version

at line 77
array get_events()

Get the list of all events

Return Value

array

Array with events: name => details

at line 89
null set_current_event(string $name, int $line)

Set current event data

Parameters

string $name

Name of the current event (used for error messages)

int $line

Line where the current event is placed in

Return Value

null

at line 101
null set_content(array $content)

Set the content of this file

Parameters

array $content

Array with the lines of the file

Return Value

null

at line 110
int crawl_phpbb_directory_php()

Crawl the phpBB/ directory for php events

Return Value

int

The number of events found

at line 128
array get_recursive_file_list()

Returns a list of files in $dir

Return Value

array

List of files (including the path)

at line 166
string export_events_for_wiki(string $action = '') deprecated

deprecated 3.3.5-RC1 (To be removed: 4.0.0-a1)

Format the php events as a wiki table

Parameters

string $action

Return Value

string

at line 194
string export_events_for_rst(string $action = '')

Format the PHP events as a rst table

Parameters

string $action

Return Value

string

at line 216
string export_events_for_bbcode(string $action = '')

Format the PHP events as a BBCode list

Parameters

string $action

Return Value

string

at line 246
int crawl_php_file(string $file)

No description

Parameters

string $file

Return Value

int

Number of events found in this file

Exceptions

LogicException

at line 387
protected bool version_is_filtered(string $version)

The version to check

Parameters

string $version

Return Value

bool

at line 401
string get_event_name(int $event_line, bool $is_dispatch)

Find the name of the event inside the dispatch() line

Parameters

int $event_line
bool $is_dispatch

Do we look for dispatch() or trigger_event() ?

Return Value

string

Name of the event

Exceptions

LogicException

at line 437
protected string preg_match_event_name()

Returns a regex match for the event name

Return Value

string

at line 448
array get_vars_from_array()

Find the $vars array

Return Value

array

List of variables

Exceptions

LogicException

at line 481
array get_vars_from_single_line_array(string $line, bool $throw_multiline = true)

Find the variables in single line array

Parameters

string $line
bool $throw_multiline

Throw an exception when there are too many arguments in one line.

Return Value

array

List of variables

Exceptions

LogicException

at line 508
array get_vars_from_multi_line_array()

Find the variables in single line array

Return Value

array

List of variables

Exceptions

LogicException

at line 533
array get_vars_from_docblock()

Find the $vars array

Return Value

array

List of variables

Exceptions

LogicException

at line 594
int find_since()

Find the "@since" Information line

Return Value

int

Absolute line number

Exceptions

LogicException

at line 606
array find_changed(string $tag_name)

Find the "@changed" Information lines

Parameters

string $tag_name

Should be 'change', not 'changed'

Return Value

array

Absolute line numbers

Exceptions

LogicException

at line 631
int find_event()

Find the "@event" Information line

Return Value

int

Absolute line number

at line 646
int find_tag(string $find_tag, array $disallowed_tags, int $skip_to_line = 0)

Find a "@*" Information line

Parameters

string $find_tag

Name of the tag we are trying to find

array $disallowed_tags

List of tags that must not appear between the tag and the actual event

int $skip_to_line

Skip lines until this one

Return Value

int

Absolute line number

Exceptions

LogicException

at line 692
int find_description()

Find a "@*" Information line

Return Value

int

Absolute line number

Exceptions

LogicException

at line 726
string validate_since(string $line)

Validate "@since" Information

Parameters

string $line

Return Value

string

Exceptions

LogicException

at line 746
string validate_changed(string $line)

Validate "@changed" Information

Parameters

string $line

Return Value

string

Exceptions

LogicException

at line 768
string validate_event(string $event_name, string $line)

Validate "@event" Information

Parameters

string $event_name
string $line

Return Value

string

Exceptions

LogicException

at line 795
null validate_vars_docblock_array(array $vars_array, array $vars_docblock)

Validates that two arrays contain the same strings

Parameters

array $vars_array

Variables found in the array line

array $vars_docblock

Variables found in the doc block

Return Value

null

Exceptions

LogicException