ILIAS  trunk Revision v11.0_alpha-1811-gd2d5443e411
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilForumRequestTrait.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
24 {
25  private function retrieveIntOrZeroFrom(ArrayBasedRequestWrapper $wrapper, string $param): int
26  {
27  if ($wrapper->has($param)) {
28  return $wrapper->retrieve(
29  $param,
30  $this->refinery->byTrying([
31  $this->refinery->kindlyTo()->int(),
32  $this->refinery->custom()->transformation(
33  static fn($value): int => $value === '' ? 0 : $value
34  )
35  ])
36  );
37  }
38 
39  return 0;
40  }
41 }
$param
Definition: xapitoken.php:46