class OperationData (View source)

internal  
 

Holds parameter data for operation objects during operation creation only.

Constants

MODE

PATH

OVERWRITE

PREPEND

APPEND

DEFAULT

FORCE_APPEND

Properties

protected array $data

The parameter data.

protected string $destination

The destination path

Methods

__construct($destination, mixed $data)

OperationData constructor.

string
destination()

Gets the destination path that this operation data is associated with.

string
mode()

Gets operation mode

bool
hasPath()

Checks if path exists

string
path()

Gets path

bool
overwrite()

Determines overwrite.

bool
forceAppend()

Determines whether 'force-append' has been set.

bool
hasPrepend()

Checks if prepend path exists.

string
prepend()

Gets prepend path.

bool
hasAppend()

Checks if append path exists.

string
append()

Gets append path.

bool
hasDefault()

Checks if default path exists.

string
default()

Gets default path.

array
normalizeScaffoldMetadata(string $destination, mixed $value)

Normalizes metadata by converting literal values into arrays.

array
convertScaffoldMetadata(string $destination, mixed $value)

Performs the conversion-to-array step in normalizeScaffoldMetadata.

Details

__construct($destination, mixed $data)

OperationData constructor.

Parameters

$destination
mixed $data

The raw data array to wrap.

string destination()

Gets the destination path that this operation data is associated with.

Return Value

string

The destination path for the scaffold result.

string mode()

Gets operation mode

Return Value

string

Operation mode.

bool hasPath()

Checks if path exists

Return Value

bool

Returns true if path exists

string path()

Gets path

Return Value

string

The path.

bool overwrite()

Determines overwrite.

Return Value

bool

Returns true if overwrite mode was selected.

bool forceAppend()

Determines whether 'force-append' has been set.

Return Value

bool

Returns true if 'force-append' mode was selected.

bool hasPrepend()

Checks if prepend path exists.

Return Value

bool

Returns true if prepend exists.

string prepend()

Gets prepend path.

Return Value

string

Path to prepend data

bool hasAppend()

Checks if append path exists.

Return Value

bool

Returns true if prepend exists.

string append()

Gets append path.

Return Value

string

Path to append data

bool hasDefault()

Checks if default path exists.

Return Value

bool

Returns true if there is default data available.

string default()

Gets default path.

Return Value

string

Path to default data

protected array normalizeScaffoldMetadata(string $destination, mixed $value)

Normalizes metadata by converting literal values into arrays.

Conversions performed include:

  • Boolean 'false' means "skip".
  • A string means "replace", with the string value becoming the path.

Parameters

string $destination

The destination path for the scaffold file.

mixed $value

The metadata for this operation object, which varies by operation type.

Return Value

array

Normalized scaffold metadata with default values.

protected array convertScaffoldMetadata(string $destination, mixed $value)

Performs the conversion-to-array step in normalizeScaffoldMetadata.

Parameters

string $destination

The destination path for the scaffold file.

mixed $value

The metadata for this operation object, which varies by operation type.

Return Value

array

Normalized scaffold metadata.