PHPackages                             uri-interop/impl - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. uri-interop/impl

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

uri-interop/impl
================

1.0.0(11mo ago)0281MITPHPPHP &gt;=8.4

Since Mar 9Pushed 11mo ago1 watchersCompare

[ Source](https://github.com/uri-interop/impl)[ Packagist](https://packagist.org/packages/uri-interop/impl)[ Docs](https://github.com/uri-interop/impl)[ RSS](/packages/uri-interop-impl/feed)WikiDiscussions 1.x Synced 1mo ago

READMEChangelog (4)Dependencies (5)Versions (5)Used By (1)

Uri-Interop Implementation Package
==================================

[](#uri-interop-implementation-package)

Reference implementations of [uri-interop/interface](https://packagist.org/packages/uri-interop/interface).

Installation
------------

[](#installation)

Install this package via [Composer](https://getcomposer.org):

```
$ composer require uri-interop/impl

```

Implementations
---------------

[](#implementations)

Each implementation provides a different kind of mutability, ranging from readonly to fully-mutable, as well as a utility class that provides a factory, parser, normalizer, and resolver for that kind of URI.

### *ReadonlyUri*

[](#readonlyuri)

```
use UriInterop\Impl\Readonly\ReadonlyUri;
use UriInterop\Impl\Readonly\ReadonlyUriUtility;

$utility = new ReadonlyUriUtility();

$base = $utility->parseUri('https://example.com/foo/bar?zim=gir');

$relative = $utility->newUri(
    path: '/baz/dib',
);

$resolved = $utility->resolveUri($base, $relative);

$normalized = $utility->normalizeUri($resolved);
```

### *ImmutableUri*

[](#immutableuri)

```
use UriInterop\Impl\Immutable\ImmutableUri;
use UriInterop\Impl\Immutable\ImmutableUriUtility;

$utility = new ImmutableUriUtility();

$base = $utility
    ->parseUri('https://example.com')
    ->withPath('/foo/bar');

$relative = $utility->newUri(
    path: '/baz/dib',
);

$resolved = $utility->resolveUri($base, $relative);

$normalized = $utility->normalizeUri($resolved);
```

### *MutableUri*

[](#mutableuri)

```
use UriInterop\Impl\Mutable\MutableUri;
use UriInterop\Impl\Mutable\MutableUriUtility;

$utility = new ImmutableUriUtility();

$base = $utility->parseUri('https://example.com');
$base->path = '/foo/bar';

$relative = $utility->newUri(
    path: '/baz/dib',
);

$resolved = $utility->resolveUri($base, $relative);

$normalized = $utility->normalizeUri($resolved);
```

Abstract Classes
----------------

[](#abstract-classes)

#### *Uri*

[](#uri)

All of the URI classes descend from an abstract *Uri* class. It can serve as a base for your own URI implementations as well.

#### *UriUtility*

[](#uriutility)

All of the utility classes descend from an abstract *UriUtility* class. It can serve as a base for your own utility implementations as well.

Note that you can use any kind of utility to normalize and resolve any other kind of URI. For example:

```
/** @var ReadonlyUriUtility $readonlyUtility */
$baseReadonlyUri = $readonlyUtility->parseUri('https://example.com');
assert($baseReadonlyUri instanceof ReadonlyUri);

/** @var ImmutableUriUtility $immutableUtility */
$relativeImmutableUri = $immutableUtility->newUri(
    path: '/foo/bar'
);

assert($relativeImmutableUri instanceof ImmutableUri);

/** @var MutableUriUtility $mutableUtility */
$resolvedMutableUri = $mutableUtility->resolveUri(
    $baseReadonlyUri,
    $relativeReadonlyUri,
);

assert($resolvedMutableUri instanceof MutableUri);

$normalizedReadonlyUri = $readonlyUtility->normalizeUri(
    $resolvedMutableUri
);

assert($normalizedReadonlyUri instanceof ReadonlyUri);
```

Support Classes
---------------

[](#support-classes)

### *UriComponents*

[](#uricomponents)

The *UriComponents* class contains static methods with all of the core logic for parsing, normalizing, and resolving. You can call these static methods from your own implementations.

---

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance51

Moderate activity, may be stable

Popularity8

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~23 days

Total

5

Last Release

342d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/25754?v=4)[Paul M. Jones](/maintainers/pmjones)[@pmjones](https://github.com/pmjones)

---

Top Contributors

[![pmjones](https://avatars.githubusercontent.com/u/25754?v=4)](https://github.com/pmjones "pmjones (27 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/uri-interop-impl/health.svg)

```
[![Health](https://phpackages.com/badges/uri-interop-impl/health.svg)](https://phpackages.com/packages/uri-interop-impl)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
