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
Allow easier extension of the timezone guessing #548
Allow easier extension of the timezone guessing #548
Conversation
1804f18
to
02aa62b
Compare
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.
Hey Andreas,
Really like this direction. Do we have/need test coverage for this code?
Codecov Report
@@ Coverage Diff @@
## master #548 +/- ##
============================================
- Coverage 98.69% 98.34% -0.36%
- Complexity 1818 1848 +30
============================================
Files 66 71 +5
Lines 4454 4521 +67
============================================
+ Hits 4396 4446 +50
- Misses 58 75 +17
Continue to review full report at Codecov.
|
0cd54e2
to
c5f2bec
Compare
Should be good by now.. |
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.
just leaving a few comments. but lets wait what the other devs think.
* | ||
* Source: http://msdn.microsoft.com/en-us/library/aa563018(loband).aspx | ||
*/ | ||
public static $microsoftExchangeMap = [ |
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.
I am not sure we can drop this field, as other code might rely on it beeing defined.
there is more public api changed with this PR in a non-BC manner
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.
Right!. I'll readd those other public items to stay backwards compatible.
Main question though is whether I shall do it in a way that allows them to be easily removed at a later stage (meaning to duplicate some code) or to have as little duplicate code as possible.
Personally I'd opt for the former version but am happy to modify it to the later one.
@heiglandreas the code style is failing. It is easily fixed by:
and then commit and push the changes it makes. |
https://github.com/sabre-io/vobject/runs/4101303777?check_suite_focus=true The code analysis is fussy. Please fix that up. Note: I released https://github.com/sabre-io/vobject/releases/tag/4.3.6 an hour ago. But when we get this PR sorted out, it will be easy to make a 4.3.7 release. |
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.
Just a couple of tiny comments.
@staabm @evert @DeepDiver1975 please review and comment. |
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.
lgtm
This will ease customization of timezone-guessing as it is now gets easier to extend that process with own implementations (as long as they implement the appropriate interface) This is espechially necessary when wanting to actually guess a timezone via the rules defined in the VTIMEZONE-entry (which is currently not done)
43cde9b
to
87c8def
Compare
I squashed and rebased to get up-to-date clean CI. |
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.
LGTM. There is some discussion in PR #553 about tests to cover the functions addTimezoneGuesser
and addTimezoneFinder
but that can be left until later.
This will ease customization of timezone-guessing as it is now gets easier to extend that process with own implementations (as long as they implement the appropriate interface)
This is espechially necessary when wanting to actually guess a timezone via the rules defined in the VTIMEZONE-entry (which is currently not done)
This change does not introduce any new logic. It just rearranges the already existing code in a different way to allow creating own TimezoneGuessers that can extend the functionality like this:
Now every time a timezone is not resolvable the timezone will be resolved to
Europe/Busingen
instead ofUTC
(or whatever else is set viadate_default_timezone_set()
)