how can i solve a slim4 sapphirecat error

139 views Asked by At

i have been working on a librery proyect with slim4. i realized a merge from github and the the proyect broke. the error is : Fatal error: Type of Sapphirecat

Fatal error: Type of Sapphirecat\Slim4HttpInteropAdapter\GuzzlePsr7v1Factory::$responseFactoryClass must be string (as in class Slim\Factory\Psr17\Psr17Factory) in C:\xampp\htdocs\libreria_alejandria\vendor\sapphirecat\slim4-http-interop-adapter\src\GuzzlePsr7v1Factory.php on line 14

i have reinstalled the slim requirements, but i get the same

1

There are 1 answers

4
Pilling Fine On

As you await a fix from the vendor, Temporarily edit the file GuzzlePsr7v1Factory.php from

    /** @var string */
    protected static $responseFactoryClass = 'Http\Factory\Guzzle\ResponseFactory';
    /** @var string */
    protected static $streamFactoryClass = 'Http\Factory\Guzzle\StreamFactory';
    /** @var string */
    protected static $serverRequestCreatorClass = 'GuzzleHttp\Psr7\ServerRequest';
    /** @var string */
    protected static $serverRequestCreatorMethod = 'fromGlobals';

to

    /** @var string */
    protected static string $responseFactoryClass = 'Http\Factory\Guzzle\ResponseFactory';
    /** @var string */
    protected static string $streamFactoryClass = 'Http\Factory\Guzzle\StreamFactory';
    /** @var string */
    protected static string $serverRequestCreatorClass = 'GuzzleHttp\Psr7\ServerRequest';
    /** @var string */
    protected static string $serverRequestCreatorMethod = 'fromGlobals';

i.e. add string after static of each of the class members.