Skip to content

Commit

Permalink
checkpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaEstes committed Dec 4, 2023
1 parent eac078f commit 5ab4e95
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/SonsOfPHP/Contract/Cookie/CookieManagerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,39 @@
namespace SonsOfPHP\Contract\Cookie;

/**
* In more advanced applications, you may need to get/set multiple cookies
*
* @author Joshua Estes <joshua@sonsofphp.com>
*/
interface CookieManagerInterface
{
/**
* If a cookie does not exists, this will create a new Cookie object and
* return that.
*
* Example:
* $cookie = $manager->get('PHPSESSID');
*/
public function get(string $name): CookieInterface;

/**
* Checks to see if "$name" exists in the request cookies
*
* Example:
* if ($manager->has('PHPSESSID')) {
* // ...
* }
*/
public function has(string $name): bool;

/**
* Removes the cookie, this will remove from the browser as well
*
* If this return true, everything went ok, if it returns false, something
* is broken. If thise throws an exception, something really fucked up
* happened
*
* @throws CookieExceptionInterface
*/
public function remove(string $name): bool;
}

0 comments on commit 5ab4e95

Please sign in to comment.