PHPackages                             alevikzs/reflection - 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. alevikzs/reflection

ActiveLibrary

alevikzs/reflection
===================

This package provides reflection API for retrieve use statements by some class.

1.3.0(9y ago)174↓100%1MITPHPPHP &gt;=7.1

Since Feb 20Pushed 9y agoCompare

[ Source](https://github.com/alevikzs/reflection)[ Packagist](https://packagist.org/packages/alevikzs/reflection)[ RSS](/packages/alevikzs-reflection/feed)WikiDiscussions master Synced 2mo ago

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

Use Statements Reflection API
-----------------------------

[](#use-statements-reflection-api)

[![License](https://camo.githubusercontent.com/3fe145d5a6ca4a3e1d1f2b6d6d0ef5096d595a06acb2d5939fe0c6b8b809ce04/687474703a2f2f706f7365722e707567782e6f72672f616c6576696b7a732f7265666c656374696f6e2f6c6963656e7365)](https://packagist.org/packages/alevikzs/reflection)[![Latest Stable Version](https://camo.githubusercontent.com/5ea88e12d70e8448a9ab0e87c8fb1521e42c2e2d167954f9fb9da74003004203/687474703a2f2f706f7365722e707567782e6f72672f616c6576696b7a732f7265666c656374696f6e2f762f737461626c65)](https://packagist.org/packages/alevikzs/reflection)[![Total Downloads](https://camo.githubusercontent.com/94e32fa758a303e72b05ed52beb2e4b8960626537324fc7d4b24f18c5b954555/687474703a2f2f706f7365722e707567782e6f72672f616c6576696b7a732f7265666c656374696f6e2f646f776e6c6f616473)](https://packagist.org/packages/alevikzs/reflection)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/9a27887b05abaebc43a660c373896a9b5e16e3e87a46c56d480b9817a7d6f44d/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f616c6576696b7a732f7265666c656374696f6e2f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/alevikzs/reflection/?branch=master)[![Code Climate](https://camo.githubusercontent.com/874339f19c9d49ae30ffbee2a5029f6a9ddbada7014e4a779c767ab442917961/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f616c6576696b7a732f7265666c656374696f6e2f6261646765732f6770612e737667)](https://codeclimate.com/github/alevikzs/reflection)[![Build Status](https://camo.githubusercontent.com/2b9e9a0b9c8fe16544c5dacd2c89843aa92b61fca66f1772324b307df8cc5de0/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f616c6576696b7a732f7265666c656374696f6e2f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/alevikzs/reflection/build-status/master)[![Code Coverage](https://camo.githubusercontent.com/01f81a69a2e7fc60619fba3a064cb56ae1becf3edc03a6a13e138c19ecc4768a/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f616c6576696b7a732f7265666c656374696f6e2f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/alevikzs/reflection/?branch=master)

### About

[](#about)

This package provides reflection API for retrieve use statements by some class. You can parse the next use statements:

```
use \ReflectionClass,
    \ReflectionFunction,
    \ReflectionMethod;
use Reflection\Tests\Dummy\Tree\{Root};
use \Reflection\Tests\Dummy as DummyAlias;
use \ReflectionObject;
use \Reflection\Tests\Dummy\Tree\{Trunk\Branch as BranchAlias, Trunk\Fruit, Trunk\Leaf as LeafAlias};

```

### Requirements

[](#requirements)

- PHP &gt;= 7.1

### Installation

[](#installation)

Require the package with composer: `$ composer require alevikzs/reflection`

### How to use

[](#how-to-use)

First, you need to create reflection object:

```
$reflection = new \Reflection\ClassUseStatements(Tree::class);

```

and then you can get use statements or check if some class was used:

```
$reflection->getUseStatements();
$reflection->hasUseStatement(Branch::class)

```

Also, you can build global(full) class name by local class name that was imported in your class:

```
$reflection->getUseStatements()->getFullClassName('Some\Namespace\Class');

```

The best way to see how it works is to look at tests.

### MIT License

[](#mit-license)

**Copyright (c) 2017 Alexey Novikov **

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity62

Established project with proven stability

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

Total

5

Last Release

3345d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/51e76d1247dbf9653314f84eff8808f87e9e556f0df5c9d19b31730ab417439b?d=identicon)[alevikzs](/maintainers/alevikzs)

---

Top Contributors

[![alevikzs](https://avatars.githubusercontent.com/u/2803511?v=4)](https://github.com/alevikzs "alevikzs (31 commits)")

---

Tags

php7reflectionuse-statementsphpreflectionuse statements

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/alevikzs-reflection/health.svg)

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

###  Alternatives

[minime/annotations

The KISS PHP annotations library

229378.6k37](/packages/minime-annotations)

PHPackages © 2026

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