这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@kuroi
Copy link
Contributor

@kuroi kuroi commented Aug 26, 2012

The current condition tests whether the length of the $m array has a single entry. However, this will never happen as setting $m = $method_map[...] immediately above ensures that it will always contain a minimum of 3 entries.

Thus processing will always drop into "else" clause, generating a PHP error for those methods (get_transaction_details and get_recurring_profile) that should have been dealt with by the "if" clause.

The proposed solution is not perfect. The 2nd condition is arguably redundant as there are no methods with a single parameter that is not 'identifier'. Conversely it won't deal with these two methods being called with superfluous parameters. However, it would at least avoid errors when they're called correctly, with no adverse effects for calls to other methods.

The current condition compares the length of $m to 1, which will never happen as setting $m = $method_map[...] ensures that it will be at least three.

Thus processing drops into "else" clause, generating a PHP error for those methods (get_transaction_details and get_recurring_profile) that should have been captured by the "if" clause.

The proposed solution is not perfect. The 2nd condition is arguably redundant as there are no methods with a single parameter that is not 'identifier'. Conversely it won't deal with these two methods being called with superfluous parameters. However, it would at least avoid errors when they're called correctly.
calvinfroedge added a commit that referenced this pull request Oct 29, 2012
Correct test to identify methods with parameter 'identifier'
@calvinfroedge calvinfroedge merged commit 918dbed into calvinfroedge:master Oct 29, 2012
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.

3 participants