PHP Class Flugg\Responder\Console\MakeTransformer

Author: Alexander Tømmerås ([email protected])
Inheritance: extends Illuminate\Console\Command
Show file Open project: flugger/laravel-responder

Protected Properties

Property Type Description
$description string The console command description.
$files Illuminate\Filesystem\Filesystem The file system instance.
$signature string The name and signature of the console command.

Public Methods

Method Description
__construct ( Illuminate\Filesystem\Filesystem $files ) Create a new command instance.
handle ( ) : mixed Execute the console command.

Protected Methods

Method Description
generateTransformer ( ) : void Generate the transformer class.
getClassFromNamespace ( string $namespace ) : string Get the full class path for the transformer.
getModelNamespace ( string $name ) : string Get the full class path for the model.
makeDirectory ( string $path ) : void Build a transformers directory if one doesn't exist.
makeTransformer ( string $name, string $stub ) : string Build the transformer class using the given name and stub.
replaceClass ( string $stub, string $name ) : string Replace the class name for the given stub.
replaceModel ( string $stub, string $name ) : string Replace the model for the given stub.
replaceNamespace ( string $stub ) : string Replace the namespace for the given stub.

Method Details

__construct() public method

Create a new command instance.
public __construct ( Illuminate\Filesystem\Filesystem $files )
$files Illuminate\Filesystem\Filesystem

generateTransformer() protected method

Generate the transformer class.
protected generateTransformer ( ) : void
return void

getClassFromNamespace() protected method

Get the full class path for the transformer.
protected getClassFromNamespace ( string $namespace ) : string
$namespace string
return string

getModelNamespace() protected method

Get the full class path for the model.
protected getModelNamespace ( string $name ) : string
$name string
return string

handle() public method

Execute the console command.
public handle ( ) : mixed
return mixed

makeDirectory() protected method

Build a transformers directory if one doesn't exist.
protected makeDirectory ( string $path ) : void
$path string
return void

makeTransformer() protected method

Build the transformer class using the given name and stub.
protected makeTransformer ( string $name, string $stub ) : string
$name string
$stub string
return string

replaceClass() protected method

Replace the class name for the given stub.
protected replaceClass ( string $stub, string $name ) : string
$stub string
$name string
return string

replaceModel() protected method

Replace the model for the given stub.
protected replaceModel ( string $stub, string $name ) : string
$stub string
$name string
return string

replaceNamespace() protected method

Replace the namespace for the given stub.
protected replaceNamespace ( string $stub ) : string
$stub string
return string

Property Details

$description protected property

The console command description.
protected string $description
return string

$files protected property

The file system instance.
protected Filesystem,Illuminate\Filesystem $files
return Illuminate\Filesystem\Filesystem

$signature protected property

The name and signature of the console command.
protected string $signature
return string