Skip to content
This repository has been archived by the owner on Jun 22, 2020. It is now read-only.
/ bypass-finals Public archive
forked from dg/bypass-finals

[ABANDONED] Removes final keywords from source code on-the-fly and allows mocking of final methods and classes. It can be used together with any test tool such as PHPUnit or Mockery.

License

Notifications You must be signed in to change notification settings

avto-dev/bypass-finals

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This package is abandoned and no longer maintained
We suggests using the original dg/bypass-finals package instead
since v1.2.0 it includes all changes from this fork

Bypass Finals

Version Version Build Status Downloads count License

Introduction

Removes final keywords from source code on-the-fly and allows mocking of final methods and classes. It can be used together with any test tool such as PHPUnit, Mockery or Nette Tester.

Installation

The recommended way to install is through Composer:

composer require --dev avto-dev/bypass-finals "^1.2"

Installed composer is required (how to install composer).

You need to fix the major version of package.

It requires PHP version 5.6 and supports PHP up to 7.3.

Usage

Simply call this:

DG\BypassFinals::enable();

You need to enable it before the classes you want to remove the final are loaded. So call it as soon as possible, preferably right after vendor/autoload.php in loaded.

You can choose to only bypass finals in specific files:

DG\BypassFinals::setWhitelist([
    'relative/path/to/file.php'
]);

DG\BypassFinals::enable();

This gives you finer control and can solve issues with certain frameworks and libraries.

If you like it, please make a donation now. Thank you!

Changes log

Release date Commits since latest release

Changes log can be found here.

Support

Issues Issues

If you will find any package errors, please, make an issue in current repository.

About

[ABANDONED] Removes final keywords from source code on-the-fly and allows mocking of final methods and classes. It can be used together with any test tool such as PHPUnit or Mockery.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%