Download the PHP package spatie/invade without Composer
On this page you can find all versions of the php package spatie/invade. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download spatie/invade
More information about spatie/invade
Files in spatie/invade
Package invade
Short Description A PHP function to work with private properties and methods
License MIT
Homepage https://github.com/spatie/invade
Informations about the package invade
A PHP function to access private properties and methods
This package offers an invade
function that will allow you to read/write private properties of an object. It will also allow you to call private methods.
Support us
We invest a lot of resources into creating best in class open source packages. You can support us by buying one of our paid products.
We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on our contact page. We publish all received postcards on our virtual postcard wall.
Installation
You can install the package via composer:
Usage
Imagine you have this class defined which has a private property and method.
This is how you can get the value of the private property using the invade
function.
The invade
function also allows you to change private values.
Using invade
you can also call private functions.
Further, you can also get and set private static class properties and call private static methods. Imagine having this class:
Here is how you get and set private class properties:
And this is how you call private static methods:
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- Freek Van der Herten
- All Contributors
And a special thanks to Caneco for the logo ✨
The original idea for the invade
function came from Caleb "string king" Porzio. We slightly polished the code that he created in this commit on Livewire.
License
The MIT License (MIT). Please see License File for more information.