PHP Interface PSR7Sessions\Storageless\Session\SessionInterface

Inheritance: extends JsonSerializable
Afficher le fichier Open project: Ocramius/PSR7Session Interface Usage Examples

Méthodes publiques

Méthode Description
clear ( ) : void Clears the contents of the session
get ( string $key, integer | boolean | string | float | array | object | JsonSerializable $default = null ) : integer | boolean | string | float | array Retrieves a value from the session - if the value doesn't exist, then it uses the given $default, but transformed into a immutable and safely manipulated scalar or array
has ( string $key ) : boolean Checks whether a given key exists in the session
hasChanged ( ) : boolean Checks whether the session has changed its contents since its lifecycle start
isEmpty ( ) : boolean Checks whether the session contains any data
remove ( string $key ) : void Removes an item from the session
set ( string $key, integer | boolean | string | float | array | object | JsonSerializable $value ) : void Stores a given value in the session

Method Details

clear() public méthode

Clears the contents of the session
public clear ( ) : void
Résultat void

get() public méthode

Retrieves a value from the session - if the value doesn't exist, then it uses the given $default, but transformed into a immutable and safely manipulated scalar or array
public get ( string $key, integer | boolean | string | float | array | object | JsonSerializable $default = null ) : integer | boolean | string | float | array
$key string
$default integer | boolean | string | float | array | object | JsonSerializable
Résultat integer | boolean | string | float | array

has() public méthode

Checks whether a given key exists in the session
public has ( string $key ) : boolean
$key string
Résultat boolean

hasChanged() public méthode

Checks whether the session has changed its contents since its lifecycle start
public hasChanged ( ) : boolean
Résultat boolean

isEmpty() public méthode

Checks whether the session contains any data
public isEmpty ( ) : boolean
Résultat boolean

remove() public méthode

Removes an item from the session
public remove ( string $key ) : void
$key string
Résultat void

set() public méthode

Stores a given value in the session
public set ( string $key, integer | boolean | string | float | array | object | JsonSerializable $value ) : void
$key string
$value integer | boolean | string | float | array | object | JsonSerializable allows any nested combination of the previous types as well
Résultat void