brokeyourbike / resolve-uri
Trait for resolving URI
Fund package maintenance!
brokeyourbike
Open Collective
Requires
- php: ^7.4|^8.0
- guzzlehttp/psr7: ^1|^2
- psr/http-message: ^1.0
Requires (Dev)
- bamarni/composer-bin-plugin: ^1.4
- phpunit/phpunit: ^9.5
README
Trait for resolving URI
Installation
composer require brokeyourbike/resolve-uri
Usage
use BrokeYourBike\ResolveUri\ResolveUriTrait; class APIClient { use ResolveUriTrait; public function fetchProduct(string $productId) { $uri = $this->resolveUriFor('https://example.com', "products/{$productId}"); } }
Why
Resolve URI when base_url
is not defined in HTTP client.
Authors
- Ivan Stasiuk | Twitter | LinkedIn | stasi.uk