PHPackages                             gollumsf/reflection-property-test - 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. [Testing &amp; Quality](/categories/testing)
4. /
5. gollumsf/reflection-property-test

ActiveLibrary[Testing &amp; Quality](/categories/testing)

gollumsf/reflection-property-test
=================================

Add trait for reflection data and call

v2.0.0(1mo ago)13.6k6MITPHPPHP &gt;=8.2CI passing

Since Jan 21Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/GollumSF/reflection-property-test)[ Packagist](https://packagist.org/packages/gollumsf/reflection-property-test)[ Docs](https://github.com/GollumSF/reflection-property-test)[ RSS](/packages/gollumsf-reflection-property-test/feed)WikiDiscussions master Synced yesterday

READMEChangelog (8)Dependencies (4)Versions (9)Used By (6)

Reflection Property Test
========================

[](#reflection-property-test)

[![Build Status](https://github.com/GollumSF/reflection-property-test/actions/workflows/php_8.2.yml/badge.svg)](https://github.com/GollumSF/reflection-property-test/actions)[![Coverage](https://camo.githubusercontent.com/c5788980bd3bb678274448704006ebb7cedc0422e5339f974c35e7c194da18eb/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f476f6c6c756d53462f7265666c656374696f6e2d70726f70657274792d746573742f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/GollumSF/reflection-property-test)[![License](https://camo.githubusercontent.com/5965b2b15bf2391c5a6437b1d40079259ef816d7d9e79b4026883ae54b7c1b8d/68747470733a2f2f706f7365722e707567782e6f72672f676f6c6c756d73662f7265666c656374696f6e2d70726f70657274792d746573742f6c6963656e7365)](https://packagist.org/packages/gollumsf/reflection-property-test)[![Latest Stable Version](https://camo.githubusercontent.com/71bea09a6eb1b80da82f9ca0d5d80a8fbae3d9fb752ff2c3f2a41fe39ce87fe5/68747470733a2f2f706f7365722e707567782e6f72672f676f6c6c756d73662f7265666c656374696f6e2d70726f70657274792d746573742f762f737461626c65)](https://packagist.org/packages/gollumsf/reflection-property-test)[![Latest Unstable Version](https://camo.githubusercontent.com/3c36d5c27e8f26f0e7cf29f04fc6cd56965370da0076f07f7631e40505ec63f3/68747470733a2f2f706f7365722e707567782e6f72672f676f6c6c756d73662f7265666c656374696f6e2d70726f70657274792d746573742f762f756e737461626c65)](https://packagist.org/packages/gollumsf/reflection-property-test)[![Discord](https://camo.githubusercontent.com/e2ea9d7fb91494f17c7c76925e006e2ad2d7586fa54f500364bddda1520eecb1/68747470733a2f2f696d672e736869656c64732e696f2f646973636f72642f3637313734313934343134393537333638373f636f6c6f723d707572706c65266c6162656c3d646973636f7264)](https://discord.gg/xMBc5SQ)

Add trait for reflection data and call

Requirements
------------

[](#requirements)

- PHP &gt;= 8.2

Install:
--------

[](#install)

```
composer require --dev gollumsf/reflection-property-test

```

Usage:
------

[](#usage)

```
use GollumSF\ReflectionPropertyTest\ReflectionPropertyTrait;

class MyPrivate {
	private int $dataPrivate = 10;
	private function functionPrivate(int $value): int {
		return 11 + $value;
	}
}

class MyExtend extends MyPrivate {
}

class MyTest extends TestCase {

	use ReflectionPropertyTrait;

	public function testMyFunction(): void {
		$obj = new MyPrivate();
		$this->assertEquals($this->reflectionGetValue($obj, 'dataPrivate'), 10);

		$this->reflectionSetValue($obj, 'dataPrivate', 20);
		$this->assertEquals($this->reflectionGetValue($obj, 'dataPrivate'), 20);

		$this->assertEquals($this->reflectionCallMethod($obj, 'functionPrivate', [19]), 30);

		$obj2 = new MyExtend();
		$this->assertEquals($this->reflectionGetValue($obj2, 'dataPrivate', MyPrivate::class), 10);

		$this->reflectionSetValue($obj2, 'dataPrivate', 20, MyPrivate::class);
		$this->assertEquals($this->reflectionGetValue($obj2, 'dataPrivate', MyPrivate::class), 20);

		$this->assertEquals($this->reflectionCallMethod($obj2, 'functionPrivate', [19], MyPrivate::class), 30);
	}

}
```

###  Health Score

54

—

FairBetter than 97% of packages

Maintenance90

Actively maintained with recent releases

Popularity22

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity74

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

Recently: every ~561 days

Total

8

Last Release

47d ago

Major Versions

v1.0.6 → v2.0.02026-03-26

### Community

Maintainers

![](https://www.gravatar.com/avatar/6690bb36165854e1db86762d56c22351ff844b12f59e5c91993a6d793f098cfb?d=identicon)[Smeagolworms4](/maintainers/Smeagolworms4)

---

Top Contributors

[![Smeagolworms4](https://avatars.githubusercontent.com/u/4448640?v=4)](https://github.com/Smeagolworms4 "Smeagolworms4 (17 commits)")

---

Tags

testreflectiongollumsf

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/gollumsf-reflection-property-test/health.svg)

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

###  Alternatives

[mockery/mockery

Mockery is a simple yet flexible PHP mock object framework

10.7k497.0M23.6k](/packages/mockery-mockery)[hamcrest/hamcrest-php

This is the PHP port of Hamcrest Matchers

7.1k484.1M109](/packages/hamcrest-hamcrest-php)[nelmio/alice

Expressive fixtures generator

2.5k43.4M133](/packages/nelmio-alice)[nyholm/nsa

See everything and do whatever you want. No privacy rule will stop us. Used in tests, debugging and fixtures to access properties and methods.

2286.0M79](/packages/nyholm-nsa)[zenstruck/foundry

A model factory library for creating expressive, auto-completable, on-demand dev/test fixtures with Symfony and Doctrine.

78311.9M97](/packages/zenstruck-foundry)[php-mock/php-mock

PHP-Mock can mock built-in PHP functions (e.g. time()). PHP-Mock relies on PHP's namespace fallback policy. No further extension is needed.

36918.1M98](/packages/php-mock-php-mock)

PHPackages © 2026

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