https://github.com/brightmachine/object-proxy
A trait to simplify the creation of proxies or simple facades.
https://github.com/brightmachine/object-proxy
Last synced: 10 months ago
JSON representation
A trait to simplify the creation of proxies or simple facades.
- Host: GitHub
- URL: https://github.com/brightmachine/object-proxy
- Owner: brightmachine
- License: mit
- Created: 2014-04-23T15:48:29.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2014-10-30T23:28:57.000Z (over 11 years ago)
- Last Synced: 2025-06-02T05:48:33.530Z (about 1 year ago)
- Language: PHP
- Size: 188 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Rapper
## What is Rapper?
This trait can help with writing facades where you want some methods to forward on to a target object
or to create a proxy class, for example if you don't want to reference vendor code from within your domain.
## Requirements
- PHP 5.4+
## Installation
Install composer in your project:
```
curl -s http://getcomposer.org/installer | php
```
Create a `composer.json` file in your project root:
```json
{
"require": {
"brightmachine/rapper": "*"
}
}
```
Install via composer:
```
php composer.phar install
```
## License
Rapper is open-sourced software licensed under the MIT License - see the LICENSE file for details
## Documentation
Currently this trait allows you to do the following:
1. set the target object for proxying to
2. define a map of different function names to use
Example:
```php
app['events']);
$this->setTargetObject($target)
->setProxyFunctionMap([
'logMessage' => 'addDebug'
]);
}
}
```
## Contributing
Checkout master source code from github:
```
hub clone brightmachine/rapper
```
Install development components via composer:
```
# If you don't have composer.phar
./scripts/bundle-devtools.sh .
# If you have composer.phar
composer.phar install --dev
```
### Coding Standard
We follows coding standard [PSR-2][].
Check if your codes follows PSR-2 by phpcs:
```
./vendor/bin/phpcs --standard=PSR2 src/
```
## Acknowledgement
Git repo skeleton by "[Goodby Setup](http://bit.ly/byesetup)".
[PSR-2]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md