PHPackages                             jclaveau/php-visibility-violator - 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. jclaveau/php-visibility-violator

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

jclaveau/php-visibility-violator
================================

Class providing simple helpers to violate the defined visibility of methods and properties

1.1.1(2mo ago)0652↓100%1[1 issues](https://github.com/jclaveau/php-visibility-violator/issues)MITPHPPHP ^8.0CI passing

Since Dec 30Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/jclaveau/php-visibility-violator)[ Packagist](https://packagist.org/packages/jclaveau/php-visibility-violator)[ RSS](/packages/jclaveau-php-visibility-violator/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (7)Used By (0)

PHP Visibility Violator
=======================

[](#php-visibility-violator)

This class provides simple helpers uppon basic features of the [Reflection API](https://secure.php.net/manual/en/book.reflection.php) to violate the [visibility](http://php.net/manual/en/language.oop5.visibility.php) of properties and methods:

- Modify or access privates properties of classes and instances
- Call privates or protected methods

Quality
-------

[](#quality)

[![Tests](https://github.com/jclaveau/php-visibility-violator/actions/workflows/tests.yml/badge.svg)](https://github.com/jclaveau/php-visibility-violator/actions/workflows/tests.yml)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/4d23f7a3db7bada41accebeafcef6d9f3c19bc7b552fb0cc67aca4f26fd82c53/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6a636c61766561752f7068702d7669736962696c6974792d76696f6c61746f722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/jclaveau/php-visibility-violator/?branch=master)[![contributions welcome](https://camo.githubusercontent.com/9e93e892d0685e1bf7a1d0bd7c8410d6ecf2086a0a7b48dd58a6b96fa556ea2a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f6e747269627574696f6e732d77656c636f6d652d627269676874677265656e2e7376673f7374796c653d666c6174)](https://github.com/jclaveau/php-visibility-violator/issues)[![Viewed](https://camo.githubusercontent.com/b8597dcdaedddd0952fc06e4c8ebaa49eaaa3254abfb714296eeab011a11d4bc/687474703a2f2f686974732e6477796c2e636f6d2f6a636c61766561752f7068702d7669736962696c6974792d76696f6c61746f722e737667)](http://hits.dwyl.com/jclaveau/php-visibility-violator)

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

[](#installation)

The Visibility Violator is available via composer

```
composer require jclaveau/php-visibility-violator

```

Usage
-----

[](#usage)

```
use JClaveau\VisibilityViolator\VisibilityViolator;

$value = VisibilityViolator::getHiddenProperty($instance, 'property');
$value = VisibilityViolator::getHiddenProperty(MyClass::class, 'static_property');

VisibilityViolator::setHiddenProperty($instance, 'property', 'new value');
VisibilityViolator::setHiddenProperty(MyClass::class, 'static_property', 'new value');

$return = VisibilityViolator::callHiddenMethod($instance, 'method', $arguments);
$return = VisibilityViolator::callHiddenMethod(MyClass::class, 'staticMethod', ['argument 1', 'argument 2']);
```

Documentation
-------------

[](#documentation)

- [API Reference](docs)
- [PHP Visibility Documentation](http://php.net/manual/en/language.oop5.visibility.php)
- [PHP Reflection Documentation](https://secure.php.net/manual/en/book.reflection.php)
- [Tests](tests/unit/VisibilityViolatorTest.php)

###  Health Score

50

—

FairBetter than 95% of packages

Maintenance86

Actively maintained with recent releases

Popularity20

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity70

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

Total

4

Last Release

66d ago

Major Versions

0.1.0 → 1.0.02019-03-20

PHP version history (3 changes)0.1.0PHP &gt;=5.4.0

1.0.0PHP &gt;=5.6.0

1.1.0PHP ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/cc5884f6e6eb1ed07e687cfbb421981d94dd9133e85220df1a546c7f78851bd7?d=identicon)[jclaveau](/maintainers/jclaveau)

---

Top Contributors

[![jclaveau](https://avatars.githubusercontent.com/u/1556489?v=4)](https://github.com/jclaveau "jclaveau (19 commits)")

---

Tags

helpersreflectionhiddenprivatepublicvisibilityprotectedviolate

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/jclaveau-php-visibility-violator/health.svg)

```
[![Health](https://phpackages.com/badges/jclaveau-php-visibility-violator/health.svg)](https://phpackages.com/packages/jclaveau-php-visibility-violator)
```

###  Alternatives

[phpdocumentor/reflection-common

Common reflection classes used by phpdocumentor to reflect the code structure

9.1k706.8M26](/packages/phpdocumentor-reflection-common)[symfony/property-access

Provides functions to read and write from/to an object or array using a simple string notation

2.8k295.3M2.5k](/packages/symfony-property-access)[phpdocumentor/reflection

Reflection library to do Static Analysis for PHP Projects

12521.4M108](/packages/phpdocumentor-reflection)[php-di/phpdoc-reader

PhpDocReader parses @var and @param values in PHP docblocks (supports namespaced class names with the same resolution rules as PHP)

7431.6M54](/packages/php-di-phpdoc-reader)

PHPackages © 2026

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