Documentation

StringToItemParser extends StringToTParser
in package
Uses SingletonTrait

Handles parsing items from strings. This is used to interpret names from the /give command (and others).

Tags
phpstan-extends

StringToTParser<Item>

Table of Contents

$callbackMap  : array<string|int, mixed>
$instance  : self|null
getInstance()  : self
getKnownAliases()  : array<string|int, string>|array<string|int, int>
override()  : void
parse()  : Item|null
Tries to parse the specified string into an enchantment.
register()  : void
registerBlock()  : void
reset()  : void
setInstance()  : void
reprocess()  : string
make()  : self

Properties

$callbackMap

private array<string|int, mixed> $callbackMap = []
Tags
phpstan-var

array<string, \Closure(string $input) : T>

Methods

getInstance()

public static getInstance() : self
Return values
self

getKnownAliases()

public getKnownAliases() : array<string|int, string>|array<string|int, int>
Return values
array<string|int, string>|array<string|int, int>

override()

public override(string $alias, Closure $callback) : void
Parameters
$alias : string
$callback : Closure
Tags
phpstan-param

\Closure(string $input) : T $callback

Return values
void

parse()

Tries to parse the specified string into an enchantment.

public parse(string $input) : Item|null
Parameters
$input : string
Return values
Item|null

register()

public register(string $alias, Closure $callback) : void
Parameters
$alias : string
$callback : Closure
Tags
phpstan-param

\Closure(string $input) : T $callback

Return values
void

registerBlock()

public registerBlock(string $alias, Closure $callback) : void
Parameters
$alias : string
$callback : Closure
Tags
phpstan-param

\Closure(string $input) : Block $callback

Return values
void

setInstance()

public static setInstance(self $instance) : void
Parameters
$instance : self
Return values
void

reprocess()

protected reprocess(string $input) : string
Parameters
$input : string
Return values
string

Search results