Lines Matching defs:values

79     function __construct($values) {
80 $this->values = $values;
84 if(array_key_exists($name, $this->values)) {
85 return $this->values[$name];
95 return isset($this->values[$offset]) || ($offset >= 0 && $offset < count($this->values));
100 if (isset($this->values[$offset])) {
101 return $this->values[$offset];
104 if(is_numeric($offset) && $offset >= 0 && $offset < count($this->values)) {
106 $keys = array_keys($this->values);
107 return $this->values[$keys[intval($offset)]];
944 * Sets all properties given as '$properties' to the values parsed from '$trees'.
947 * values. Such specification is an array that may have the following keys, with the
948 * described values:
949 * - choices: array of possible values, where the keys are the internally used values
950 * and the values specify synonyms for the choice, of which the first listed one
954 * - pattern: regular expression that defines all possible values.
956 * - minOccur: positive integer specifying the minimum number of values, defaults to 1.
958 * number of values, defaults to minOccur.
962 * Either 'choices' or 'pattern' must be set (not both), all other values are optional.
979 * @param $trees The trees that contain the values for these properties.
980 * @return An array with as indices the property names and as value a list of all values given for that property.
1021 $values = implode(', ', array_map(function ($c) {
1024 $title = sprintf($property_title_values, $values);
1037 $values = array_map('utf8_trim', explode(',', $value));
1040 $values = array_fill(0, $minOccur, $value);
1047 if (count($values) < $minOccur || count($values) > $maxOccur) {
1048 // Number of values given differs from expected number
1050 $this->emitError($region, 'error_property_occur', hsc($group), hsc($variable), $minOccur, count($values));
1052 $this->emitError($region, 'error_property_occurrange', hsc($group), hsc($variable), $minOccur, $maxOccur, count($values));
1054 } else if (isset($p['choices'])) { // Check whether the given property values are valid choices
1072 $incorrect = array_diff($values, array_keys($choices)); // Find all values that are not a valid choice
1079 $propertyValues[$variable] = array_map(function($v) use ($choices) { return $choices[$v]; }, $values);
1081 } else if (isset($p['pattern'])) { // Check whether the given property values match the pattern
1082 $incorrect = array_filter($values, function($v) use ($p) { return !preg_match($p['pattern'], $v); });
1092 $propertyValues[$variable] = $values;
1095 $propertyValues[$variable] = $values;