Skip to content

Latest commit

 

History

History
39 lines (32 loc) · 900 Bytes

File metadata and controls

39 lines (32 loc) · 900 Bytes

Introduction

Adds and removes traits & interfaces from classes in one command.

Installation

Install package.

composer require e2d2-dev/modify-classes

Usage

It automatically detects if it is an interface or a trait. You can add or remove one or many in one step. Don't forget to use save.

Add

use Betta\ModifyClasses\Modifier;

// add one
Modifier::make(Your::class)->add(YourInterface::class)->save()

// add many
Modifier::make(Your::class)->addMany([
     YourInterface::class,
     YourSecondIntfaceOrTrait::class,
])->save()

Remove

use Betta\ModifyClasses\Modifier;

// add one
Modifier::make(Your::class)->remove(YourInterface::class)->save()

// add many
Modifier::make(Your::class)->removeMany([
     YourInterface::class,
     YourSecondIntfaceOrTrait::class,
])->save()