Methods summary
public
integer
|
#
hash( mixed $value )
Returns a hash code for the given value.
Returns a hash code for the given value.
Parameters
- $value
- The value to hash.
Returns
integer The hash code for the given value.
Throws
UnexpectedTypeException If the type of the specified value does
not match the expected type.
InvalidArgumentException If some property of the specified value
prevents it from being hashed.
Implementation of
|
abstract protected
integer
|
#
hashArray( array $value )
Returns a hash code for the given array.
Returns a hash code for the given array.
The resulting hash code is guaranteed to be consistent with the
PhpCommon\Comparison\Equivalence\GenericEquivalence::equivalentArray() method, which means that for any references
$x and $y , if equivalentArray($x, $y) , then
hashArray($x) === hashArray($y) .
Parameters
- $value
- The array to hash.
Returns
integer The hash code for the given array.
Link
|
abstract protected
integer
|
#
hashBoolean( boolean $value )
Returns a hash code for the given boolean value.
Returns a hash code for the given boolean value.
The resulting hash code is guaranteed to be consistent with the
PhpCommon\Comparison\Equivalence\GenericEquivalence::equivalentBoolean() method, which means that for any references
$x and $y , if equivalentBoolean($x, $y) , then
hashBoolean($x) === hashBoolean($y) .
Parameters
- $value
- The boolean value to hash.
Returns
integer The hash code for the given boolean value.
Link
|
abstract protected
integer
|
#
hashFloat( float $value )
Returns a hash code for the given floating-point number.
Returns a hash code for the given floating-point number.
The resulting hash code is guaranteed to be consistent with the
PhpCommon\Comparison\Equivalence\GenericEquivalence::equivalentFloat() method, which means that for any references
$x and $y , if equivalentFloat($x, $y) , then
hashFloat($x) === hashFloat($y) .
Parameters
- $value
- The floating-point number to hash.
Returns
integer The hash code for the given floating-point number.
Link
|
abstract protected
integer
|
#
hashInteger( integer $value )
Returns a hash code for the given integer number.
Returns a hash code for the given integer number.
The resulting hash code is guaranteed to be consistent with the
PhpCommon\Comparison\Equivalence\GenericEquivalence::equivalentInteger() method, which means that for any references
$x and $y , if equivalentInteger($x, $y) , then
hashInteger($x) === hashInteger($y) .
Parameters
- $value
- The integer number to hash.
Returns
integer The hash code for the given integer number.
Link
|
abstract protected
integer
|
#
hashNull( )
Returns a hash code for the null value.
Returns a hash code for the null value.
Returns
integer The hash code for the NULL value.
Link
|
abstract protected
integer
|
#
hashObject( object $value )
Returns a hash code for the given object.
Returns a hash code for the given object.
The resulting hash code is guaranteed to be consistent with the
PhpCommon\Comparison\Equivalence\GenericEquivalence::equivalentObject() method, which means that for any references
$x and $y , if equivalentObject($x, $y) , then
hashObject($x) === hashObject($y) .
Parameters
- $value
- The object to hash.
Returns
integer The hash code for the given object.
Link
|
abstract protected
integer
|
#
hashResource( resource $value )
Returns a hash code for the given resource.
Returns a hash code for the given resource.
The resulting hash code is guaranteed to be consistent with the
PhpCommon\Comparison\Equivalence\GenericEquivalence::equivalentResource() method, which means that for any references
$x and $y , if equivalentResource($x, $y) , then
hashResource($x) === hashResource($y) .
Parameters
- $value
- The resource to hash.
Returns
integer The hash code for the given resource.
Link
|
abstract protected
integer
|
#
hashString( string $value )
Returns a hash code for the given string value.
Returns a hash code for the given string value.
The resulting hash code is guaranteed to be consistent with the
PhpCommon\Comparison\Equivalence\GenericEquivalence::equivalentString() method, which means that for any references
$x and $y , if equivalentString($x, $y) , then
hashString($x) === hashString($y) .
Parameters
- $value
- The string value to hash.
Returns
integer The hash code for the given object.
Link
|