yiisoft / cookies Goto Github PK
View Code? Open in Web Editor NEWConvenient way to use cookies with PSR-7
Home Page: https://www.yiiframework.com/
License: BSD 3-Clause "New" or "Revised" License
Convenient way to use cookies with PSR-7
Home Page: https://www.yiiframework.com/
License: BSD 3-Clause "New" or "Revised" License
I'm part of the Flarum software project and we are currently looking at replacing our existing cookie library because it lacks PHP 8.0 support and because it hasn't been updated properly in at least 2 years. This library appears to be the perfect replacement, however because it lacks tags/releases we are unable to use it.
Is there any chance that tags/releases could be done for this library so that other projects can use it properly without warnings about stability and other issues?
Line 175 in bbbb27e
Не лучше ли вынести $new в свойство основного объекта?
Это даст возможность chain code вида:
$cookie->new->withValue('test')->expire();
I'm shocked when reading this code
$cookie = (new \Yiisoft\Cookies\Cookie('cookieName', 'value'))
->withPath('/')
->withDomain('yiiframework.com')
->withHttpOnly(true)
->withSecure(true)
->withSameSite(\Yiisoft\Cookies\Cookie::SAME_SITE_STRICT)
->withMaxAge(new \DateInterval('P7D'));
this code, create 1 Cookie object with 6 object clone
every method with "with" prefix allways use clone to create object
what is the purpose?
Fail tests:
1) Yiisoft\Cookies\Tests\CookieTest::testFromCookieString with data set #0 ('sessionId=e8bb43229de9; Domai...traKey', Yiisoft\Cookies\Cookie Object (...))
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
-'sessionId=e8bb43229de9; Expires=Tue, 12 Sep 20[23](https://github.com/yiisoft/cookies/actions/runs/6158986545/job/16712880188#step:9:24) 12:50:00 GMT; Max-Age=3599; Domain=foo.example.com; Path=/test; Secure; HttpOnly; SameSite=Strict'
+'sessionId=e8bb43229de9; Expires=Tue, 12 Sep 2023 12:50:01 GMT; Max-Age=3600; Domain=foo.example.com; Path=/test; Secure; HttpOnly; SameSite=Strict'
/home/runner/work/cookies/cookies/tests/CookieTest.php:[24](https://github.com/yiisoft/cookies/actions/runs/6158986545/job/16712880188#step:9:25)8
phpvfscomposer:///home/runner/work/cookies/cookies/vendor/phpunit/phpunit/phpunit:106
2) Yiisoft\Cookies\Tests\CookieTest::testFromCookieString with data set #2 ('sessionId=e8bb432[29](https://github.com/yiisoft/cookies/actions/runs/6158986545/job/16712880188#step:9:30)de9; Domai...ge=bla', Yiisoft\Cookies\Cookie Object (...))
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
-'sessionId=e8bb4[32](https://github.com/yiisoft/cookies/actions/runs/6158986545/job/16712880188#step:9:33)29de9; Expires=Tue, 12 Sep 2023 11:50:00 GMT; Max-Age=-1; Domain=foo.example.com=test'
+'sessionId=e8bb43229de9; Expires=Tue, 12 Sep 2023 11:50:01 GMT; Max-Age=0; Domain=foo.example.com=test'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.