PHP Класс Prophecy\Util\ExportUtil

This class is derived from the PHPUnit testing framework.
Автор: Sebastian Bergmann ([email protected])
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
export ( mixed $value, integer $indentation ) : string Exports a value as a string
toArray ( mixed $value ) : array Converts an object to an array containing all of its private, protected and public properties.

Защищенные методы

Метод Описание
recursiveExport ( mixed &$value, integer $indentation, SebastianBergmann\RecursionContext\Context $processed = null ) : string Recursive implementation of export

Описание методов

export() публичный статический Метод

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 \n - Recursion and repeated rendering is treated properly
public static export ( mixed $value, integer $indentation ) : string
$value mixed
$indentation integer The indentation level of the 2nd+ line
Результат string

recursiveExport() защищенный статический Метод

Recursive implementation of export
См. также: SebastianBergmann\Exporter\Exporter::export
protected static recursiveExport ( mixed &$value, integer $indentation, SebastianBergmann\RecursionContext\Context $processed = null ) : string
$value mixed The value to export
$indentation integer The indentation level of the 2nd+ line
$processed SebastianBergmann\RecursionContext\Context Previously processed objects
Результат string

toArray() публичный статический Метод

Converts an object to an array containing all of its private, protected and public properties.
public static toArray ( mixed $value ) : array
$value mixed
Результат array