Nextcloud PHP API (master)

SetupResult
in package
implements JsonSerializable

Tags
brief

This class is used for storing the result of a setup check

since
28.0.0

Table of Contents

Interfaces

JsonSerializable

Constants

ERROR  = 'error'
INFO  = 'info'
SUCCESS  = 'success'
WARNING  = 'warning'

Properties

$description  : string|null
$descriptionParameters  : array<string|int, mixed>|null
$linkToDoc  : string|null
$name  : string|null
$severity  : string

Methods

error()  : self
getDescription()  : string|null
getDescriptionParameters()  : array<string|int, mixed>|null
getLinkToDoc()  : string|null
getName()  : string|null
getSeverity()  : self::SUCCESS|self::INFO|self::WARNING|self::ERROR
info()  : self
jsonSerialize()  : array<string|int, mixed>
setName()  : void
success()  : self
warning()  : self
__construct()  : mixed

Constants

ERROR

public mixed ERROR = 'error'
Tags
since
28.0.0

SUCCESS

public mixed SUCCESS = 'success'
Tags
since
28.0.0

WARNING

public mixed WARNING = 'warning'
Tags
since
28.0.0

Properties

$description

private string|null $description = null

$descriptionParameters

private array<string|int, mixed>|null $descriptionParameters = null

Methods

error()

public static error([string|null $description = null ][, string|null $linkToDoc = null ][, array<string|int, mixed>|null $descriptionParameters = null ]) : self
Parameters
$description : string|null = null

Translated detailed description to display to the user

$linkToDoc : string|null = null

URI of related relevent documentation, be it from Nextcloud or another project

$descriptionParameters : array<string|int, mixed>|null = null
Tags
brief

Create an error result object

throws
InvalidObjectExeption
since
28.0.0
since
28.0.2

Optional parameter ?array $descriptionParameters

since
28.0.2

throws \OCP\RichObjectStrings\InvalidObjectExeption

Return values
self

getDescription()

public getDescription() : string|null
Tags
brief

Get the description for the setup check result

since
28.0.0
Return values
string|null

getDescriptionParameters()

public getDescriptionParameters() : array<string|int, mixed>|null
Tags
brief

Get the description parameters for the setup check result

If this returns null, description must not be treated as rich text

since
28.0.2
Return values
array<string|int, mixed>|null

getLinkToDoc()

public getLinkToDoc() : string|null
Tags
brief

Get a link to the doc for the explanation.

since
28.0.0
Return values
string|null

getName()

public getName() : string|null
Tags
brief

Get the name for the setup check

since
28.0.0
Return values
string|null

getSeverity()

public getSeverity() : self::SUCCESS|self::INFO|self::WARNING|self::ERROR
Tags
brief

Get the severity for the setup check result

since
28.0.0
Return values
self::SUCCESS|self::INFO|self::WARNING|self::ERROR

info()

public static info([string|null $description = null ][, string|null $linkToDoc = null ][, array<string|int, mixed>|null $descriptionParameters = null ]) : self
Parameters
$description : string|null = null

Translated detailed description to display to the user

$linkToDoc : string|null = null

URI of related relevent documentation, be it from Nextcloud or another project

$descriptionParameters : array<string|int, mixed>|null = null
Tags
brief

Create an info result object

throws
InvalidObjectExeption
since
28.0.0
since
28.0.2

Optional parameter ?array $descriptionParameters

since
28.0.2

throws \OCP\RichObjectStrings\InvalidObjectExeption

Return values
self

jsonSerialize()

public jsonSerialize() : array<string|int, mixed>
Tags
brief

Get an array representation of the result for API responses

since
28.0.0
Return values
array<string|int, mixed>

setName()

public setName(string $name) : void
Parameters
$name : string
Tags
brief

Set the name from the setup check

since
28.0.0

success()

public static success([string|null $description = null ][, string|null $linkToDoc = null ][, array<string|int, mixed>|null $descriptionParameters = null ]) : self
Parameters
$description : string|null = null

Translated detailed description to display to the user

$linkToDoc : string|null = null

URI of related relevent documentation, be it from Nextcloud or another project

$descriptionParameters : array<string|int, mixed>|null = null
Tags
brief

Create a success result object

throws
InvalidObjectExeption
since
28.0.0
since
28.0.2

Optional parameter ?array $descriptionParameters

since
28.0.2

throws \OCP\RichObjectStrings\InvalidObjectExeption

Return values
self

warning()

public static warning([string|null $description = null ][, string|null $linkToDoc = null ][, array<string|int, mixed>|null $descriptionParameters = null ]) : self
Parameters
$description : string|null = null

Translated detailed description to display to the user

$linkToDoc : string|null = null

URI of related relevent documentation, be it from Nextcloud or another project

$descriptionParameters : array<string|int, mixed>|null = null
Tags
brief

Create a warning result object

throws
InvalidObjectExeption
since
28.0.0
since
28.0.2

Optional parameter ?array $descriptionParameters

since
28.0.2

throws \OCP\RichObjectStrings\InvalidObjectExeption

Return values
self

__construct()

private __construct(self::SUCCESS|self::INFO|self::WARNING|self::ERROR $severity[, string|null $description = null ][, array<string, array<string, string>> $descriptionParameters = null ][, string|null $linkToDoc = null ]) : mixed
Parameters
$severity : self::SUCCESS|self::INFO|self::WARNING|self::ERROR
$description : string|null = null
$descriptionParameters : array<string, array<string, string>> = null
$linkToDoc : string|null = null
Tags
brief

Private constructor, use success()/info()/warning()/error() instead

throws
InvalidObjectExeption
since
28.0.0
since
28.0.2

Optional parameter ?array $descriptionParameters

since
28.0.2

throws \OCP\RichObjectStrings\InvalidObjectExeption


        
On this page

Search results