Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sebastianbergmann/peek-and-poke
Proxy for accessing non-public attributes and methods of an object
https://github.com/sebastianbergmann/peek-and-poke
Last synced: about 2 months ago
JSON representation
Proxy for accessing non-public attributes and methods of an object
- Host: GitHub
- URL: https://github.com/sebastianbergmann/peek-and-poke
- Owner: sebastianbergmann
- License: other
- Archived: true
- Created: 2015-06-21T12:28:37.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-08-06T17:28:14.000Z (over 9 years ago)
- Last Synced: 2024-09-21T10:03:10.700Z (2 months ago)
- Language: PHP
- Size: 152 KB
- Stars: 36
- Watchers: 5
- Forks: 8
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Build Status](https://img.shields.io/travis/sebastianbergmann/peek-and-poke/master.svg?style=flat-square)](https://travis-ci.org/sebastianbergmann/peek-and-poke)
# Peek and Poke Proxy
Proxy for accessing non-public attributes and methods of an object.
## Installation
To add Peek and Poke Proxy as a local, per-project dependency to your project, simply add a dependency on `sebastian/peek-and-poke` to your project's `composer.json` file. Here is a minimal example of a `composer.json` file that just defines a dependency on Peek and Poke Proxy 1.0:
```JSON
{
"require": {
"sebastian/peek-and-poke": "1.0.*"
}
}
```## Usage
```php
class Foo
{
private $bar = 'baz';private function notPublic()
{
print __METHOD__ . PHP_EOL;
}
}$foo = new Foo;
$proxy = new SebastianBergmann\PeekAndPoke\Proxy($foo);print $proxy->bar . PHP_EOL;
$proxy->notPublic();
``````
baz
Foo::notPublic
```