-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Review parameter names in ext/xmlreader #6255
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
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
On the topic of
$sqlite3
, should the first parameter be called$XML
? Can we maybe use$source
in sqlite3 as well?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'm not sure I understand the connection to sqlite3.
$source
here is in the sense of "source code" not in the sense of "source and target". Where would we be able to use$source
in the sqlite API?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 was talking about the
backup()
method. The first parameter could be just$destination
same as we have just$source
here. I didn't mean the parameters are the same in these two extensions, just we should follow the same pattern.The first parameter in
xml()
is actually an XML string, but we call it source, could we not call the first parameter insqlite3::backup()
just$destination
to follow a similar pattern? Sorry for my confusing way of writing.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'm a bit confused as well. Are you thinking of the name
$source
as "where it gets the data from"? That the$sqlite3
parameter insqlite3::backup()
and the$source
parameter inxmlreader::xml()
are related in that way?Object instances like the
$sqlite3
parameter are often named after the class that it is an instance of. Is that the source (I'm sorry) of your confusion?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.
No, I am not making a functional connection between these two extensions. I am purely talking about name choice. I.e. why have chosen
$source
instead of$xml
?Following the same logic, we can use the name
$destination
instead of$sqlite3
. I know the type of the parameter is different, but I am only talking about naming convention.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.
Because it is already clear from the context that it is expecting XML. That means we can use a name that is more generic and consistent with other extensions.
You do have a fair argument when you say that
$sqlite3
should be renamed to something more generic, like$destination
, for the same reason. It has been suggested to do so, but general consensus appears to be that the name should reflect the type of object in these cases.