Closed NicoP-S closed 4 years ago
Those docs are for how to use the legacy http plug interfaces. We now use PSR-17 and PSR-18.
@GrahamCampbell I think slim/psr7 is psr-17 compliant
https://github.com/slimphp/Slim-Psr7/blob/master/composer.json#L46-L49
I also tryied writing the part from the psr-17 docs into my controller https://docs.php-http.org/en/latest/discovery.html#psr-17-factory-discovery Is there an example anywhere?
Maybe this is an issue with the discovery package.
You can force the factories by providing them to the Builder
class:
$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);
Or more fancy using DI-containers.
Replaced by https://github.com/php-http/discovery/issues/190.
Hello I am trying to get GitlabPHP running in my slim project. The docs at https://docs.php-http.org/en/latest/httplug/users.html said it should work with slim too.
Part of my composer.json:
Error Message:
It tests for
Http\Factory\Slim\RequestFactory
. I have checked my vendor dir. I only haveSlim\Psr7\Factory\RequestFactory
Am I doing something wrong?