PHP Class Yosymfony\Spress\Scaffolding\PluginGenerator

Author: Victor Puertas ([email protected])
Inheritance: extends Generator
ファイルを表示 Open project: spress/spress Class Usage Examples

Protected Properties

Property Type Description
$author
$commandDescription
$commandHelp
$commandName
$description
$dirctoryName
$email
$license
$licenses
$name
$namespace
$targetDir

Public Methods

Method Description
__construct ( string $targetDir, string $name ) Constructor.
generate ( ) : array Generates a plugin.
getPluginDirName ( ) : string Gets the plugin directory.
setAuthor ( string $name, string $email = '' ) Sets the author of the plugin.
setCommandData ( string $name, string $description = '', $help = '' ) Sets the command's data in case of command plugin.
setDescription ( string $value ) Sets the description of the plugin.
setLicense ( $name ) Sets the license of the plugin. MIT by default.
setNamespace ( string $value ) Sets the namespace of the plugin.

Protected Methods

Method Description
getClassname ( string $name ) : string Gets the classname.
getLicenseFile ( string $licenseName ) : string Gets the license filename.
getNamespacePsr4 ( string $namespace ) : string Gets the namepspace for PSR-4.
getPluginDir ( string $name ) : string Gets the plugin directory.
getPluginFilename ( string $name ) : string Gets the plugin filename.

Method Details

__construct() public method

Constructor.
public __construct ( string $targetDir, string $name )
$targetDir string The target dir
$name string The name of the plugin. Could you follow the pattern "vendor/class-name"

generate() public method

Generates a plugin.
public generate ( ) : array
return array

getClassname() protected method

Gets the classname.
protected getClassname ( string $name ) : string
$name string
return string

getLicenseFile() protected method

Gets the license filename.
protected getLicenseFile ( string $licenseName ) : string
$licenseName string
return string Filename or empty-string if not exists

getNamespacePsr4() protected method

Gets the namepspace for PSR-4.
protected getNamespacePsr4 ( string $namespace ) : string
$namespace string
return string

getPluginDir() protected method

Gets the plugin directory.
protected getPluginDir ( string $name ) : string
$name string
return string

getPluginDirName() public method

Gets the plugin directory.
public getPluginDirName ( ) : string
return string

getPluginFilename() protected method

Gets the plugin filename.
protected getPluginFilename ( string $name ) : string
$name string
return string

setAuthor() public method

Sets the author of the plugin.
public setAuthor ( string $name, string $email = '' )
$name string The name of the author
$email string The Email of the author

setCommandData() public method

Sets the command's data in case of command plugin.
public setCommandData ( string $name, string $description = '', $help = '' )
$name string The name of the command
$description string The description of the command

setDescription() public method

Sets the description of the plugin.
public setDescription ( string $value )
$value string

setLicense() public method

Sets the license of the plugin. MIT by default.
public setLicense ( $name )

setNamespace() public method

Sets the namespace of the plugin.
public setNamespace ( string $value )
$value string

Property Details

$author protected_oe property

protected $author

$commandDescription protected_oe property

protected $commandDescription

$commandHelp protected_oe property

protected $commandHelp

$commandName protected_oe property

protected $commandName

$description protected_oe property

protected $description

$dirctoryName protected_oe property

protected $dirctoryName

$email protected_oe property

protected $email

$license protected_oe property

protected $license

$licenses protected_oe property

protected $licenses

$name protected_oe property

protected $name

$namespace protected_oe property

protected $namespace

$targetDir protected_oe property

protected $targetDir