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

[poc] new low-level API client #357

Merged
merged 29 commits into from
Jan 10, 2024
Merged

[poc] new low-level API client #357

merged 29 commits into from
Jan 10, 2024

Conversation

Art4
Copy link
Collaborator

@Art4 Art4 commented Jan 5, 2024

This PR is a proof of concept for a new simplified HTTP client described in #341 as a replacement for the Redmine\Client\Client interface. The new method Redmine\Http\HttpClient::request(string $method, string $path, string $body = ''): Redmine\Http\Response will replace these method calls :

  • Redmine\Client\Client::requestGet(string $path): bool;
  • Redmine\Client\Client::requestPost(string $path, string $body): bool;
  • Redmine\Client\Client::requestPut(string $path, string $body): bool;
  • Redmine\Client\Client::requestDelete(string $path): bool;
  • Redmine\Client\Client::getLastResponseStatusCode(): int;
  • Redmine\Client\Client::getLastResponseContentType(): string;
  • Redmine\Client\Client::getLastResponseBody(): string;

All classes extending the Redmine\Api\AbstractApi class also do not require theses methods anymore:

  • Redmine\Client\Client::getApi(string $name): Api

This all have been done in a BC way. The next step will be to create a real Redmine\Http\HttpClient implementation and deprecate the Redmine\Client\Client interface and the Redmine\Client\NativeCurlClient and Redmine\Client\Psr18Client classes.

@Art4 Art4 added this to the v2.5.0 milestone Jan 5, 2024
@Art4 Art4 self-assigned this Jan 5, 2024
Copy link

codecov bot commented Jan 5, 2024

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (6efb402) 96.57% compared to head (4312039) 96.71%.

❗ Current head 4312039 differs from pull request most recent head 63dfce8. Consider uploading reports for the commit 63dfce8 to get more accurate results

Files Patch % Lines
src/Redmine/Api/AbstractApi.php 98.63% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               v2.x     #357      +/-   ##
============================================
+ Coverage     96.57%   96.71%   +0.13%     
- Complexity      492      534      +42     
============================================
  Files            27       27              
  Lines          1373     1459      +86     
============================================
+ Hits           1326     1411      +85     
- Misses           47       48       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Art4 Art4 marked this pull request as ready for review January 9, 2024 15:32
@Art4 Art4 requested a review from kbsali January 9, 2024 15:32
Copy link
Owner

@kbsali kbsali left a comment

Choose a reason for hiding this comment

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

💯

@Art4 Art4 changed the title Add new low-level API client [poc] new low-level API client Jan 10, 2024
@Art4 Art4 merged commit 712eddb into kbsali:v2.x Jan 10, 2024
6 of 7 checks passed
@Art4 Art4 deleted the add-httpclient branch January 10, 2024 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants