Skip to content

Commit 749f063

Browse files
committed
Only HttpCookies
1 parent bcb8c70 commit 749f063

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

src/Plugin/Cookies.php

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55

66
namespace Valar\Plugin;
77

8-
use Mvc5\Plugin\GlobalVar;
8+
use Mvc5\Cookie\HttpCookies;
9+
use Mvc5\Plugin\ScopedCall;
910
use Mvc5\Plugin\Shared;
1011

1112
class Cookies
@@ -16,6 +17,16 @@ class Cookies
1617
*/
1718
function __construct(string $name = 'cookies')
1819
{
19-
parent::__construct($name, new GlobalVar('_COOKIE'));
20+
parent::__construct($name, new ScopedCall($this));
21+
}
22+
23+
/**
24+
* @return \Closure
25+
*/
26+
function __invoke() : \Closure
27+
{
28+
return function() {
29+
return new HttpCookies($_COOKIE);
30+
};
2031
}
2132
}

0 commit comments

Comments
 (0)