Skip to content
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

Refactor polyline #7

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open

Refactor polyline #7

wants to merge 15 commits into from

Conversation

martinlindhe
Copy link
Contributor

This patch series reworks the internals a little bit, mostly around the polyline() method and splits it in 3 methods.

Notice: before this patch series, phpunit reports 100% code coverage. But i believe this is actually phpunit being buggy. Reworking the code now shows 2 spots uncovered by tests:

  1. the polyline('nodename', 'encodedstring') case was not covered by a test, the code path turned red (uncovered) when refactored. I tried make a test case for this, but it does not seem to agree. Either there is a bug in that code path, or my test is wrong. The method returns an array of multiple points, rather than what i expected, an array containing arrays with lat,long pairs.

  2. the Pair(null) case was not covered by a test: single line: if (!is_array($list)) { return $pairs; } turned red (uncovered) when rewritten to multi line

Martin Lindhe and others added 15 commits July 12, 2014 11:20
  62 | ERROR | [x] Opening brace should be on a new line
  62 | ERROR | [ ] Closing brace must be on a line by itself
  69 | ERROR | [x] Opening brace should be on a new line
  85 | ERROR | [x] No space found after comma in function call
  85 | ERROR | [x] No space found after comma in function call
  87 | ERROR | [x] No space found after comma in function call
  88 | ERROR | [x] No space found after comma in function call
  88 | ERROR | [x] No space found after comma in function call
  91 | ERROR | [x] No space found after comma in function call
 107 | ERROR | [x] No space found after comma in function call
 164 | ERROR | [ ] Variable "encoded_string" is not in valid camel caps format
 167 | ERROR | [ ] Expected "foreach (...) {\n"; found "foreach(...) {\n"
 176 | ERROR | [ ] Expected "while (...) {\n"; found "while(...) {\n"
 181 | ERROR | [ ] Variable "encoded_string" is not in valid camel caps format
 183 | ERROR | [ ] Variable "encoded_string" is not in valid camel caps format
 201 | ERROR | [x] No space found after comma in function call
 224 | ERROR | [ ] Expected "foreach (...) {\n"; found "foreach(...) {\n"
 226 | ERROR | [x] No space found after comma in function call
 243 | ERROR | [ ] Expected "if (...) {\n"; found "if(...) { "
 243 | ERROR | [ ] Closing brace must be on a line by itself
  26 | ERROR | [x] No space found after comma in function call
  38 | ERROR | [x] No space found after comma in function call
  39 | ERROR | [x] No space found after comma in function call
  41 | ERROR | [x] No space found after comma in function call
  51 | ERROR | [x] No space found after comma in function call
  51 | ERROR | [x] No space found after comma in function call
  52 | ERROR | [x] No space found after comma in function call
  62 | ERROR | [x] No space found after comma in function call
  63 | ERROR | [x] No space found after comma in function call
  85 | ERROR | [x] No space found after comma in function call
  95 | ERROR | [x] No space found after comma in function call
 116 | ERROR | [x] No space found after comma in function call
 129 | ERROR | [x] No space found after comma in function call
Sign up for free to 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.

1 participant