PHP Class Symfony\Component\Translation\Interval

An interval can represent a finite set of numbers: {1,2,3,4} An interval can represent numbers between two numbers: [1, +Inf] ]-1,2[ The left delimiter can be [ (inclusive) or ] (exclusive). The right delimiter can be [ (exclusive) or ] (inclusive). Beside numbers, you can use -Inf and +Inf for the infinite.
See also: http://en.wikipedia.org/wiki/Interval_%28mathematics%29#The_ISO_notation
Author: Fabien Potencier ([email protected])
Exibir arquivo Open project: pmjones/php-framework-benchmarks Class Usage Examples

Public Methods

Method Description
getIntervalRegexp ( ) : string Returns a Regexp that matches valid intervals.
test ( integer $number, string $interval ) Tests if the given number is in the math interval.

Private Methods

Method Description
convertNumber ( $number )

Method Details

getIntervalRegexp() public static method

Returns a Regexp that matches valid intervals.
public static getIntervalRegexp ( ) : string
return string A Regexp (without the delimiters)

test() public static method

Tests if the given number is in the math interval.
public static test ( integer $number, string $interval )
$number integer A number
$interval string An interval