PHPackages                             sekjun9878/scope-resolver - 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. sekjun9878/scope-resolver

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

sekjun9878/scope-resolver
=========================

Scope Resolver for PHP-Parser

06PHP

Since Nov 7Pushed 10y agoCompare

[ Source](https://github.com/sekjun9878/scope-resolver)[ Packagist](https://packagist.org/packages/sekjun9878/scope-resolver)[ RSS](/packages/sekjun9878-scope-resolver/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

ScopeResolver for [PHP-Parser](https://github.com/nikic/PHP-Parser)
===================================================================

[](#scoperesolver-for-php-parser)

This is a NodeVisitor component for [nikic/PHP-Parser](https://github.com/nikic/PHP-Parser) that resolves the scope of classes, functions, namespace and closures, and appends them to every node as an attribute.

This can be useful if you need a unique scope identifier for anything, e.g. checking the scope of a variable.

Currently, only PHP5 is supported but I'm working on PHP7 support.

Usage
-----

[](#usage)

Usage is really really really simple.

```
use sekjun9878\ScopeResolver\NodeVisitor\ScopeResolver;

$parser        = (new ParserFactory)->create(ParserFactory::PREFER_PHP5);
$traverser     = new NodeTraverser;

// Add the ScopeResolver visitor
$traverser->addVisitor(new ScopeResolver);

$stmts = $parser->parse($code);
$stmts = $traverser->traverse($stmts);

// Now every node will have a "scope" attribute attached.
```

###  Health Score

19

—

LowBetter than 9% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/18661e7412abf57790cfa67f56f11a30f52443a73d33559b273a2518cbb9d9e9?d=identicon)[sekjun9878](/maintainers/sekjun9878)

---

Top Contributors

[![msjyoo](https://avatars.githubusercontent.com/u/2097812?v=4)](https://github.com/msjyoo "msjyoo (8 commits)")

### Embed Badge

![Health badge](/badges/sekjun9878-scope-resolver/health.svg)

```
[![Health](https://phpackages.com/badges/sekjun9878-scope-resolver/health.svg)](https://phpackages.com/packages/sekjun9878-scope-resolver)
```

###  Alternatives

[nystudio107/eagerbeaver

Allows you to eager load elements from auto-injected Entry elements on demand from your templates.

251.5k](/packages/nystudio107-eagerbeaver)

PHPackages © 2026

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