TYPO3  7.6
Public Member Functions | List of all members
NumberComparator Class Reference
Inheritance diagram for NumberComparator:
Comparator

Public Member Functions

 __construct ($test)
 
- Public Member Functions inherited from Comparator
 getTarget ()
 
 setTarget ($target)
 
 getOperator ()
 
 setOperator ($operator)
 
 test ($test)
 

Detailed Description

NumberComparator compiles a simple comparison to an anonymous subroutine, which you can call with a value to be tested again.

Now this would be very pointless, if NumberCompare didn't understand magnitudes.

The target value may use magnitudes of kilobytes (k, ki), megabytes (m, mi), or gigabytes (g, gi). Those suffixed with an i use the appropriate 2**n version in accordance with the IEC standard: http://physics.nist.gov/cuu/Units/binary.html

Based on the Perl Number::Compare module.

Author
Fabien Potencier fabie.nosp@m.n@sy.nosp@m.mfony.nosp@m..com PHP port
Richard Clamp richa.nosp@m.rdc@.nosp@m.unixb.nosp@m.eard.nosp@m..net Perl version
See Also
http://physics.nist.gov/cuu/Units/binary.html

Definition at line 35 of file NumberComparator.php.

Constructor & Destructor Documentation

__construct (   $test)

Constructor.

Parameters
string$testA comparison string
Exceptions
\InvalidArgumentExceptionIf the test is not understood

Definition at line 44 of file NumberComparator.php.

References Comparator\$target, Comparator\setOperator(), and Comparator\setTarget().