PHP Class SimpleDumper, simpletest

@package SimpleTest
Afficher le fichier Open project: simpletest/simpletest Class Usage Examples

Méthodes publiques

Méthode Description
clipString ( string $value, integer $size, integer $position ) : string Clips a string to a maximum length.
describeDifference ( mixed $first, mixed $second, boolean $identical = false ) : string Creates a human readable description of the difference between two variables.
describeValue ( mixed $value ) : string Renders a variable in a shorter form than print_r().
dump ( mixed $variable ) : string Sends a formatted dump of a variable to a string.
getType ( mixed $value ) : string Gets the string representation of a type.
unmangle ( string $mangled ) : string Removes crud from property name after it's been converted to an array.

Méthodes protégées

Méthode Description
describeArrayDifference ( array $first, mixed $second, boolean $identical ) : string Creates a human readable description of the difference between two arrays.
describeBooleanDifference ( boolean $first, mixed $second, boolean $identical ) : string Creates a human readable description of the difference between a boolean and another variable.
describeFloatDifference ( float $first, mixed $second, boolean $identical ) : string Creates a human readable description of the difference between two floating point numbers.
describeGenericDifference ( null $first, mixed $second ) : string Creates a human readable description of the difference between two variables.
describeIntegerDifference ( integer $first, mixed $second, boolean $identical ) : string Creates a human readable description of the difference between an integer and another variable.
describeNullDifference ( null $first, mixed $second, boolean $identical ) : string Creates a human readable description of the difference between a null and another variable.
describeObjectDifference ( object $first, mixed $second, boolean $identical ) : string Creates a human readable description of the difference between two objects.
describeResourceDifference ( resource $first, mixed $second, boolean $identical ) : string Creates a human readable description of the difference between a resource and another variable.
describeStringDifference ( string $first, mixed $second, boolean $identical ) : string Creates a human readable description of the difference between a string and another variable.
getMembers ( object $object ) : array Get all members of an object including private and protected ones.
isMatchingKeys ( array $first, array $second, boolean $identical ) : boolean Compares two arrays to see if their key lists match.
isTypeMatch ( mixed $first, mixed $second ) : boolean Tests to see if types match.
stringDiffersAt ( string $first, string $second ) : integer Find the first character position that differs in two strings by binary chop.

Private Methods

Méthode Description
getPrivatePropertyNoMatterWhat ( string $name, object $object ) : mixed Extracts a private member's value when reflection won't play ball.

Method Details

clipString() public méthode

Clips a string to a maximum length.
public clipString ( string $value, integer $size, integer $position ) : string
$value string String to truncate.
$size integer Minimum string size to show.
$position integer Centre of string section.
Résultat string Shortened version.

describeArrayDifference() protected méthode

Creates a human readable description of the difference between two arrays.
protected describeArrayDifference ( array $first, mixed $second, boolean $identical ) : string
$first array First array.
$second mixed Array to compare with.
$identical boolean If true then type anomolies count.
Résultat string Human readable description.

describeBooleanDifference() protected méthode

Creates a human readable description of the difference between a boolean and another variable.
protected describeBooleanDifference ( boolean $first, mixed $second, boolean $identical ) : string
$first boolean First boolean.
$second mixed Boolean to compare with.
$identical boolean If true then type anomolies count.
Résultat string Human readable description.

describeDifference() public méthode

Uses a dynamic call.
public describeDifference ( mixed $first, mixed $second, boolean $identical = false ) : string
$first mixed First variable.
$second mixed Value to compare with.
$identical boolean If true then type anomolies count.
Résultat string Description of difference.

describeFloatDifference() protected méthode

Creates a human readable description of the difference between two floating point numbers.
protected describeFloatDifference ( float $first, mixed $second, boolean $identical ) : string
$first float First float.
$second mixed Float to compare with.
$identical boolean If true then type anomolies count.
Résultat string Human readable description.

describeGenericDifference() protected méthode

The minimal version.
protected describeGenericDifference ( null $first, mixed $second ) : string
$first null First value.
$second mixed Value to compare with.
Résultat string Human readable description.

describeIntegerDifference() protected méthode

Creates a human readable description of the difference between an integer and another variable.
protected describeIntegerDifference ( integer $first, mixed $second, boolean $identical ) : string
$first integer First number.
$second mixed Number to compare with.
$identical boolean If true then type anomolies count.
Résultat string Human readable description.

describeNullDifference() protected méthode

Creates a human readable description of the difference between a null and another variable.
protected describeNullDifference ( null $first, mixed $second, boolean $identical ) : string
$first null First null.
$second mixed Null to compare with.
$identical boolean If true then type anomolies count.
Résultat string Human readable description.

describeObjectDifference() protected méthode

Creates a human readable description of the difference between two objects.
protected describeObjectDifference ( object $first, mixed $second, boolean $identical ) : string
$first object First object.
$second mixed Object to compare with.
$identical boolean If true then type anomolies count.
Résultat string Human readable description.

describeResourceDifference() protected méthode

Creates a human readable description of the difference between a resource and another variable.
protected describeResourceDifference ( resource $first, mixed $second, boolean $identical ) : string
$first resource First resource.
$second mixed Resource to compare with.
$identical boolean If true then type anomolies count.
Résultat string Human readable description.

describeStringDifference() protected méthode

Creates a human readable description of the difference between a string and another variable.
protected describeStringDifference ( string $first, mixed $second, boolean $identical ) : string
$first string First string.
$second mixed String to compare with.
$identical boolean If true then type anomolies count.
Résultat string Human readable description.

describeValue() public méthode

Renders a variable in a shorter form than print_r().
public describeValue ( mixed $value ) : string
$value mixed Variable to render as a string.
Résultat string Human readable string form.

dump() public méthode

Sends a formatted dump of a variable to a string.
public dump ( mixed $variable ) : string
$variable mixed Variable to display.
Résultat string Output from print_r().

getMembers() protected méthode

A safer form of casting to an array.
protected getMembers ( object $object ) : array
$object object Object to list members of, including private ones.
Résultat array Names and values in the object.

getType() public méthode

Gets the string representation of a type.
public getType ( mixed $value ) : string
$value mixed Variable to check against.
Résultat string Type.

isMatchingKeys() protected méthode

For an identical match, the ordering and types of the keys is significant.
protected isMatchingKeys ( array $first, array $second, boolean $identical ) : boolean
$first array First array.
$second array Array to compare with.
$identical boolean If true then type anomolies count.
Résultat boolean True if matching.

isTypeMatch() protected méthode

Tests to see if types match.
protected isTypeMatch ( mixed $first, mixed $second ) : boolean
$first mixed First variable.
$second mixed Value to compare with.
Résultat boolean True if matches.

stringDiffersAt() protected méthode

Find the first character position that differs in two strings by binary chop.
protected stringDiffersAt ( string $first, string $second ) : integer
$first string First string.
$second string String to compare with.
Résultat integer Position of first differing character.

unmangle() public méthode

Removes crud from property name after it's been converted to an array.
public unmangle ( string $mangled ) : string
$mangled string Name from array cast.
Résultat string Cleaned up name.