class MergerContainer implements Stringable

Container for mergers.

Methods

engine(Merger $merger)

Add a engine.

engines(array $mergers)

Add engines.

operating()

Execute engines.

void
write()

Write a string to a file from the $this->lines array.

string
verbose()

Print lines to string.

array
toArray()

Get an array representation of the array.

string
__toString()

Class magic method to get the real migration file path.

static MergerContainer
from(string|null $migration = null, string|null $body = null)

Create a instance.

static array
getEngines()

Get all the engines.

Details

at line 52
MergerContainer engine(Merger $merger)

Add a engine.

Parameters

Merger $merger

An engine to be added.

Return Value

MergerContainer

The method returns the current instance that enables method chaining.

at line 65
MergerContainer engines(array $mergers)

Add engines.

Parameters

array $mergers

An array of engines to be added.

Return Value

MergerContainer

The method returns the current instance that enables methods chaining.

at line 77
MergerContainer operating()

Execute engines.

Return Value

MergerContainer

The method returns this instance that was execute all mergers.

at line 108
void write()

Write a string to a file from the $this->lines array.

Return Value

void

at line 121
string verbose()

Print lines to string.

Return Value

string

The method returns the string representation.

at line 131
array toArray()

Get an array representation of the array.

Return Value

array

The method returns an array representation of the array.

at line 141
string __toString()

Class magic method to get the real migration file path.

Return Value

string

The method returns the real file path.

at line 158
static MergerContainer from(string|null $migration = null, string|null $body = null)

Create a instance.

Parameters

string|null $migration

Path to the migration file from root folder.

string|null $body

Migration string.

Return Value

MergerContainer

The method return the instance that called the constructor.

Exceptions

InvalidArgumentException

Examples

MergerContainer::from(migration: <migration_path>)->engines([...engines...])->operating()->write();
MergerContainer::from(body : <body>)->engines([...engines...])->operating()->verbose();

at line 172
static array getEngines()

Get all the engines.

Return Value

array

The method returns an array of engines.