Producer

Contains helper methods for anything which generates content.

trait Producer
Copyright
2016 Appertly
License
Apache-2.0

Static Properties

Protected
NameTypeSummary
$primitivesImmSet<string>
$thisyImmSet<string>

Instance Methods

Protected
ReturnsSignature and Description
string
getFilename(ScannedBase $c)

Cleans up a filename.

Page
getPage(string $title)

Gets a page builder.

bool
isPrimitive(string $type)

Gets whether the provided type is primitive.

bool
isThisy(?ScannedTypehint $type)

Gets whether the provided typehint refers to $this

bool
isVoid(?ScannedTypehint $type)

Gets whether the provided typehint is void.

Property Details

$primitives

static protected ImmSet<string> $primitives

$thisy

static protected ImmSet<string> $thisy

Method Details

getFilename

protected function getFilename(ScannedBase $c)

Cleans up a filename.

Parameters
NameTypeDescription
$cScannedBase

The scanned token

Returns
TypeDescription
string

The cleaned up filename

getPage

protected function getPage(string $title)

Gets a page builder.

Parameters
NameTypeDescription
$titlestring

The page title

Returns
TypeDescription
Page

The page builder

isPrimitive

protected function isPrimitive(string $type)

Gets whether the provided type is primitive.

Parameters
NameTypeDescription
$typestring

The type to test

Returns
TypeDescription
bool

true if the type is primitive.

isThisy

protected function isThisy(?ScannedTypehint $type)

Gets whether the provided typehint refers to $this

Parameters
NameTypeDescription
$type?ScannedTypehint

The typehint to test

Returns
TypeDescription
bool

true if the typehint is thisy

isVoid

protected function isVoid(?ScannedTypehint $type)

Gets whether the provided typehint is void.

Parameters
NameTypeDescription
$type?ScannedTypehint

The typehint to test

Returns
TypeDescription
bool

true if the typehint is void