class BlockMaker (View source)

Properties

protected Filesystem $files
protected Command $command
protected Block $blockBase
protected $icon

Methods

__construct(Filesystem $files)

No description

mixed
make($blockName, $baseName, $iconName, bool $generateView = false)

Make a new block.

bool
checkBlockStub($baseName)

No description

bool
checkIconFile($iconName)

No description

bool
checkBlockFile($blockFile)

No description

checkBlockBaseFormat($stubFileName)

No description

checkRepeaters($repeaters)

No description

string|string[]|null
makeBlock($blockName, $iconName, $stubFileName = null, null|string $stub = null)

No description

string
makeBlockIdentifier($blockName)

No description

string
makeBlockPath(string $blockIdentifier, string $type = 'block')

No description

string
makeBlockTitle($string)

No description

mixed
getBlockByName($block, array $sources = [])

No description

mixed
getIconFile($icon, $addExtension = true)

No description

Collection
generateRepeaters($baseName, $blockName, $blockBase)

No description

array
createRepeater($repeaterName, $baseName, $blockName, $blockBase, $blockString)

No description

put($filePath, $contents)

No description

bool
saveAllFiles($blockName, string $blockFile, Collection $repeaters, string $blockIdentifier, bool $generateView = false)

No description

setCommand(Command $command)

No description

info($message)

No description

error($message)

No description

Details

__construct(Filesystem $files)

No description

Parameters

Filesystem $files

mixed make($blockName, $baseName, $iconName, bool $generateView = false)

Make a new block.

Parameters

$blockName
$baseName
$iconName
bool $generateView

Return Value

mixed

Exceptions

FileNotFoundException
Exception

protected bool checkBlockStub($baseName)

No description

Parameters

$baseName

Return Value

bool

Exceptions

Exception

protected bool checkIconFile($iconName)

No description

Parameters

$iconName

Return Value

bool

protected bool checkBlockFile($blockFile)

No description

Parameters

$blockFile

Return Value

bool

protected checkBlockBaseFormat($stubFileName)

No description

Parameters

$stubFileName

protected checkRepeaters($repeaters)

No description

Parameters

$repeaters

string|string[]|null makeBlock($blockName, $iconName, $stubFileName = null, null|string $stub = null)

No description

Parameters

$blockName
$iconName
$stubFileName
null|string $stub

Return Value

string|string[]|null

Exceptions

FileNotFoundException

protected string makeBlockIdentifier($blockName)

No description

Parameters

$blockName

Return Value

string

Exceptions

Exception

protected string makeBlockPath(string $blockIdentifier, string $type = 'block')

No description

Parameters

string $blockIdentifier
string $type

Return Value

string

string makeBlockTitle($string)

No description

Parameters

$string

Return Value

string

mixed getBlockByName($block, array $sources = [])

No description

Parameters

$block
array $sources

Return Value

mixed

Exceptions

Exception

mixed getIconFile($icon, $addExtension = true)

No description

Parameters

$icon
$addExtension

Return Value

mixed

Collection generateRepeaters($baseName, $blockName, $blockBase)

No description

Parameters

$baseName
$blockName
$blockBase

Return Value

Collection

Exceptions

FileNotFoundException

array createRepeater($repeaterName, $baseName, $blockName, $blockBase, $blockString)

No description

Parameters

$repeaterName
$baseName
$blockName
$blockBase
$blockString

Return Value

array

Exceptions

FileNotFoundException
Exception

put($filePath, $contents)

No description

Parameters

$filePath
$contents

protected bool saveAllFiles($blockName, string $blockFile, Collection $repeaters, string $blockIdentifier, bool $generateView = false)

No description

Parameters

$blockName
string $blockFile
Collection $repeaters
string $blockIdentifier
bool $generateView

Return Value

bool

BlockMaker setCommand(Command $command)

No description

Parameters

Command $command

Return Value

BlockMaker

info($message)

No description

Parameters

$message

error($message)

No description

Parameters

$message