Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vysinsky/unfinalizer
Removes final keyword from any source code for easier testing.
https://github.com/vysinsky/unfinalizer
Last synced: 2 days ago
JSON representation
Removes final keyword from any source code for easier testing.
- Host: GitHub
- URL: https://github.com/vysinsky/unfinalizer
- Owner: vysinsky
- Created: 2016-11-21T15:29:43.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2015-04-02T13:05:18.000Z (over 9 years ago)
- Last Synced: 2024-03-17T13:53:25.922Z (7 months ago)
- Language: PHP
- Homepage:
- Size: 207 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
dotblue/unfinalizer
===================Removes `final` keyword from any source code for easier **testing**.
## Installation
```
$ composer require dotblue/unfinalizer
```First, you have to require autoloader of `Unfinalizer`. Because removing `final` keyword relies on hacking your autoloaders, you have to bypass them all to autoload `Unfinalizer` (including Composer for example).
```php
require __DIR__ . '/vendor/dotblue/unfinalizer/autoload.php';
```Secondly, create instance of `Unfinalizer` itself and configure temp directory:
```php
$unfinalizer = new DotBlue\Unfinalizer\Unfinalizer();
$unfinalizer->setTempDirectory(__DIR__ . '/vendor-unfinalized');
```## Drivers
Last step is registering wrappers for various autoloaders that you may be using.
### Composer
Register `DotBlue\Unfinalizer\Composer`. It's constructor requires absolute path to the `vendor` directory.
```php
$unfinalizer->register(new DotBlue\Unfinalizer\Composer(__DIR__ . '/vendor'));
```> That's it, you don't need to require `vendor/autoload.php` by yourself anymore.
### Nette [RobotLoader](https://github.com/nette/robot-loader)
Register `DotBlue\Unfinalizer\NetteRobotLoader`.
```php
$robotLoader = $unfinalizer->register(new DotBlue\Unfinalizer\NetteRobotLoader())
->setCacheStorage(new Nette\Caching\Storages\FileStorage(__DIR__ . '/temp'))
->addDirectory(__DIR__ . '/src')
->register();
```