ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
SuperGlobalDropInReplacement.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 namespace ILIAS\HTTP\Wrapper;
6 
11 
12 /******************************************************************************
13  *
14  * This file is part of ILIAS, a powerful learning management system.
15  *
16  * ILIAS is licensed with the GPL-3.0, you should have received a copy
17  * of said license along with the source code.
18  *
19  * If this is not the case or you just want to try ILIAS, you'll find
20  * us at:
21  * https://www.ilias.de
22  * https://github.com/ILIAS-eLearning
23  *
24  *****************************************************************************/
31 {
33 
34  public function __construct(Factory $factory, array $raw_values, bool $throwOnValueAssignment = false)
35  {
36  $this->throwOnValueAssignment = $throwOnValueAssignment;
37  parent::__construct($raw_values, $factory->kindlyTo()->string());
38  }
39 
43  public function offsetSet($offset, $value): void
44  {
45  if ($this->throwOnValueAssignment) {
46  throw new OutOfBoundsException("Modifying global Request-Array such as \$_GET is not allowed!");
47  }
48 
49  parent::offsetSet($offset, $value);
50  }
51 
55  public function offsetUnset($offset): void
56  {
57  throw new LogicException("Modifying global Request-Array such as \$_GET is not allowed!");
58  }
59 }
__construct(Factory $factory, array $raw_values, bool $throwOnValueAssignment=false)
Class SuperGlobalDropInReplacement This Class wraps SuperGlobals such as $_GET and $_POST to prevent ...
__construct(Container $dic, ilPlugin $plugin)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
kindlyTo()
Combined validations and transformations for primitive data types that establish a baseline for furth...
Definition: Factory.php:59
$factory
Definition: metadata.php:75