PHP Class Nwidart\Modules\Support\Stub

Afficher le fichier Open project: nwidart/laravel-modules Class Usage Examples

Protected Properties

Свойство Type Description
$basePath null | string The base path of stub file.
$path string The stub path.
$replaces array The replacements array.

Méthodes publiques

Méthode Description
__construct ( string $path, array $replaces = [] ) The contructor.
__toString ( ) : string Handle magic method __toString.
create ( string $path, array $replaces = [] ) : self Create new self instance.
createFromPath ( string $path, array $replaces = [] ) : self Create new self instance from full path.
getBasePath ( ) : string | null Get base path.
getContents ( ) : mixed | string Get stub contents.
getPath ( ) : string Get stub path.
getReplaces ( ) : array Get replacements.
render ( ) : string Get stub contents.
replace ( array $replaces = [] ) Set replacements array.
saveTo ( string $path, string $filename ) : boolean Save stub to specific path.
setBasePath ( string $path ) Set base path.
setPath ( string $path ) : self Set stub path.

Method Details

__construct() public méthode

The contructor.
public __construct ( string $path, array $replaces = [] )
$path string
$replaces array

__toString() public méthode

Handle magic method __toString.
public __toString ( ) : string
Résultat string

create() public static méthode

Create new self instance.
public static create ( string $path, array $replaces = [] ) : self
$path string
$replaces array
Résultat self

createFromPath() public static méthode

Create new self instance from full path.
public static createFromPath ( string $path, array $replaces = [] ) : self
$path string
$replaces array
Résultat self

getBasePath() public static méthode

Get base path.
public static getBasePath ( ) : string | null
Résultat string | null

getContents() public méthode

Get stub contents.
public getContents ( ) : mixed | string
Résultat mixed | string

getPath() public méthode

Get stub path.
public getPath ( ) : string
Résultat string

getReplaces() public méthode

Get replacements.
public getReplaces ( ) : array
Résultat array

render() public méthode

Get stub contents.
public render ( ) : string
Résultat string

replace() public méthode

Set replacements array.
public replace ( array $replaces = [] )
$replaces array

saveTo() public méthode

Save stub to specific path.
public saveTo ( string $path, string $filename ) : boolean
$path string
$filename string
Résultat boolean

setBasePath() public static méthode

Set base path.
public static setBasePath ( string $path )
$path string

setPath() public méthode

Set stub path.
public setPath ( string $path ) : self
$path string
Résultat self

Property Details

$basePath protected_oe static_oe property

The base path of stub file.
protected static null|string $basePath
Résultat null | string

$path protected_oe property

The stub path.
protected string $path
Résultat string

$replaces protected_oe property

The replacements array.
protected array $replaces
Résultat array