Documentation

Main extends PluginBase
in package
implements Listener

Interfaces, Classes, Traits and Enums

Listener
Classes implementing this interface can be registered to receive called Events.

Table of Contents

$completedTests  : array<string|int, Test>
$currentTest  : Test|null
$currentTestNumber  : int
$waitingTests  : array<string|int, Test>
$config  : Config|null
$configFile  : string
$dataFolder  : string
$description  : PluginDescription
$file  : string
$isEnabled  : bool
$loader  : PluginLoader
$logger  : PluginLogger
$resourceProvider  : ResourceProvider
$scheduler  : TaskScheduler
$server  : Server
__construct()  : mixed
getCommand()  : Command|PluginOwned|null
getConfig()  : Config
getDataFolder()  : string
Gets the plugin's data folder to save files and configuration.
getDescription()  : PluginDescription
getFullName()  : string
getLogger()  : AttachableLogger
getName()  : string
getPluginLoader()  : PluginLoader
getResource()  : null|resource
Gets an embedded resource on the plugin file.
getResources()  : array<string|int, SplFileInfo>
Returns all the resources packaged with the plugin in the form ["path/in/resources" => SplFileInfo]
getScheduler()  : TaskScheduler
getServer()  : Server
isDisabled()  : bool
isEnabled()  : bool
onCommand()  : bool
onEnable()  : void
Called when the plugin is enabled
onServerCommand()  : void
reloadConfig()  : void
saveConfig()  : void
saveDefaultConfig()  : bool
saveResource()  : bool
Saves an embedded resource to its relative location in the data folder
getFile()  : string
onDisable()  : void
Called when the plugin is disabled Use this to free open things and finish actions
onLoad()  : void
Called when the plugin is loaded, before calling onEnable()
onAllTestsCompleted()  : void
onTestCompleted()  : void
registerYamlCommands()  : void
Registers commands declared in the plugin manifest
startNextTest()  : bool

Properties

$completedTests

protected array<string|int, Test> $completedTests = []

$currentTest

protected Test|null $currentTest = null

$currentTestNumber

protected int $currentTestNumber = 0

$waitingTests

protected array<string|int, Test> $waitingTests = []

Methods

getDataFolder()

Gets the plugin's data folder to save files and configuration.

public final getDataFolder() : string

This directory name has a trailing slash.

Return values
string

getFullName()

public final getFullName() : string
Return values
string

getName()

public final getName() : string
Return values
string

getResource()

Gets an embedded resource on the plugin file.

public getResource(string $filename) : null|resource

WARNING: You must close the resource given using fclose()

Parameters
$filename : string
Return values
null|resource

Resource data, or null

getResources()

Returns all the resources packaged with the plugin in the form ["path/in/resources" => SplFileInfo]

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

isDisabled()

public final isDisabled() : bool
Return values
bool

isEnabled()

public final isEnabled() : bool
Return values
bool

onCommand()

public onCommand(CommandSender $sender, Command $command, string $label, array<string|int, string> $args) : bool
Parameters
$sender : CommandSender
$command : Command
$label : string
$args : array<string|int, string>
Return values
bool

onEnable()

Called when the plugin is enabled

public onEnable() : void
Return values
void

reloadConfig()

public reloadConfig() : void
Return values
void

saveConfig()

public saveConfig() : void
Return values
void

saveDefaultConfig()

public saveDefaultConfig() : bool
Return values
bool

saveResource()

Saves an embedded resource to its relative location in the data folder

public saveResource(string $filename[, bool $replace = false ]) : bool
Parameters
$filename : string
$replace : bool = false
Return values
bool

getFile()

protected getFile() : string
Return values
string

onDisable()

Called when the plugin is disabled Use this to free open things and finish actions

protected onDisable() : void
Return values
void

onLoad()

Called when the plugin is loaded, before calling onEnable()

protected onLoad() : void
Return values
void

onAllTestsCompleted()

private onAllTestsCompleted() : void
Return values
void

onTestCompleted()

private onTestCompleted(Test $test) : void
Parameters
$test : Test
Return values
void

registerYamlCommands()

Registers commands declared in the plugin manifest

private registerYamlCommands() : void
Return values
void

startNextTest()

private startNextTest() : bool
Return values
bool

Search results