monolog-http icon indicating copy to clipboard operation
monolog-http copied to clipboard

Add PHP 8 support?

Open tomkyle opened this issue 5 years ago • 2 comments

Support for PHP 8 should be added.

Cloning and installing under PHP 8 fails due to PHP ^7.2 version contraints of this package and the guzzlehttp/psr7@dev-master package required for development.

A fast shot allowing for ^7.2|^8.0 and modernizing to latest guzzlehttp/psr7@^1.7 will, however, break the unit tests as class GuzzleHttp\Psr7\HttpFactory seems to have disappeared (it's not in their 1.x branches at least).

As a workaround one can use nyholm/psr7; usage in unit tests then basically goes like this:

<?php
namespace MonologHttp\Tests\Unit\Twilio;

- use GuzzleHttp\Psr7\HttpFactory;
+ use Nyholm\Psr7\Factory\Psr17Factory;

return new TwilioHandler(
    $this->httpClient,
-   new HttpFactory(),
+   new Psr17Factory(),
    'sid',
    'secret',
    '+35790909090',
    '+306988008000'
);

See my fork: https://github.com/tomkyle/monolog-http If this is considered useful, I'd happily contribute PR.

tomkyle avatar Jan 12 '21 17:01 tomkyle

I am willing to accept a PR

gmponos avatar May 26 '21 12:05 gmponos

Any progress here? Being interested in php8 support as well. Would be a starter to contribute to https://github.com/monolog-http/monolog-http/issues/33

devployment avatar Sep 10 '21 12:09 devployment