PHPackages                             xenolope/namespacery - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. xenolope/namespacery

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

xenolope/namespacery
====================

A library to help parse namespaces

v0.6(11y ago)024MITPHPPHP &gt;=5.3.0

Since Oct 25Pushed 11y ago1 watchersCompare

[ Source](https://github.com/jonjomckay/namespacery)[ Packagist](https://packagist.org/packages/xenolope/namespacery)[ RSS](/packages/xenolope-namespacery/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelog (2)Dependencies (1)Versions (4)Used By (0)

Namespacery
===========

[](#namespacery)

[![Build Status](https://camo.githubusercontent.com/d5b28f1735aa64ccc6282348c2117ae9963112cc866b14e0a4738270c4c382de/68747470733a2f2f7472617669732d63692e6f72672f6a6f6e6a6f6d636b61792f6e616d65737061636572792e7376673f6272616e63683d646576656c6f70)](https://travis-ci.org/jonjomckay/namespacery)

Namespacery is a simple PHP library to help parse namespaces in an easily-accessible way.

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

[](#installation)

The library can be installed with Composer, by including the following in your `composer.json`:

```
{
    "require": {
        "xenolope/namespacery": "0.*"
    }
}
```

Usage
-----

[](#usage)

```
$resolver = new \Xenolope\Namespacery('Vendor\Package\Group\Class');

// Returns the value of the first namespace segment
$resolver->parseSegments()->getFirstSegment();

// Returns the value of the last namespace segment
$resolver->parseSegments()->getLastSegment();

// Returns the value of the segment at the given index, or an \OutOfBoundsException if the index doesn't exist
$resolver->parseSegments()->getSegment(1);

// Returns an array of all segments in the namespace
$resolver->parseSegments()->getSegments();
```

License
-------

[](#license)

Namespacery is released under the MIT License; please see [LICENSE](LICENSE) for more information.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity50

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

2

Last Release

4217d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6749b31cc9bc30bf922a93dfae8bb3132bc2e2051be3bc7c9e5ac0b91fe0bfd3?d=identicon)[jonjomckay](/maintainers/jonjomckay)

---

Top Contributors

[![jonjomckay](https://avatars.githubusercontent.com/u/456645?v=4)](https://github.com/jonjomckay "jonjomckay (10 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/xenolope-namespacery/health.svg)

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

###  Alternatives

[mtdowling/jmespath.php

Declaratively specify how to extract elements from a JSON document

2.0k472.8M135](/packages/mtdowling-jmespathphp)[opis/closure

A library that can be used to serialize closures (anonymous functions) and arbitrary data.

2.6k230.0M284](/packages/opis-closure)[masterminds/html5

An HTML5 parser and serializer.

1.8k242.8M229](/packages/masterminds-html5)[sabberworm/php-css-parser

Parser for CSS Files written in PHP

1.8k191.2M65](/packages/sabberworm-php-css-parser)[michelf/php-markdown

PHP Markdown

3.5k52.4M345](/packages/michelf-php-markdown)[jms/metadata

Class/method/property metadata management in PHP

1.8k152.8M88](/packages/jms-metadata)

PHPackages © 2026

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