MediaWiki  master
Wikimedia\StaticArrayWriter Class Reference

Format a static PHP array to be written to a file. More...

Public Member Functions

 create (array $data, $header='Automatically generated')
 

Static Public Member Functions

static write (array $data, $header)
 

Static Private Member Functions

static encode ( $key, $value, $indent)
 Recursively turn one k/v pair into properly-indented PHP. More...
 

Detailed Description

Format a static PHP array to be written to a file.

@newable

Since
1.32

Definition at line 27 of file StaticArrayWriter.php.

Member Function Documentation

◆ create()

Wikimedia\StaticArrayWriter::create ( array  $data,
  $header = 'Automatically generated' 
)
Parameters
array$dataArray with keys/values to export
string$header
Returns
string PHP code

Definition at line 33 of file StaticArrayWriter.php.

References $header.

◆ encode()

static Wikimedia\StaticArrayWriter::encode (   $key,
  $value,
  $indent 
)
staticprivate

Recursively turn one k/v pair into properly-indented PHP.

Parameters
string | int$key
mixed$value
int$indentIndentation level
Returns
string PHP code

Definition at line 62 of file StaticArrayWriter.php.

References $line.

◆ write()

static Wikimedia\StaticArrayWriter::write ( array  $data,
  $header 
)
static
Since
1.35
Parameters
array$dataArray with keys/values to export
string$header
Returns
string PHP code

Definition at line 43 of file StaticArrayWriter.php.

References $header.


The documentation for this class was generated from the following file: