Documentation

Base
in package

A class that provides helpers for accessing form data

Table of Contents

$super  : array<, mixed>
$which  : int
__construct()  : mixed
Constructor
exists()  : bool
Is the key in the array?
mustExist()  : bool
Is the key in the array?
getSuper()  : array<, mixed>
Return the relevant Superglobal

Properties

$super

protected array<, mixed> $super

The array that contains the relevant values. It is protected rather than private as some items do not have Superglobals and set this value to an array;

$which

protected int $which

Indicates which Superglobal we are using

Methods

__construct()

Constructor

public __construct(int|null $which) : mixed
Parameters
$which : int|null

The appropriate INPUT_ filter or NULL (which will be for PUT/PATCH...)

Return values
mixed

exists()

Is the key in the array?

public exists(mixed $name) : bool
Parameters
$name : mixed

The keys

Tags
TODO

Fix the need for two calls. They are there because getval does an array check which is not relevant for an existence check. We need a three valued boolean :-)

Return values
bool

mustExist()

Is the key in the array?

public mustExist(mixed $name) : bool
Parameters
$name : mixed

The keys

Tags
TODO

Fix the need for two calls. They are there because getval does an array check which is not relevant for an existence check. We need a three valued boolean :-)

throws
BadValue
Return values
bool

getSuper()

Return the relevant Superglobal

protected getSuper([int $which = NULL ]) : array<, mixed>

@TODO Change this to use match() when PHP 8 is released

Parameters
$which : int = NULL

@return array

Return values
array<, mixed>

Search results