PHPackages                             crell/path - 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. crell/path

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

crell/path
==========

Data model value objects for handling paths.

0.1.2(1y ago)0211LGPL-3.0-or-laterPHPPHP ~8.4CI passing

Since May 5Pushed 1y ago2 watchersCompare

[ Source](https://github.com/Crell/Path)[ Packagist](https://packagist.org/packages/crell/path)[ Docs](https://github.com/Crell/Path)[ GitHub Sponsors](https://github.com/Crell)[ RSS](/packages/crell-path/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (4)Used By (1)

Pathlib
=======

[](#pathlib)

[![Latest Version on Packagist](https://camo.githubusercontent.com/375b390cb02c9cdad40fd08eb734e64598eda109d08ab7df5e158704249c8dd6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f4372656c6c2f506174682e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/Crell/Path)[![Software License](https://camo.githubusercontent.com/bf1c19b4a07c841715e713542bd6e9c2aaf75ffa2ee2aa3987814d99311f799b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4c47504c76332d677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Total Downloads](https://camo.githubusercontent.com/5028740cf1f4db2abd965cb66af4f728dd38ddcf2f1dfd91a11421a20e1713e2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f4372656c6c2f506174682e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/Crell/Path)

`Crell/Path` is a simple library that provides typed value objects for handling paths. Paths may be either a `PathFragment` (no leading `/`) or an `AbsolutePath`. An `AbsolutePath` always begins either with a `/` or a stream identifier.

The contents of an absolute path may also be retrieved, if there is an actual file that it points to.

A Path object's primary purpose is to centralize and abstract away the various and sundry complexities and edge cases of manipulating paths: Getting a parent path (have to handle the case where there isn't one, with or without a stream), Concatenating two paths (have to handle the leading/trailing slashes, accounting for when one path or the other is the root path), filtering out and rejecting suspicious paths that contain `..`, and so on.

```
use Crell\Path\Path;

// Creates a Path Fragment
$frag = Path::create('foo/bar');

// Creates an Absolute Path
$abs = Path::create('/baz/beep');

$new = $abs->concat($frag);

// Prints /baz/beep/foo/bar
print $new;

// Prints /baz/beep/foo
print $new->parent();

$file = '/narf.jpg';
$fileAbs = $abs->concat($file);

// Prints /baz/beep/narf.jpg
print $fileAbs;
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CODE\_OF\_CONDUCT](CODE_OF_CONDUCT.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please use the [GitHub security reporting form](https://github.com/Crell/Path/security) rather than the issue queue.

Credits
-------

[](#credits)

- [Larry Garfield](https://github.com/Crell)
- [All Contributors](../../contributors)

License
-------

[](#license)

The Lesser GPL version 3 or later. Please see [License File](LICENSE.md) for more information.

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance49

Moderate activity, may be stable

Popularity6

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity46

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 ~0 days

Total

3

Last Release

378d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/12e28c223b88445f07d697c8805bd856066c947f70b535f6a7e00d2cb311c3c2?d=identicon)[Crell](/maintainers/Crell)

---

Top Contributors

[![Crell](https://avatars.githubusercontent.com/u/254863?v=4)](https://github.com/Crell "Crell (9 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/crell-path/health.svg)

```
[![Health](https://phpackages.com/badges/crell-path/health.svg)](https://phpackages.com/packages/crell-path)
```

PHPackages © 2026

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