-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Client's history clear alternative #8704
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Another way to clear client's history.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@takman1 thanks for this contribution!
We generally try to avoid explaining multiple ways of doing the same thing. The problem is that doing it makes users wonder which is the best way and which one should they use in their apps.
So, about this proposal: are restart()
and getHistory()->clear()
equivalent? Does restart() do more things?
Depending on the answers we should:
- Remove restart() and only explain clear()
- Reword the explanation of restart() and add clear() as something different
- Keep restart() and not document clear()
Thanks!
Hello @javiereguiluz and thanks for your reply. I get your point on over explaining things.
IMHO I think we should have 2 examples 1 for each case (history and cookies). The reader gets whta's under the hood. |
I agree with you. We could document this // -- Before --------------------------
// delete history
$client->restart();
// -- After ---------------------------
// reinitializes the browser state (history and cookies are deleted)
$client->restart(); |
Precise that client->restart() calls history->clear() and cookieJar->clear()
components/browser_kit.rst
Outdated
$client->restart(); | ||
// which internally calls history->clear() and cookieJar->clear() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure about this line:
which internally calls history->clear() and cookieJar->clear()
It explains an internal coding details (which makes docs hard to maintain). And we already explain above that this clears cookies and history, so maybe it's unneeded. Thanks!
Better maintainability with simpler comment.
Thanks @takman1. |
* 2.7: Improved the example to generate URLs in the console minor symfony#8704 Client's history clear alternative (takman1) use the ref role instead of URLs
* 2.8: Fixes and simplifications Improve routing debug page Improved the example to generate URLs in the console minor symfony#8704 Client's history clear alternative (takman1) use the ref role instead of URLs
* 3.3: Fixes and simplifications Improve routing debug page Improved the example to generate URLs in the console minor symfony#8704 Client's history clear alternative (takman1) [Serializer] Add new default normalizers use the ref role instead of URLs
* 3.4: Fixed a typo Fixes and simplifications Improve routing debug page Improved the example to generate URLs in the console Minor typo minor symfony#8704 Client's history clear alternative (takman1) [Serializer] Add new default normalizers use the ref role instead of URLs Update timezone.rst Update timezone.rst
* 4.0: Fixed a typo Improved the guide about upgrading apps to Flex Recommend to use PHPUnitBridge instead of PHPUnit Fixes and simplifications Improve routing debug page Improved the example to generate URLs in the console Minor typo minor symfony#8704 Client's history clear alternative (takman1) [Serializer] Add new default normalizers use the ref role instead of URLs Update timezone.rst Update timezone.rst
Another way to clear client's history.