Lines Matching refs:value

62             $check_utf8 = static function ($value, $key): void {
66 if (is_string($value) && preg_match('//u', $value) !== 1) {
128 $this->rules[] = static function (int|null $value) use ($minimum, $maximum): int|null {
129 if (is_int($value) && $value >= $minimum && $value <= $maximum) {
130 return $value;
146 …his->rules[] = static fn (int|string|null $value): int|string|null => in_array($value, $values, tr…
166 …$this->rules[] = static fn (string|null $value): string|null => $value !== null && $value !== '' ?…
178 $this->rules[] = static function (string|null $value) use ($base_url): string|null {
179 if ($value !== null) {
180 $value_info = parse_url($value);
191 return $value;
207 $this->rules[] = static function (string|null $value): string|null {
208 if ($value !== null && preg_match('/^' . Gedcom::REGEX_TAG . '$/', $value) === 1) {
209 return $value;
223 $this->rules[] = static function ($value) {
224 if (is_string($value) && preg_match('/^' . Gedcom::REGEX_XREF . '$/', $value) === 1) {
225 return $value;
228 if (is_array($value)) {
229 foreach ($value as $v) {
235 return $value;
252 $value = $this->parameters[$parameter] ?? null;
254 if (in_array($value, ['1', 'on', true], true)) {
258 if (in_array($value, ['0', '', false], true)) {
276 $value = $this->parameters[$parameter] ?? null;
278 if (!is_array($value) && $value !== null) {
282 $callback = static fn (array|null $value, Closure $rule): array|null => $rule($value);
284 return array_reduce($this->rules, $callback, $value) ?? [];
295 $value = $this->parameters[$parameter] ?? null;
297 if (is_numeric($value)) {
298 $value = (float) $value;
300 $value = null;
303 $callback = static fn (?float $value, Closure $rule): float|null => $rule($value);
305 $value = array_reduce($this->rules, $callback, $value) ?? $default;
307 if ($value === null) {
311 return $value;
322 $value = $this->parameters[$parameter] ?? null;
324 if (is_string($value)) {
325 if (ctype_digit($value)) {
326 $value = (int) $value;
327 } elseif (str_starts_with($value, '-') && ctype_digit(substr($value, 1))) {
328 $value = (int) $value;
332 if (!is_int($value)) {
333 $value = null;
336 $callback = static fn (int|null $value, Closure $rule): int|null => $rule($value);
338 $value = array_reduce($this->rules, $callback, $value) ?? $default;
340 if ($value === null) {
344 return $value;
354 $value = $this->parameters[$parameter] ?? null;
356 if ($value instanceof Route) {
357 return $value;
371 $value = $this->parameters[$parameter] ?? null;
373 if (!is_string($value)) {
374 $value = null;
377 $callback = static fn (string|null $value, Closure $rule): string|null => $rule($value);
379 $value = array_reduce($this->rules, $callback, $value) ?? $default;
381 if ($value === null) {
385 return $value;
395 $value = $this->parameters[$parameter] ?? null;
397 if ($value instanceof Tree) {
398 return $value;
406 $value = $this->parameters[$parameter] ?? null; variable in Fisharebest\\Webtrees\\Validator
408 if ($value === null || $value instanceof Tree) {
409 return $value; variable in Fisharebest\\Webtrees\\Validator
417 $value = $this->parameters[$parameter] ?? null;
419 if ($value instanceof UserInterface) {
420 return $value;