-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add "Contract" directory, deprecate "SessionInterface"
- Loading branch information
Showing
6 changed files
with
62 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
|
||
namespace Rougin\Weasley\Contract; | ||
|
||
/** | ||
* Session Interface | ||
* | ||
* @package Weasley | ||
* @author Rougin Gutib <rougingutib@gmail.com> | ||
*/ | ||
interface Session | ||
{ | ||
/** | ||
* Returns the value from the specified key. | ||
* | ||
* @param string $key | ||
* @return boolean | ||
*/ | ||
public function delete($key); | ||
|
||
/** | ||
* Returns the value from the specified key. | ||
* | ||
* @param string $key | ||
* @param mixed|null $default | ||
* @return mixed | ||
*/ | ||
public function get($key, $default = null); | ||
|
||
/** | ||
* Updates the current session ID with a newly generated one. | ||
* | ||
* @param boolean $delete | ||
* @return boolean | ||
*/ | ||
public function regenerate($delete = false); | ||
|
||
/** | ||
* Sets the value to the specified key. | ||
* | ||
* @param string $key | ||
* @param mixed $value | ||
* @return self | ||
*/ | ||
public function set($key, $value); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters