Releases: phpgt/Cookie
Multi-build CI runners
What's Changed
- Bump phpunit/phpunit from 8.2.5 to 8.3.5 by @dependabot-preview in #44
- Bump phpunit/phpunit from 8.3.5 to 8.4.2 by @dependabot-preview in #47
- Update readme badges by @g105b in #48
- Bump phpunit/phpunit from 8.4.2 to 8.4.3 by @dependabot-preview in #49
- Bump phpunit/phpunit from 8.4.3 to 8.5.3 by @dependabot-preview in #53
- Improve CI by @g105b in #63
- Bump phpstan/phpstan from 0.12.64 to 0.12.71 by @dependabot-preview in #71
- Bump phpunit/phpunit from 9.5.0 to 9.5.1 by @dependabot-preview in #67
- Bump phpunit/phpunit from 9.5.1 to 9.5.2 by @dependabot-preview in #72
- Bump phpstan/phpstan from 0.12.71 to 0.12.73 by @dependabot-preview in #73
- Bump phpstan/phpstan from 0.12.73 to 0.12.74 by @dependabot-preview in #74
- Bump phpstan/phpstan from 0.12.74 to 0.12.75 by @dependabot-preview in #75
- Bump phpstan/phpstan from 0.12.75 to 0.12.76 by @dependabot-preview in #76
- Bump phpstan/phpstan from 0.12.76 to 0.12.77 by @dependabot-preview in #77
- Bump phpstan/phpstan from 0.12.77 to 0.12.78 by @dependabot-preview in #78
- Bump phpstan/phpstan from 0.12.78 to 0.12.79 by @dependabot-preview in #79
- Bump phpstan/phpstan from 0.12.79 to 0.12.80 by @dependabot-preview in #80
- Bump phpstan/phpstan from 0.12.80 to 0.12.81 by @dependabot-preview in #81
- Bump phpstan/phpstan from 0.12.81 to 0.12.82 by @dependabot-preview in #83
- Bump phpunit/phpunit from 9.5.2 to 9.5.3 by @dependabot-preview in #82
- Bump phpunit/phpunit from 9.5.3 to 9.5.4 by @dependabot-preview in #84
- Bump phpstan/phpstan from 0.12.82 to 0.12.83 by @dependabot-preview in #85
- Bump phpstan/phpstan from 0.12.83 to 0.12.84 by @dependabot-preview in #86
- Upgrade to GitHub-native Dependabot by @dependabot-preview in #88
- Bump phpunit/phpunit from 9.5.4 to 9.5.5 by @dependabot in #92
- Update composer.json by @g105b in #94
- Bump phpstan/phpstan from 0.12.84 to 0.12.89 by @dependabot in #93
- build: hard dependencies by @g105b in #170
- Dependabot by @g105b in #179
- ci by @g105b in #207
New Contributors
- @g105b made their first contribution in #48
- @dependabot made their first contribution in #92
Full Changelog: v1.0.2...v1.0.3
Cookie::__toString
A simple release, but one that includes a missing feature: the ability to pass Cookie objects into functions that typehint string parameters.
Also:
- Faster unit test execution
- No development dependencies (cleaner tree, faster install)
Array conversion and clearing of cookies
Some areas of code are not always under your control, and if an area of code expects to see the cookies in an associative array call the asArray
method.
More importantly, it's now possible to clear all or specific cookies by using the clear()
function, passing in any cookie names that you want to remove.
v1 release
The repository has been in use for many months now, but has not made a v1 release until now because of a tricky bug that only occurred every so often in the unit tests.
The bug was caused by using in_array
without the strict type flag. This was only a bug in the unit tests, so no new functionality has been added or changed to mark the stable release.
Fully tested
The final backwards-breaking change is that the path of a cookie is now always hard-coded to "/" - as setting a cookie per-directory is not recommended behaviour and can lead to confusing side effects.
There are a few integration tests to be made on this simple repository before it is released as v1.0.0, but until then there will be no backwards-breaking changes introduced.
Documentation update
v0.1.1 Update CONTRIBUTING.md
CookieHandler complete
The CookieHandler
class is what is used to interface with cookies, and behaves just like the $_COOKIE
superglobal so it is easy to get used to.
- ArrayAccess to get quick access to cookie values.
- get, set, has, delete methods for OOP usage.
Cookie object implemented
The Cookie object is a very simple object that acts as a representation of a key value pair, but with the immutable object pattern to avoid other classes editing their value on-the-fly.
"The practice by which changes result in a new instance is termed immutability, and is a feature designed to ensure the integrity of a given value".
This is important with Cookies, because once they are set on the Request/Response, they object representation shouldn't be changed without being set again.