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

getQuotes with a invalid symbol #34

Open
glaucoheitor opened this issue May 14, 2021 · 2 comments
Open

getQuotes with a invalid symbol #34

glaucoheitor opened this issue May 14, 2021 · 2 comments

Comments

@glaucoheitor
Copy link

glaucoheitor commented May 14, 2021

When using $client->getQuotes($symbols), if one of the symbols is invalid or Yahoo don't have information about, the class will just skip it, so if I sent an array with 20 elements, I may get a return with only 18 elements.

I would like to suggest one of this options as a solution:

  • Make the resulted array have keys instead of an index only, maybe the symbol as a key
  • Instead of skipping it, it could add a new array element with an error message for that symbol

I'm not sure if I expressed myself well enough, but if not, please send me questions so I can clarify.

Thanks!

@scheb
Copy link
Owner

scheb commented May 14, 2021

Yea, understood. Would definitly make sense to get some better support from the library when dealing with these multi-fetch requests. Right now it's just transforming the data from the API and the API skips unknown symbols. I agree it would be great to have a more convenient way to figure out if the result was complete and what's missing.

@eversionsystems
Copy link

This was also an issue for me but what I ended up doing is just calling the "getSymbol()" function on the returned quote to validate what stock ticker the result was referring to.

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

No branches or pull requests

3 participants