class MergerContainer implements Stringable (View source)

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

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.

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.

MergerContainer operating()

Execute engines.

Return Value

MergerContainer

The method returns this instance that was execute all mergers.

void write()

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

Return Value

void

string verbose()

Print lines to string.

Return Value

string

The method returns the string representation.

array toArray()

Get an array representation of the array.

Return Value

array

The method returns an array representation of the array.

string __toString()

Class magic method to get the real migration file path.

Return Value

string

The method returns the real file path.

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();

static array getEngines()

Get all the engines.

Return Value

array

The method returns an array of engines.