Nextcloud PHP API (master)

Entry
in package

Model that represent config values within an app config lexicon.

Tags
see
ILexicon
Attributes
#[Consumable]
$since: '32.0.0'

Table of Contents

Constants

RENAME_INVERT_BOOLEAN  = 1

Properties

$default  : string|null
$defaultRaw  : null|string|int|float|bool|array<string|int, mixed>|Closure
$definition  : string
$deprecated  : bool
$flags  : int
$key  : string
$lazy  : bool
$note  : string
$options  : int
$rename  : string|null
$type  : ValueType

Methods

__construct()  : mixed
convertToString()  : string
convert $entry into string, based on the expected type for config value
getDefault()  : string|null
returns default value
getDefinition()  : string
returns definition
getFlags()  : int
returns flags
getKey()  : string
returns the config key
getNote()  : string
returns eventual note
getRename()  : string|null
should be called/used only during migration/upgrade.
getValueType()  : ValueType
get expected type for config value
hasOption()  : bool
isDeprecated()  : bool
returns if config key is set as deprecated
isFlagged()  : bool
isLazy()  : bool
returns if config key is set as lazy
convertFromArray()  : string
convertFromBool()  : string
convertFromFloat()  : string
convertFromInt()  : string
convertFromString()  : string

Constants

RENAME_INVERT_BOOLEAN

public mixed RENAME_INVERT_BOOLEAN = 1
Tags
since
32.0.0

Properties

$default

private string|null $default = null

$defaultRaw

private null|string|int|float|bool|array<string|int, mixed>|Closure $defaultRaw = null

$definition

private string $definition = ''

$deprecated read-only

private bool $deprecated = false

$flags read-only

private int $flags = 0

$key read-only

private string $key

$lazy read-only

private bool $lazy = false

$note

private string $note = ''

$options read-only

private int $options = 0

$rename read-only

private string|null $rename = null

Methods

__construct()

public __construct(string $key, ValueType $type[, string|int|float|bool|array<string|int, mixed>|Closure|null $defaultRaw = null ][, string $definition = '' ][, bool $lazy = false ][, int $flags = 0 ][, bool $deprecated = false ][, string|null $rename = null ][, int $options = 0 ][, string $note = '' ]) : mixed
Parameters
$key : string

config key; can only contain alphanumerical chars and underscore "_"

$type : ValueType

type of config value

$defaultRaw : string|int|float|bool|array<string|int, mixed>|Closure|null = null

default value to be used in case none known

$definition : string = ''

optional description of config key available when using occ command

$lazy : bool = false

set config value as lazy

$flags : int = 0

set flags

$deprecated : bool = false

set config key as deprecated

$rename : string|null = null

source in case of a rename of a config key.

$options : int = 0

additional bitflag options self::RENAME_INVERT_BOOLEAN

$note : string = ''

additional note and warning related to the use of the config key.

Tags
since
32.0.0
psalm-suppress

PossiblyInvalidCast

psalm-suppress

RiskyCast

convertToString()

convert $entry into string, based on the expected type for config value

public convertToString(string|int|float|bool|array<string|int, mixed> $entry) : string
Parameters
$entry : string|int|float|bool|array<string|int, mixed>
Tags
since
32.0.0
psalm-suppress

PossiblyInvalidCast arrays are managed pre-cast

psalm-suppress

RiskyCast

Return values
string

getDefault()

returns default value

public getDefault(Preset $preset) : string|null
Parameters
$preset : Preset
Tags
since
32.0.0
Return values
string|null

NULL if no default is set

getDefinition()

returns definition

public getDefinition() : string
Tags
since
32.0.0
Return values
string

getFlags()

returns flags

public getFlags() : int
Tags
see
IAppConfig

for details on sensitive config values

since
32.0.0
Return values
int

bitflag about the config value

getKey()

returns the config key

public getKey() : string
Tags
since
32.0.0
Return values
string

config key

getNote()

returns eventual note

public getNote() : string
Tags
since
32.0.0
Return values
string

getRename()

should be called/used only during migration/upgrade.

public getRename() : string|null

link to an old config key.

Tags
since
32.0.0
Return values
string|null

not NULL if value can be imported from a previous key

getValueType()

get expected type for config value

public getValueType() : ValueType
Tags
since
32.0.0
Return values
ValueType

hasOption()

public hasOption(int $option) : bool
Parameters
$option : int
Tags
since
32.0.0
Return values
bool

TRUE if $option was set during the creation of the entry.

isDeprecated()

returns if config key is set as deprecated

public isDeprecated() : bool
Tags
since
32.0.0
Return values
bool

TRUE if config si deprecated

isFlagged()

public isFlagged(int $flag) : bool
Parameters
$flag : int
Tags
since
32.0.0
Return values
bool

TRUE is config value bitflag contains $flag

isLazy()

returns if config key is set as lazy

public isLazy() : bool
Tags
see
IAppConfig

for details on lazy config values

since
32.0.0
Return values
bool

TRUE if config value is lazy

convertFromArray()

private convertFromArray(array<string|int, mixed> $default) : string
Parameters
$default : array<string|int, mixed>
Tags
since
32.0.0
Return values
string

convertFromBool()

private convertFromBool(bool $default) : string
Parameters
$default : bool
Tags
since
32.0.0
Return values
string

convertFromFloat()

private convertFromFloat(float $default) : string
Parameters
$default : float
Tags
since
32.0.0
Return values
string

convertFromInt()

private convertFromInt(int $default) : string
Parameters
$default : int
Tags
since
32.0.0
Return values
string

convertFromString()

private convertFromString(string $default) : string
Parameters
$default : string
Tags
since
32.0.0
Return values
string

        
On this page

Search results