Format a static PHP array to be written to a file.
More...
|
| | create (array $data, $header='Automatically generated') |
| |
|
| static | write (array $data, $header) |
| | Create a PHP file that returns the array.
|
| |
| static | writeClass (array $data, array $layout) |
| | Create an PHP class file with the array as a class constant.
|
| |
Format a static PHP array to be written to a file.
- Stability: newable
- Since
- 1.32
Definition at line 14 of file StaticArrayWriter.php.
◆ create()
| Wikimedia\StaticArrayWriter::create |
( |
array | $data, |
|
|
| $header = 'Automatically generated' ) |
- Parameters
-
| array | $data | Array with keys/values to export |
| string | $header | |
- Returns
- string PHP code
Definition at line 20 of file StaticArrayWriter.php.
◆ write()
| static Wikimedia\StaticArrayWriter::write |
( |
array | $data, |
|
|
| $header ) |
|
static |
Create a PHP file that returns the array.
- Since
- 1.35
- Parameters
-
| array | $data | Array with keys/values to export |
| string | $header | |
- Returns
- string PHP code
Definition at line 32 of file StaticArrayWriter.php.
◆ writeClass()
| static Wikimedia\StaticArrayWriter::writeClass |
( |
array | $data, |
|
|
array | $layout ) |
|
static |
Create an PHP class file with the array as a class constant.
PHP classes can be autoloaded by name, which allows usage to be decoupled from the file path.
- Since
- 1.37
- Parameters
-
| array | $data | |
| array{header:string,namespace:string,class:string,const:string} | $layout |
- Returns
- string PHP code
Definition at line 50 of file StaticArrayWriter.php.
The documentation for this class was generated from the following file: