Documentation

StringToEffectParser extends StringToTParser
in package
Uses SingletonTrait

Handles parsing effect types from strings. This is used to interpret names in the /effect command.

Tags
phpstan-extends

StringToTParser<Effect>

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()  : Effect|null
Tries to parse the specified string into an enchantment.
register()  : 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) : Effect|null
Parameters
$input : string
Return values
Effect|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

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