Closed NicoP-S closed 4 years ago
Meh, it's not a bug. The factories in this repo are just not in any of the default strategies (e.g. CommonClassesStrategy
)
The factories it does look for are in an other repo (https://github.com/slimphp/Slim-Http). However, you should be able to configure your container to use the factories in this repo.
You could also provide your own strategy to resolve into the classes in this repo, or send a PR to php-http/discovery to add these classes to the CommonClassesStrategy
I also tried with slim/http but it gives the same error.
$ composer require slim/http
I will go the way you mentioned https://github.com/GitLabPHP/Client/issues/586#issuecomment-710072846
$builder = new Gitlab\HttpClient\Builder( null, // PSR-18 client autodetect new Slim\Psr7\Factory\RequestFactory(), new Slim\Psr7\Factory\StreamFactory(), new Slim\Psr7\Factory\UriFactory() );
$client = new Gitlab\Client($builder);
Thanks for your help!
I also tried with slim/http but it gives the same error.
$ composer require slim/http
Makes sense, slim/http only decorates the classes, it does not provide actual psr-7 or psr-17 implementation itself I think.
Hi, i am trying to get slim psr-7 running in an project where https://github.com/php-http/discovery is used. But I get following error.
It tests for Http\Factory\Slim\RequestFactory. I have checked my vendor dir. I only have Slim\Psr7\Factory\RequestFactory
Am I doing something wrong ? Or is this a bug in one of slim/psr7 or php-http/discovery ?