https://github.com/brokeyourbike/resolve-uri-php
Trait for resolving URI
https://github.com/brokeyourbike/resolve-uri-php
hacktoberfest php php8 rest-api uri
Last synced: about 1 month ago
JSON representation
Trait for resolving URI
- Host: GitHub
- URL: https://github.com/brokeyourbike/resolve-uri-php
- Owner: brokeyourbike
- License: mpl-2.0
- Created: 2021-10-19T14:09:46.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-05-20T11:42:51.000Z (about 3 years ago)
- Last Synced: 2025-02-27T21:38:44.389Z (over 1 year ago)
- Topics: hacktoberfest, php, php8, rest-api, uri
- Language: PHP
- Homepage:
- Size: 35.2 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# resolve-uri
[](https://github.com/brokeyourbike/resolve-uri-php/releases)
[](https://packagist.org/packages/brokeyourbike/resolve-uri)
[](https://codeclimate.com/github/brokeyourbike/resolve-uri-php/maintainability)
[](https://codeclimate.com/github/brokeyourbike/resolve-uri-php/test_coverage)
Trait for resolving URI
## Installation
```bash
composer require brokeyourbike/resolve-uri
```
## Usage
```php
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](https://github.com/brokeyourbike) | [Twitter](https://twitter.com/brokeyourbike) | [LinkedIn](https://www.linkedin.com/in/brokeyourbike) | [stasi.uk](https://stasi.uk)
## License
[Mozilla Public License v2.0](https://github.com/brokeyourbike/resolve-uri-php/blob/main/LICENSE)