Remove Guzzle specific config and methods from Graph request classes#4
Merged
Ndiritu merged 9 commits intophilip/feat/http-client-factoryfrom Aug 18, 2021
Merged
Conversation
Ndiritu
commented
Jul 8, 2021
| if (stripos($this->endpoint, "http") === 0) { | ||
| return $this->endpoint; | ||
| $coreSdkVersion = "graph-php-core/".GraphConstants::SDK_VERSION; | ||
| $serviceLibSdkVersion = "Graph-php-".$this->graphClient->getSdkVersion(); |
Contributor
Author
There was a problem hiding this comment.
Should we change the service library SDK version header to match https://github.com/microsoftgraph/msgraph-sdk-design/blob/master/middleware/TelemetryHandler.md#requirements?
Might need some changes to our PowerBI usage charts
Ndiritu
commented
Jul 8, 2021
| * of class $returnType | ||
| */ | ||
| public function execute($client = null) | ||
| public function execute(?ClientInterface $client = null) |
Contributor
Author
There was a problem hiding this comment.
@MIchaelMainer please clarify whether we should always return a GraphResponse object or return the serialised response body payload if a $returnType is not set?
Ndiritu
commented
Jul 8, 2021
| * @return string | ||
| * @param ClientInterface|null $client (optional) When null, uses $graphClient's http client | ||
| * @return array|GraphResponse|StreamInterface|object Graph Response object or response body cast to $returnType | ||
| * @throws ClientExceptionInterface |
Contributor
Author
There was a problem hiding this comment.
Made no sense to me to throw a GraphClientException here since we were only wrapping an existing standard exception interface and providing no further info.
baywet
reviewed
Jul 8, 2021
baywet
approved these changes
Jul 12, 2021
nikithauc
approved these changes
Aug 10, 2021
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR:
GraphRequestandGraphCollectionRequestconstructors to accept the Graph client as an encapsulation of api version, sdk version, access token and custom hosts/middleware etc in futureCloses https://github.com/microsoftgraph/msgraph-sdk-php/issues/438
Closes microsoftgraph/msgraph-sdk-php#531