8000 revert #6002 by Tobion · Pull Request #6004 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

revert #6002 #6004

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 2 commits into from
Closed

revert #6002 #6004

wants to merge 2 commits into from

Conversation

Tobion
Copy link
Contributor
@Tobion Tobion commented Nov 13, 2012

@vicb: There is reason why the author used current() because the index is not necessarily zero-indexed.

There is reason why the author used current() because the index is not necessarily zero-indexed.
@vicb
Copy link
Contributor
vicb commented Nov 13, 2012

I had replaced current() with reset() and added a test before I change the code w/o testing again... #6003 should be fine.

@vicb vicb closed this Nov 13, 2012
@Tobion
Copy link
Contributor Author
Tobion commented Nov 13, 2012

The test you added neither covers items[0] nor reset(). So items[0] did not fail. And what does reset() fix? It's not covered either.

@vicb
Copy link
Contributor
vicb commented Nov 14, 2012

Yes it is covered, check Travis reports (symfony/symfony).

@Tobion
Copy link
Contributor Author
Tobion commented Nov 14, 2012

Strange, it did not fail on my machine. I just recognised items[0] problem from reading.

fabpot added a commit that referenced this pull request Nov 14, 2012
This PR was merged into the master branch.

Commits
-------

f4b630d [HttpFoundation] fix #6002

Discussion
----------

[HttpFoundation] fix #6002

---------------------------------------------------------------------------

by fabpot at 2012-11-13T17:02:45Z

Can you add a test?

---------------------------------------------------------------------------

by Tobion at 2012-11-13T17:04:23Z

hehe see #6004 there is also a test

---------------------------------------------------------------------------

by vicb at 2012-11-13T17:05:06Z

There is a test in the original PR, no need for 6004.

---------------------------------------------------------------------------

by vicb at 2012-11-13T17:05:20Z

Which is why is was failing btw

---------------------------------------------------------------------------

by Tobion at 2012-11-13T17:06:36Z

The test in 6002 did not fail for me without your patch.

---------------------------------------------------------------------------

by fabpot at 2012-11-14T12:47:46Z

@Tobion @vicb What do we do? Just revert #6002 or merge this PR?

---------------------------------------------------------------------------

by vicb at 2012-11-14T13:25:51Z

Merge. Go go go :)

----- Reply message -----
De : "Fabien Potencier" <notifications@github.com>
Pour : "symfony/symfony" <symfony@noreply.github.com>
Cc : "Victor Berchet" <victor@suumit.com>
Objet : [symfony] [HttpFoundation] fix #6002 (#6003)
Date : mer., nov. 14, 2012 13:47
@Tobion @vicb What do we do? Just revert #6002 or merge this PR?

&mdash;

Reply to this email directly or view it on GitHub.

---------------------------------------------------------------------------

by Tobion at 2012-11-14T13:31:22Z

@vicb can you explain what it fixes? As I said, your test does not cover something that would fail without the patch. So I don't see the bug.

---------------------------------------------------------------------------

by vicb at 2012-11-14T15:30:55Z

@Tobion php.net states: The `current()` function simply returns the value of the array element that's currently being pointed to by the internal pointer and `reset()` returns the value of the first array element.

I have no clue what the "element that's currently being pointed to by the internal pointer" in this method so `reset()` is probably what you want.

Validated ?

---------------------------------------------------------------------------

by Tobion at 2012-11-14T16:12:03Z

I agree `reset()` is more explicit here. But `current()` should work just as well in this case because the array pointer can only be at the first item when calling the method. Anyway, this is good to merge. I just hoped there was a unit test that ensures this on my machine. This is why I added the test in my patch. Maybe Fabien can just merge the second commit on #6004

---------------------------------------------------------------------------

by vicb at 2012-11-14T16:20:57Z

As explained in #6004, there is already a test from my first PR that made Travis go red.
Sign up for free t 5934 o join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0