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

Added support for the WEBSERVICE function #1409

Merged
merged 1 commit into from
Jun 29, 2020

Conversation

paulkned
Copy link
Contributor

@paulkned paulkned commented Mar 6, 2020

This is:

- [ ] a bugfix
- [ x ] a new feature

Checklist:

Why this change is needed?

The WEBSERVICE function was not supported, and now it is. The only thing I'm unsure of are the unit tests. Obviously this function needs to contact an external website. I chose a generic API which seems like it will stay in the air for a while. However, there is no way of knowing this for sure, neither is there any way of knowing if the API will keep returning the same results. This will break the unit tests without any code changes. But not including this test will make sure the function is not properly tested ... dilemma's, dilemma's.

@paulkned paulkned force-pushed the webservice_function branch from e07f9ab to 1f756cf Compare March 6, 2020 15:35
@PowerKiKi
Copy link
Member

What about using something like guzzle ? We can then assume guzzle is tested and working as expected and we may be able to mock it for our own tests ?

@paulkned
Copy link
Contributor Author

paulkned commented Mar 9, 2020

@PowerKiKi Good point. I didn't want to add packages willy-nilly but with your blessing I added guzzle. This made mocking and testing a bit robuster.

*
* @param Client $client
*/
public static function setClient(Client $client)
Copy link
Member

Choose a reason for hiding this comment

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

This should live in \PhpOffice\PhpSpreadsheet\Settings, like the similar setCache/getCache, so settings are centralized and could maybe later be transformed into a PSR-11.

src/PhpSpreadsheet/Calculation/Web.php Outdated Show resolved Hide resolved
@stale
Copy link

stale bot commented Jun 26, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If this is still an issue for you, please try to help by debugging it further and sharing your results.
Thank you for your contributions.

@stale stale bot added the stale label Jun 26, 2020
@MarkBaker MarkBaker removed the stale label Jun 28, 2020
@PowerKiKi PowerKiKi force-pushed the webservice_function branch from 500b1a6 to 43e5df3 Compare June 29, 2020 01:07
@PowerKiKi PowerKiKi merged commit 7f23ccb into PHPOffice:master Jun 29, 2020
@patrickbrouwers
Copy link
Contributor

@PowerKiKi @paulkned @MarkBaker is Guzzle 7 a hard requirement for this to work or could we loosen up the requirement to ^6.3.1|^7.0?

Installing in a clean Laravel 7.0 install currently doesn't allow 1.14 to be installed, which I'm afraid will cause a lot of confusing among the Laravel Excel users who want to upgrade to use the backwards compatible fix for the empty enclosures which was fixed in 1.14.

@mfn
Copy link

mfn commented Jul 2, 2020

See also #1562

I did see the new release but wondering why it didn't upgrade => because my project uses Guzzle ^6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

5 participants