Comparator\NumberComparator (Component\Finder)
Symfony\Component\Finder\Comparator\NumberComparator
class NumberComparator extends Comparator
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.
Methods
string | getTarget() Gets the target value. | from Comparator |
setTarget(string $target) Sets the target value. | from Comparator | |
string | getOperator() Gets the comparison operator. | from Comparator |
setOperator(string $operator) Sets the comparison operator. | from Comparator | |
bool | test(mixed $test) Tests against the target. | from Comparator |
__construct(string $test) Constructor. |
Details
public string getTarget()
Gets the target value.
public setTarget(string $target)
Sets the target value.
public string getOperator()
Gets the comparison operator.
public setOperator(string $operator)
Sets the comparison operator.
public bool test(mixed $test)
Tests against the target.
public __construct(string $test)
Constructor.
© 2004–2016 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/3.0/Symfony/Component/Finder/Comparator/NumberComparator.html