PHP Class Nwidart\Modules\Generators\ModuleGenerator

Inheritance: extends Generator
Show file Open project: nwidart/laravel-modules

Protected Properties

Property Type Description
$config Illuminate\Config\Repository The laravel config instance.
$console Illuminate\Console\Command The laravel console instance.
$filesystem Illuminate\Filesystem\Filesystem The laravel filesystem instance.
$force boolean Force status.
$module Module The pingpong module instance.
$name string The module name will created.
$plain boolean Generate a plain module.

Public Methods

Method Description
__construct ( $name, Repository $module = null, Illuminate\Config\Repository $config = null, Illuminate\Filesystem\Filesystem $filesystem = null, Illuminate\Console\Command $console = null ) The constructor.
generate ( ) Generate the module.
generateFiles ( ) Generate the files.
generateFolders ( ) Generate the folders.
generateGitKeep ( string $path ) Generate git keep to the specified path.
generateResources ( ) Generate some resources.
getConfig ( ) : Illuminate\Config\Repository Get the laravel config instance.
getConsole ( ) : Illuminate\Console\Command Get the laravel console instance.
getFiles ( ) : array Get the list of files will created.
getFilesystem ( ) : Illuminate\Filesystem\Filesystem Get the laravel filesystem instance.
getFolders ( ) : array Get the list of folders will created.
getModule ( ) : Module Get the pingpong module instance.
getName ( ) : string Get the name of module will created. By default in studly case.
getReplacements ( ) get the list for the replacements.
setConfig ( Illuminate\Config\Repository $config ) Set the laravel config instance.
setConsole ( Illuminate\Console\Command $console ) Set the laravel console instance.
setFilesystem ( Illuminate\Filesystem\Filesystem $filesystem ) Set the laravel filesystem instance.
setForce ( boolean | integer $force ) Set force status.
setModule ( mixed $module ) Set the pingpong module instance.
setPlain ( boolean $plain ) Set plain flag.

Protected Methods

Method Description
getAuthorEmailReplacement ( ) : string Get replacement for $AUTHOR_EMAIL$.
getAuthorNameReplacement ( ) : string Get replacement for $AUTHOR_NAME$.
getLowerNameReplacement ( ) : string Get the module name in lower case.
getModuleNamespaceReplacement ( ) : string Get replacement for $MODULE_NAMESPACE$.
getReplacement ( $stub ) : array Get array replacement for the specified stub.
getStubContents ( $stub ) : Stub Get the contents of the specified stub file by given stub name.
getStudlyNameReplacement ( ) : string Get the module name in studly case.
getVendorReplacement ( ) : string Get replacement for $VENDOR$.

Method Details

__construct() public method

The constructor.
public __construct ( $name, Repository $module = null, Illuminate\Config\Repository $config = null, Illuminate\Filesystem\Filesystem $filesystem = null, Illuminate\Console\Command $console = null )
$name
$module Nwidart\Modules\Repository
$config Illuminate\Config\Repository
$filesystem Illuminate\Filesystem\Filesystem
$console Illuminate\Console\Command

generate() public method

Generate the module.
public generate ( )

generateFiles() public method

Generate the files.
public generateFiles ( )

generateFolders() public method

Generate the folders.
public generateFolders ( )

generateGitKeep() public method

Generate git keep to the specified path.
public generateGitKeep ( string $path )
$path string

generateResources() public method

Generate some resources.
public generateResources ( )

getAuthorEmailReplacement() protected method

Get replacement for $AUTHOR_EMAIL$.
protected getAuthorEmailReplacement ( ) : string
return string

getAuthorNameReplacement() protected method

Get replacement for $AUTHOR_NAME$.
protected getAuthorNameReplacement ( ) : string
return string

getConfig() public method

Get the laravel config instance.
public getConfig ( ) : Illuminate\Config\Repository
return Illuminate\Config\Repository

getConsole() public method

Get the laravel console instance.
public getConsole ( ) : Illuminate\Console\Command
return Illuminate\Console\Command

getFiles() public method

Get the list of files will created.
public getFiles ( ) : array
return array

getFilesystem() public method

Get the laravel filesystem instance.
public getFilesystem ( ) : Illuminate\Filesystem\Filesystem
return Illuminate\Filesystem\Filesystem

getFolders() public method

Get the list of folders will created.
public getFolders ( ) : array
return array

getLowerNameReplacement() protected method

Get the module name in lower case.
protected getLowerNameReplacement ( ) : string
return string

getModule() public method

Get the pingpong module instance.
public getModule ( ) : Module
return Module

getModuleNamespaceReplacement() protected method

Get replacement for $MODULE_NAMESPACE$.

getName() public method

Get the name of module will created. By default in studly case.
public getName ( ) : string
return string

getReplacement() protected method

Get array replacement for the specified stub.
protected getReplacement ( $stub ) : array
$stub
return array

getReplacements() public method

get the list for the replacements.
public getReplacements ( )

getStubContents() protected method

Get the contents of the specified stub file by given stub name.
protected getStubContents ( $stub ) : Stub
$stub
return Nwidart\Modules\Support\Stub

getStudlyNameReplacement() protected method

Get the module name in studly case.
protected getStudlyNameReplacement ( ) : string
return string

getVendorReplacement() protected method

Get replacement for $VENDOR$.
protected getVendorReplacement ( ) : string
return string

setConfig() public method

Set the laravel config instance.
public setConfig ( Illuminate\Config\Repository $config )
$config Illuminate\Config\Repository

setConsole() public method

Set the laravel console instance.
public setConsole ( Illuminate\Console\Command $console )
$console Illuminate\Console\Command

setFilesystem() public method

Set the laravel filesystem instance.
public setFilesystem ( Illuminate\Filesystem\Filesystem $filesystem )
$filesystem Illuminate\Filesystem\Filesystem

setForce() public method

Set force status.
public setForce ( boolean | integer $force )
$force boolean | integer

setModule() public method

Set the pingpong module instance.
public setModule ( mixed $module )
$module mixed

setPlain() public method

Set plain flag.
public setPlain ( boolean $plain )
$plain boolean

Property Details

$config protected property

The laravel config instance.
protected Repository,Illuminate\Config $config
return Illuminate\Config\Repository

$console protected property

The laravel console instance.
protected Command,Illuminate\Console $console
return Illuminate\Console\Command

$filesystem protected property

The laravel filesystem instance.
protected Filesystem,Illuminate\Filesystem $filesystem
return Illuminate\Filesystem\Filesystem

$force protected property

Force status.
protected bool $force
return boolean

$module protected property

The pingpong module instance.
protected Module $module
return Module

$name protected property

The module name will created.
protected string $name
return string

$plain protected property

Generate a plain module.
protected bool $plain
return boolean