ILIAS  trunk Revision v11.0_alpha-1715-g7fc467680fb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ScalarTypeCheckAware.php
Go to the documentation of this file.
1 <?php
2 
19 namespace ILIAS\FileUpload;
20 
36 {
46  private function stringTypeCheck(string $variable, string $name): void
47  {
48  if (!is_string($variable)) {
49  $varType = gettype($variable);
50  throw new \InvalidArgumentException("The $name must be of type string but $varType was given.");
51  }
52  }
53 
54 
64  private function intTypeCheck(int $variable, string $name): void
65  {
66  if (!is_int($variable)) {
67  $varType = gettype($variable);
68  throw new \InvalidArgumentException("The $name must be of type integer but $varType was given.");
69  }
70  }
71 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...