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

#2026 Wrong Doc Blocks #2027

Merged
merged 22 commits into from Jun 24, 2015
Merged

Conversation

JN-Jones
Copy link
Contributor

#2026

Please only comment on the files I've already edited - I haven't looked at the others so comments about others will be ignored anyways.
Also note that I've only tried to fix the doc blocks and haven't changed variables where eg 0/1 is used as boolean switch.

Fixed adminfunction_templaets and mysql(i)
@ATofighi ATofighi modified the milestone: 1.8.6 Jun 10, 2015
@ATofighi ATofighi added the b:1.8 Branch: 1.8.x label Jun 10, 2015
@JN-Jones
Copy link
Contributor Author

I've changed all doc blocks in "inc" and "admin/inc". Though there are also some functions in other files those are the important ones. @euantorano

{
global $shutdown_queries;
if($name)
if(!empty($name))
Copy link
Contributor

Choose a reason for hiding this comment

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

Any reason you used !empty() here (and in at least 2 more places)? It's a parameter so it's always set, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

empty is the same as == "". Doesn't really matter, it's more a personal preference - looks nicer to me.

Copy link
Contributor

Choose a reason for hiding this comment

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

!empty() negation also checks isset() first which is not needed here. So it's a little overkill. Doesn't almost matter here, I know, but it's not really worth changing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

After a quick look most of these cases should be changed to trim($var) == false. Is that ok to you?

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think it was forced for the name to be a string so I wouldn't go with trim, empty seems fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Destroy666x ? Otherwise I'd like to get this merged ASAP as this PR will likely get conflicts soon and those are a PITA to fix here ;)

Copy link
Contributor

Choose a reason for hiding this comment

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

Somebody is going to get a PITA fixing conflicts though..:p

Copy link
Contributor Author

Choose a reason for hiding this comment

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

A lot of the other PRs don't change doc blocks, they shouldn't get a problem. But I made the experience that git has problems when you change a lot of a file and someone modifies the file in the meantime.

Copy link
Contributor

Choose a reason for hiding this comment

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

Well, I see no reason to not just stay with if($name) as I said. It checked what it was supposed to check - whether the parameter contains any value. Nothing else needs to be done here.

Also, is this PR finished? I thought it's still WIP as the title says, if I'm not mistaken not all files were changed as you mentioned:

I've changed all doc blocks in "inc" and "admin/inc". Though there are also some functions in other files those are the important ones.

There aren't many functions outside of these folders so would be nice to fix their comments too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I still think that at least the trim version should be used but well, changed everything. This isn't WIP anymore

Removes some "will be fetched" notes from "format_name"
Fixes prefix cache issues
Went through the root files
Fixed the function in "install"
Fixed archive files
Fixed admin directory
@JN-Jones JN-Jones changed the title WIP #2026 Wrong Doc Blocks #2026 Wrong Doc Blocks Jun 23, 2015
@@ -682,6 +697,14 @@ function whatsnext()
}
}

/**
* Determine the nect function we need to call
Copy link
Contributor

Choose a reason for hiding this comment

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

next*

* @param string $name The cookie identifier.
* @param string $value The cookie value.
* @param int|string $expires The timestamp of the expiry date.
* @param boolean $httponly True if setting a HttpOnly cookie (supported by IE, Opera 9, Konqueror)
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd change it to (supported by the majority of web browsers)

@Destroy666x
Copy link
Contributor

What was changed looks and seems to work fine to me (except the 3 small change comments). So I guess this can be merged. But keep in mind that there still may be mistakes, for example just corrected several wrong return values and missing @return here: https://github.com/mybb/mybb/pull/2052/files

@euantorano
Copy link
Member

Yep, this is a pretty major changeset, so I wouldn't be surprised if there are a few small typos. If we can fix the ones noted above, we can merge this (which would be super awesome).

@JN-Jones
Copy link
Contributor Author

Well, I haven't looked at the complete functions, otherwise I would still fix issues in a few years :P Will look at the three changes tomorrow and merge this afterwards if noone else mentions anything till then.

@JN-Jones
Copy link
Contributor Author

Fixed and merged

JN-Jones added a commit that referenced this pull request Jun 24, 2015
@JN-Jones JN-Jones merged commit 3851d5d into mybb:feature Jun 24, 2015
@JN-Jones JN-Jones deleted the fix-2026-wrong_doc_blocks branch June 24, 2015 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
b:1.8 Branch: 1.8.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants