ModeRegistry implements SingletonInterface
Registers and holds code editor modes
Table of Contents
Interfaces
- SingletonInterface
- "empty" interface for singletons (marker interface pattern)
Properties
- $defaultMode : Mode
- $registeredModes : array<string|int, Mode>
Methods
- getByFileExtension() : Mode
- getByFormatCode() : Mode
- getDefaultMode() : Mode
- isRegistered() : bool
- register() : ModeRegistry
- Registers modes for code editor
- unregister() : ModeRegistry
- Removes registered modes
Properties
$defaultMode
protected
Mode
$defaultMode
$registeredModes
protected
array<string|int, Mode>
$registeredModes
= []
Methods
getByFileExtension()
public
getByFileExtension(string $fileExtension) : Mode
Parameters
- $fileExtension : string
Tags
Return values
ModegetByFormatCode()
public
getByFormatCode(string $formatCode) : Mode
Parameters
- $formatCode : string
Tags
Return values
ModegetDefaultMode()
public
getDefaultMode() : Mode
Return values
ModeisRegistered()
public
isRegistered(string $formatCode) : bool
Parameters
- $formatCode : string
Return values
boolregister()
Registers modes for code editor
public
register(Mode $mode) : ModeRegistry
Parameters
- $mode : Mode
Return values
ModeRegistryunregister()
Removes registered modes
public
unregister(string $formatCode) : ModeRegistry
Parameters
- $formatCode : string