ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ILIAS\HTTP\Wrapper\SuperGlobalDropInReplacement Class Reference

Class SuperGlobalDropInReplacement This Class wraps SuperGlobals such as $_GET and $_POST to prevent modifying them in a future version. More...

+ Inheritance diagram for ILIAS\HTTP\Wrapper\SuperGlobalDropInReplacement:
+ Collaboration diagram for ILIAS\HTTP\Wrapper\SuperGlobalDropInReplacement:

Public Member Functions

 __construct (Factory $factory, array $raw_values, bool $throwOnValueAssignment=false)
 
 offsetSet ($offset, $value)
 
 offsetUnset ($offset)
 
- Public Member Functions inherited from ILIAS\Refinery\KeyValueAccess
 __construct (array $raw_values, Transformation $trafo)
 
 offsetExists ($offset)
 
 offsetGet ($offset)
 
 offsetSet ($offset, $value)
 
 offsetUnset ($offset)
 
 count ()
 

Private Attributes

bool $throwOnValueAssignment
 

Detailed Description

Class SuperGlobalDropInReplacement This Class wraps SuperGlobals such as $_GET and $_POST to prevent modifying them in a future version.

Author
Fabian Schmid fs@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch

Definition at line 30 of file SuperGlobalDropInReplacement.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\HTTP\Wrapper\SuperGlobalDropInReplacement::__construct ( Factory  $factory,
array  $raw_values,
bool  $throwOnValueAssignment = false 
)

Member Function Documentation

◆ offsetSet()

ILIAS\HTTP\Wrapper\SuperGlobalDropInReplacement::offsetSet (   $offset,
  $value 
)

Definition at line 43 of file SuperGlobalDropInReplacement.php.

43  : 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  }

◆ offsetUnset()

ILIAS\HTTP\Wrapper\SuperGlobalDropInReplacement::offsetUnset (   $offset)

Definition at line 55 of file SuperGlobalDropInReplacement.php.

55  : void
56  {
57  throw new LogicException("Modifying global Request-Array such as \$_GET is not allowed!");
58  }

Field Documentation

◆ $throwOnValueAssignment

bool ILIAS\HTTP\Wrapper\SuperGlobalDropInReplacement::$throwOnValueAssignment
private

The documentation for this class was generated from the following file: