Skip to content

Commit d3050e4

Browse files
committed
feat: update session to match new documentation
1 parent 380227b commit d3050e4

File tree

5 files changed

+18
-58
lines changed

5 files changed

+18
-58
lines changed

.github/FUNDING.yml

Lines changed: 0 additions & 4 deletions
This file was deleted.

.github/workflows/php-cs-fixer.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

.github/workflows/tests.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

src/Flash.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,14 @@ public static function unset(string $key = null)
7070
Session::set(static::$config['key'], $data);
7171
}
7272

73+
/**
74+
* Manually remove set flash message
75+
*/
76+
public static function remove(): void
77+
{
78+
return static::unset('default');
79+
}
80+
7381
/**
7482
* Get the flash array
7583
*

src/Http/Session.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,11 @@ public static function get($param, $default = null, bool $sanitize = true)
5353
*
5454
* @param string $key the key to retrieve and remove the value for
5555
* @param mixed $defaultValue the default value to return if the requested value cannot be found
56+
* @param boolean $sanitize Whether to sanitize the returned value
5657
*
5758
* @return mixed the requested value or the default value
5859
*/
59-
public static function retrieve($key, $default = null, $sanitize = false)
60+
public static function retrieve($key, $default = null, $sanitize = true)
6061
{
6162
static::start();
6263

@@ -78,6 +79,14 @@ public static function body()
7879
return $_SESSION;
7980
}
8081

82+
/**
83+
* Get all session variables as an array
84+
*/
85+
public static function all(): array
86+
{
87+
return static::body();
88+
}
89+
8190
/**
8291
* Set a new session variable
8392
*

0 commit comments

Comments
 (0)