ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilForumRequestTrait.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
23trait ilForumRequestTrait
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}
retrieve(string $key, Transformation $transformation)
@inheritDoc
$param
Definition: xapitoken.php:46