PHP Класс Nwidart\Modules\Support\Stub

Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$basePath null | string The base path of stub file.
$path string The stub path.
$replaces array The replacements array.

Открытые методы

Метод Описание
__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.

Описание методов

__construct() публичный Метод

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

__toString() публичный Метод

Handle magic method __toString.
public __toString ( ) : string
Результат string

create() публичный статический Метод

Create new self instance.
public static create ( string $path, array $replaces = [] ) : self
$path string
$replaces array
Результат self

createFromPath() публичный статический Метод

Create new self instance from full path.
public static createFromPath ( string $path, array $replaces = [] ) : self
$path string
$replaces array
Результат self

getBasePath() публичный статический Метод

Get base path.
public static getBasePath ( ) : string | null
Результат string | null

getContents() публичный Метод

Get stub contents.
public getContents ( ) : mixed | string
Результат mixed | string

getPath() публичный Метод

Get stub path.
public getPath ( ) : string
Результат string

getReplaces() публичный Метод

Get replacements.
public getReplaces ( ) : array
Результат array

render() публичный Метод

Get stub contents.
public render ( ) : string
Результат string

replace() публичный Метод

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

saveTo() публичный Метод

Save stub to specific path.
public saveTo ( string $path, string $filename ) : boolean
$path string
$filename string
Результат boolean

setBasePath() публичный статический Метод

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

setPath() публичный Метод

Set stub path.
public setPath ( string $path ) : self
$path string
Результат self

Описание свойств

$basePath защищенное статическое свойство

The base path of stub file.
protected static null|string $basePath
Результат null | string

$path защищенное свойство

The stub path.
protected string $path
Результат string

$replaces защищенное свойство

The replacements array.
protected array $replaces
Результат array