Lggr
Static Public Member Functions | Static Protected Member Functions | List of all members
Prophecy\Util\ExportUtil Class Reference

Static Public Member Functions

static export ($value, $indentation=0)
 
static toArray ($value)
 

Static Protected Member Functions

static recursiveExport (&$value, $indentation, $processed=null)
 

Detailed Description

This class is a modification from sebastianbergmann/exporter

See also
https://github.com/sebastianbergmann/exporter

Member Function Documentation

◆ export()

static Prophecy\Util\ExportUtil::export (   $value,
  $indentation = 0 
)
static

Exports a value as a string

The output of this method is similar to the output of print_r(), but improved in various aspects:

  • NULL is rendered as "null" (instead of "")
  • TRUE is rendered as "true" (instead of "1")
  • FALSE is rendered as "false" (instead of "")
  • Strings are always quoted with single quotes
  • Carriage returns and newlines are normalized to
  • Recursion and repeated rendering is treated properly
Parameters
mixed$value
int$indentationThe indentation level of the 2nd+ line
Returns
string

◆ recursiveExport()

static Prophecy\Util\ExportUtil::recursiveExport ( $value,
  $indentation,
  $processed = null 
)
staticprotected

Recursive implementation of export

Parameters
mixed$valueThe value to export
int$indentationThe indentation level of the 2nd+ line
\SebastianBergmann\RecursionContext\Context$processedPreviously processed objects
Returns
string
See also
SebastianBergmann\Exporter\Exporter::export

◆ toArray()

static Prophecy\Util\ExportUtil::toArray (   $value)
static

Converts an object to an array containing all of its private, protected and public properties.

Parameters
mixed$value
Returns
array

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