Skip to content

Replace php-http/message-factory to psr/http-factory, HttpClientDiscovery to Psr18ClientDiscovery, MessageFactoryDiscovery to Psr17FactoryDiscovery and Http\Client\HttpClient to Psr\Http\Client\ClientInterface #269

Closed
FaboPT wants to merge 3 commits into
thephpleague:masterfrom
FaboPT:replace-php-http/message-factory

Conversation

@FaboPT

@FaboPT FaboPT commented Apr 15, 2024

Copy link
Copy Markdown

No description provided.

@FaboPT FaboPT changed the title chore: Replace php-http/message-factory to psr/http-factory Replace php-http/message-factory to psr/http-factory Apr 15, 2024
Fábio Galvão added 2 commits April 15, 2024 14:23
…ctoryDiscovery to Psr17FactoryDiscovery and Http\Client\HttpClient to Psr\Http\Client\ClientInterface
@FaboPT FaboPT changed the title Replace php-http/message-factory to psr/http-factory Replace php-http/message-factory to psr/http-factory, HttpClientDiscovery to Psr18ClientDiscovery, MessageFactoryDiscovery to Psr17FactoryDiscovery and Http\Client\HttpClient to Psr\Http\Client\ClientInterface Apr 15, 2024
@FaboPT

FaboPT commented Apr 30, 2024

Copy link
Copy Markdown
Author

@barryvdh Can you give an estimate for review that, please ?

@barryvdh barryvdh left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Not really sure how to handle this BC-wise. If people supply their own Request Factory, it will now Break. So that requires a new major version..

$uri
) {
$request = $this->requestFactory->createRequest($method, $uri, $headers, $body, $protocolVersion);
$request = $this->requestFactory->createRequest($method, $uri);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is a breaking change. Can we not set the headers/body/protocol on the request before sending?

array $headers = [],
$body = null,
$protocolVersion = '1.1'
$uri

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is also a breaking change

private $requestFactory;

public function __construct($httpClient = null, RequestFactory $requestFactory = null)
public function __construct($httpClient = null, RequestFactoryInterface $requestFactory = null)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

So these are different interfaces, which would require significant BC break.

@kynx

kynx commented Sep 12, 2024

Copy link
Copy Markdown

@barryvdh So it sounds like a new major version is required? Is there any reason not to do one? I know these things are just interfaces so not like a security risk, but folks auditing my dependencies don't know that. It'd be good to get this fixed.

@FaboPT FaboPT closed this by deleting the head repository Feb 25, 2025
@barryvdh

Copy link
Copy Markdown
Member

Alternative in #282

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.

3 participants