MetaFox

Stub
in package

Class Stub.

Table of Contents

Properties

$basePath  : null|string
The base path of stub file.
$path  : string
The stub path.
$replaces  : array<string, mixed>
The replacements array.

Methods

__construct()  : mixed
The constructor.
__toString()  : string
Handle magic method __toString.
create()  : self
Create new self instance.
getBasePath()  : string|null
Get base path.
getContents()  : string
Get stub contents.
getPath()  : string
Get stub path.
getReplaces()  : array<string, mixed>
Get replacements.
render()  : string
Get stub contents.
replace()  : self
Set replacements array.
saveTo()  : bool
Save stub to specific path.
setBasePath()  : void
Set base path.
setPath()  : self
Set stub path.

Properties

$basePath

The base path of stub file.

protected static null|string $basePath = null

$path

The stub path.

protected string $path

$replaces

The replacements array.

protected array<string, mixed> $replaces = []

Methods

__construct()

The constructor.

public __construct(string $path[, array<string, mixed> $replaces = [] ]) : mixed
Parameters
$path : string
$replaces : array<string, mixed> = []

__toString()

Handle magic method __toString.

public __toString() : string
Return values
string

create()

Create new self instance.

public static create(string $path[, array<string, mixed> $replacements = [] ]) : self
Parameters
$path : string
$replacements : array<string, mixed> = []
Return values
self

getBasePath()

Get base path.

public static getBasePath() : string|null
Return values
string|null

getContents()

Get stub contents.

public getContents() : string
Return values
string

getPath()

Get stub path.

public getPath() : string
Return values
string

getReplaces()

Get replacements.

public getReplaces() : array<string, mixed>
Return values
array<string, mixed>

render()

Get stub contents.

public render() : string
Return values
string

replace()

Set replacements array.

public replace([array<string, mixed> $replaces = [] ]) : self
Parameters
$replaces : array<string, mixed> = []
Return values
self

saveTo()

Save stub to specific path.

public saveTo(string $path, string $filename) : bool
Parameters
$path : string
$filename : string
Return values
bool

setBasePath()

Set base path.

public static setBasePath(string $path) : void
Parameters
$path : string

setPath()

Set stub path.

public setPath(string $path) : self
Parameters
$path : string
Return values
self

        
On this page

Search results