Skip to content

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

Closed
wants to merge 3 commits into from
Closed

Conversation

takman1
Copy link
Contributor

@takman1 takman1 commented Nov 19, 2017

Another way to clear client's history.

Another way to clear client's history.
Copy link
Member

@javiereguiluz javiereguiluz left a 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!

@takman1
Copy link
Contributor Author

takman1 commented Nov 20, 2017

Hello @javiereguiluz and thanks for your reply.

I get your point on over explaining things.
The point is that restart() method does 2 things :

  • Clearing the history
  • Removing all cookies.

IMHO I think we should have 2 examples 1 for each case (history and cookies). The reader gets whta's under the hood.
But keeping restart() method is also fine as it keeps things simple.

@javiereguiluz
Copy link
Member

I agree with you. We could document this clear() method and change the existing doc for restart(). Something like 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()
$client->restart();
// which internally calls history->clear() and cookieJar->clear()
Copy link
Member

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.
@javiereguiluz
Copy link
Member

Thanks @takman1.

javiereguiluz added a commit that referenced this pull request Jan 2, 2018
This PR was squashed before being merged into the 3.3 branch (closes #8704).

Discussion
----------

Client's history clear alternative

Another way to clear client's history.

Commits
-------

153b7f7 Client's history clear alternative
xabbuh pushed a commit that referenced this pull request Jan 2, 2018
This PR was squashed before being merged into the 3.3 branch (closes #8704).

Discussion
----------

Client's history clear alternative

Another way to clear client's history.

Commits
-------

153b7f7 Client's history clear alternative
javiereguiluz added a commit to javiereguiluz/symfony-docs that referenced this pull request Jan 3, 2018
* 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
javiereguiluz added a commit to javiereguiluz/symfony-docs that referenced this pull request Jan 3, 2018
* 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
javiereguiluz added a commit to javiereguiluz/symfony-docs that referenced this pull request Jan 3, 2018
* 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
javiereguiluz added a commit to javiereguiluz/symfony-docs that referenced this pull request Jan 3, 2018
* 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
javiereguiluz added a commit to javiereguiluz/symfony-docs that referenced this pull request Jan 3, 2018
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants