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

fix: Undefined array key result #519

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ajmeese7
Copy link

@ajmeese7 ajmeese7 commented Jun 8, 2024

New Pull Request Checklist

Issue Description

The isset method is used to ensure the result key is set before attempting to read it.

Closes: #518

Approach

Added in mocking capabilities to the ParseCloud class so the code changes can be tested.

TODOs before merging

  • Add tests
  • Add changes to documentation (guides, repository pages, in-code descriptions)
  • Add changelog entry

Copy link

parse-github-assistant bot commented Jun 8, 2024

Thanks for opening this pull request!

  • 🎉 We are excited about your hands-on contribution!

@mtrezza mtrezza requested a review from a team June 11, 2024 13:33
@dplewis
Copy link
Member

dplewis commented Jun 13, 2024

Since the results aren't returned in the cloud code function it should return undefined similar to the JS SDK Cloud.js

There's no need to mock as you can create and call a real cloud code function.
https://github.com/parse-community/parse-php-sdk/blob/master/tests/cloud-code.js

@dplewis
Copy link
Member

dplewis commented Jun 28, 2024

@ajmeese7 Can you check the CI? There seems to be a linting issue. I also left a few comments

@mtrezza mtrezza changed the title fix: Undefined array key "result" #518 fix: Undefined array key result Jun 28, 2024
@mtrezza
Copy link
Member

mtrezza commented Jun 28, 2024

Is this actually fixing a bug or just a refactor to not display a warning message?

@ajmeese7
Copy link
Author

@mtrezza the warning is due to accessing a key that doesn't exist, so I'd consider that a bug. There's no telling if future PHP versions will error out on that, so I figured it's easiest to just solve the problem instead of letting it fester.

And @dplewis I haven't had time to look at your review/comments, I've been busy with other projects, but I'll try to get to that soon.

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.

Undefined array key "result"
3 participants