MediaWiki  1.23.8
CLDRPluralRuleEvaluator_Range.php
Go to the documentation of this file.
1 <?php
21  public $parts = array();
22 
29  function __construct( $start, $end = false ) {
30  if ( $end === false ) {
31  $this->parts[] = $start;
32  } else {
33  $this->parts[] = array( $start, $end );
34  }
35  }
36 
44  function isNumberIn( $number, $integerConstraint = true ) {
45  foreach ( $this->parts as $part ) {
46  if ( is_array( $part ) ) {
47  if ( ( !$integerConstraint || floor( $number ) === (float)$number )
48  && $number >= $part[0] && $number <= $part[1]
49  ) {
50  return true;
51  }
52  } else {
53  if ( $number == $part ) {
54  return true;
55  }
56  }
57  }
58  return false;
59  }
60 
68  function isNumberWithin( $number ) {
69  return $this->isNumberIn( $number, false );
70  }
71 
78  function add( $other ) {
79  if ( $other instanceof self ) {
80  $this->parts = array_merge( $this->parts, $other->parts );
81  } else {
82  $this->parts[] = $other;
83  }
84  }
85 
92  function __toString() {
93  $s = 'Range(';
94  foreach ( $this->parts as $i => $part ) {
95  if ( $i ) {
96  $s .= ', ';
97  }
98  if ( is_array( $part ) ) {
99  $s .= $part[0] . '..' . $part[1];
100  } else {
101  $s .= $part;
102  }
103  }
104  $s .= ')';
105  return $s;
106  }
107 
108 }
php
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
Definition: skin.txt:62
$s
$s
Definition: mergeMessageFileList.php:156
CLDRPluralRuleEvaluator_Range\$parts
array $parts
The parts.
Definition: CLDRPluralRuleEvaluator_Range.php:20
CLDRPluralRuleEvaluator_Range
Evaluator helper class representing a range list.
Definition: CLDRPluralRuleEvaluator_Range.php:15
array
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
CLDRPluralRuleEvaluator_Range\isNumberIn
isNumberIn( $number, $integerConstraint=true)
Determine if the given number is inside the range.
Definition: CLDRPluralRuleEvaluator_Range.php:43
CLDRPluralRuleEvaluator_Range\isNumberWithin
isNumberWithin( $number)
Readable alias for isNumberIn( $number, false ), and the implementation of the "within" operator.
Definition: CLDRPluralRuleEvaluator_Range.php:67
CLDRPluralRuleEvaluator_Range\__construct
__construct( $start, $end=false)
Initialize a new instance of CLDRPluralRuleEvaluator_Range.
Definition: CLDRPluralRuleEvaluator_Range.php:28
as
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
Definition: distributors.txt:9
CLDRPluralRuleEvaluator_Range\__toString
__toString()
Returns the string representation of the rule evaluator range.
Definition: CLDRPluralRuleEvaluator_Range.php:91
CLDRPluralRuleEvaluator_Range\add
add( $other)
Add another part to this range.
Definition: CLDRPluralRuleEvaluator_Range.php:77