ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
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 (mixed $offset, mixed $value)
 
 offsetUnset (mixed $offset)
 
- Public Member Functions inherited from ILIAS\Refinery\KeyValueAccess
 __construct (array $raw_values, Transformation $trafo)
 
 offsetExists (mixed $offset)
 
 offsetGet (mixed $offset)
 
 offsetSet (mixed $offset, mixed $value)
 
 offsetUnset (mixed $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 33 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 ( mixed  $offset,
mixed  $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 ( mixed  $offset)

Definition at line 52 of file SuperGlobalDropInReplacement.php.

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

Field Documentation

◆ $throwOnValueAssignment

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

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