brokeyourbike/resolve-uri

Trait for resolving URI

1.0.3 2023-05-14 21:38 UTC

This package is auto-updated.

Last update: 2024-09-20 14:30:01 UTC


README

Latest Stable Version Total Downloads Maintainability Test Coverage

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

License

Mozilla Public License v2.0