PHP Class Barryvdh\LaravelIdeHelper\Console\ModelsCommand

Author: Barry vd. Heuvel ([email protected])
Inheritance: extends Illuminate\Console\Command
Show file Open project: barryvdh/laravel-ide-helper

Protected Properties

Property Type Description
$description string The console command description.
$dirs
$filename
$files Illuminate\Filesystem\Filesystem
$methods
$name string The console command name.
$properties
$reset
$write

Public Methods

Method Description
__construct ( Illuminate\Filesystem\Filesystem $files )
fire ( ) : void Execute the console command.
getParameters ( $method ) : array Get the parameters and format them correctly

Protected Methods

Method Description
castPropertiesType ( Model $model ) cast the properties's type from $casts.
createPhpDocs ( string $class ) : string
generateDocs ( $loadModels, $ignore = '' )
getArguments ( ) : array Get the console command arguments.
getOptions ( ) : array Get the console command options.
getPropertiesFromMethods ( Model $model )
getPropertiesFromTable ( Model $model ) Load the properties from the database table.
getReturnTypeFromDocBlock ( ReflectionMethod $reflection ) : null | string Get method return type based on it DocBlock comment
getTypeOverride ( string $type ) : string Returns the overide type for the give type.
hasCamelCaseModelProperties ( ) : boolean
loadModels ( )
setMethod ( $name, $type = '', $arguments = [] )
setProperty ( string $name, string | null $type = null, boolean | null $read = null, boolean | null $write = null, string | null $comment = '' )

Private Methods

Method Description
getCollectionClass ( string $className ) : string Determine a model classes' collection type.

Method Details

__construct() public method

public __construct ( Illuminate\Filesystem\Filesystem $files )
$files Illuminate\Filesystem\Filesystem

castPropertiesType() protected method

cast the properties's type from $casts.
protected castPropertiesType ( Model $model )
$model Illuminate\Database\Eloquent\Model

createPhpDocs() protected method

protected createPhpDocs ( string $class ) : string
$class string
return string

fire() public method

Execute the console command.
public fire ( ) : void
return void

generateDocs() protected method

protected generateDocs ( $loadModels, $ignore = '' )

getArguments() protected method

Get the console command arguments.
protected getArguments ( ) : array
return array

getOptions() protected method

Get the console command options.
protected getOptions ( ) : array
return array

getParameters() public method

Get the parameters and format them correctly
public getParameters ( $method ) : array
$method
return array

getPropertiesFromMethods() protected method

protected getPropertiesFromMethods ( Model $model )
$model Illuminate\Database\Eloquent\Model

getPropertiesFromTable() protected method

Load the properties from the database table.
protected getPropertiesFromTable ( Model $model )
$model Illuminate\Database\Eloquent\Model

getReturnTypeFromDocBlock() protected method

Get method return type based on it DocBlock comment
protected getReturnTypeFromDocBlock ( ReflectionMethod $reflection ) : null | string
$reflection ReflectionMethod
return null | string

getTypeOverride() protected method

Returns the overide type for the give type.
protected getTypeOverride ( string $type ) : string
$type string
return string

hasCamelCaseModelProperties() protected method

loadModels() protected method

protected loadModels ( )

setMethod() protected method

protected setMethod ( $name, $type = '', $arguments = [] )

setProperty() protected method

protected setProperty ( string $name, string | null $type = null, boolean | null $read = null, boolean | null $write = null, string | null $comment = '' )
$name string
$type string | null
$read boolean | null
$write boolean | null
$comment string | null

Property Details

$description protected property

The console command description.
protected string $description
return string

$dirs protected property

protected $dirs

$filename protected property

protected $filename

$files protected property

protected Filesystem,Illuminate\Filesystem $files
return Illuminate\Filesystem\Filesystem

$methods protected property

protected $methods

$name protected property

The console command name.
protected string $name
return string

$properties protected property

protected $properties

$reset protected property

protected $reset

$write protected property

protected $write