Пример #1
0
try {
    $testRange2 = new Types\Range(2, 5);
    $fail = false;
} catch (\Exception $e) {
}
if ($fail) {
    echo "Failure!\n";
} else {
    echo "Success...\n";
}
echo "Set Maximum (7) -> ";
$success = true;
$val = null;
try {
    $testRange0->setMaximum(7);
    $val = $testRange0->getMaximum();
} catch (\Exception $e) {
    $success = false;
}
if ($success) {
    echo "Success!\n";
} else {
    echo "Failure...\n";
}
echo "Set Minimum (1) -> ";
$success = true;
$val = null;
try {
    $testRange0->setMinimum(1);
    $val = $testRange0->getMinimum();
} catch (\Exception $e) {
Пример #2
0
 /**
  * Get A Range Of Indexes
  * 
  * This gets an array of objects that have priorities between ranges
  * 
  * NOTE: The utility function must be used because of incompatibility
  *       of array_unique algorithm
  * 
  * @param Falcraft\Data\Types\Range $r The range to include
  * 
  * @return array The appropriate array
  * 
  */
 public function indexRange(Range $r)
 {
     return StandardResource\ArrayUtilities::returnUnique(array_merge($this->index($r->getMinimum(), self::HIGHER), $this->index($r->getMaximum(), self::LOWER)));
 }