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

Simplify calendar model detection code #68

Merged
merged 1 commit into from
May 16, 2015
Merged

Conversation

thiemowmde
Copy link
Contributor

As discussed in #66 (comment). This is pure refactoring that doesn't change any semantics. Instead of first re-concatenating sign and year, both are checked independently. The strlen check is not necessary. Even if an INT32 "overflow" happens, it will not cause any trouble because PHP doesn't overflow like C.

@thiemowmde thiemowmde added this to the 0.8 milestone May 7, 2015
@@ -187,16 +187,18 @@ private function getPrecisionFromYear( $year ) {
* @return string URI
*/
private function getCalendarModel( array $timeParts ) {
$calendarModelName = $timeParts[7];
list( $sign, $unsignedYear, , , , , , $calendarModel ) = $timeParts;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Space after comma :/

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's how the style must be in my opinion: always a space after a comma. The fact that some elements are skipped doesn't make the whitespace rule obsolete.

mariushoch added a commit that referenced this pull request May 16, 2015
Simplify calendar model detection code
@mariushoch mariushoch merged commit 4e18435 into master May 16, 2015
@mariushoch mariushoch deleted the julianDetector branch May 16, 2015 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants