Menu

## GenerateSwitch extends CodeGenerator
in package

GenerateSwitch.php : 15

Code generator for creating middleware files in pionia

### Table of Contents

#### Properties

$sweetName : string
$name : string
$output : OutputInterface|null
$actions : array<string|int, mixed>
$dir : string
$namespace : string

#### Methods

__construct() : mixed
generate() : void
createFile() : void
getOrCreateDirectory() : string
log() : void
sweetName() : string
  Spices up the name a little 'user' becomes 'UserService'
addActions() : void
createActionMethod() : ClassType

### Properties

#### $sweetName

GenerateSwitch.php : 19
`public string $sweetName = ''`

#### $name

CodeGenerator.php : 13
`protected string $name`

#### $output

CodeGenerator.php : 14
`protected OutputInterface|null $output = null`

#### $actions

GenerateSwitch.php : 21
`private array<string|int, mixed> $actions = ['registerServices']`

#### $dir

GenerateSwitch.php : 17
`private string $dir = BASEPATH . '/app/switches/'`

#### $namespace

GenerateSwitch.php : 18
`private string $namespace = 'application\\switches'`

### Methods

#### __construct()

GenerateSwitch.php : 23
`public __construct(string $name[, OutputInterface|null $output = null ]) : mixed`

##### Parameters

$name : string
$output : OutputInterface|null = null

#### generate()

GenerateSwitch.php : 31
`public generate([string|null $className = null ][, SymfonyStyle|null $io = null ]) : void`

##### Parameters

$className : string|null = null
$io : SymfonyStyle|null = null

#### createFile()

CodeGenerator.php : 48
`protected createFile(string $filename, string $content) : void`

##### Parameters

$filename : string
$content : string

#### getOrCreateDirectory()

CodeGenerator.php : 40
`protected getOrCreateDirectory(string $directory) : string`

##### Parameters

$directory : string

##### Return values

string

#### log()

CodeGenerator.php : 31
`protected log(string $message) : void`

##### Parameters

$message : string

#### sweetName()

CodeGenerator.php : 21

Spices up the name a little 'user' becomes 'UserService'

`protected sweetName(string $type) : string`

##### Parameters

$type : string

##### Return values

string

#### addActions()

GenerateSwitch.php : 66
`private addActions(ClassType $class) : void`

##### Parameters

$class : ClassType

#### createActionMethod()

GenerateSwitch.php : 73
`private createActionMethod(ClassType $class, string $action) : ClassType`

##### Parameters

$class : ClassType
$action : string

##### Return values

ClassType

## Search results