ApiOpenStudio PHPDoc

Normalise
in package

Class Normalise

Normalize data - this is not used ATM.

Table of Contents

$defaultNormalise  : string
Default result format for normalise.
$data  : mixed
Input data.
$format  : string
Input data format.
normalise()  : mixed
Call the default normalise function
set()  : void
Set the data to be processed.
toArray()  : array<string|int, mixed>
Convert data to an array.
toStdClass()  : stdClass
Convert constructs and text to stdClass.
calcFormat()  : string
Calculate the format type of a string.
domNodeToArray()  : array<string|int, mixed>
Convert an XML node into an array attribute.
getFormat()  : string|array<string|int, string>|null
We can pass in the full header array or header[CURLINFO_CONTENT_TYPE].
jsonToArray()  : array<string|int, mixed>
Convert JSON to array.
jsonToStdClass()  : stdClass
Convert JSON to stdClass.
parseContentType()  : string|array<string|int, string>|null
Validate content types.
xmlToArray()  : array<string|int, mixed>
Convert XML string into an array, maintaining attributes and cdata.
xmlToStdClass()  : stdClass
Convert XML to stdClass.

Properties

$defaultNormalise

Default result format for normalise.

public string $defaultNormalise = 'array'

$format

Input data format.

private string $format

Methods

normalise()

Call the default normalise function

public normalise([string|null $into = null ]) : mixed
Parameters
$into : string|null = null

Format to normalize to.

Tags
throws
ApiException

Exception.

Return values
mixed

set()

Set the data to be processed.

public set(mixed $data, string $format) : void
Parameters
$data : mixed

Data to normalize.

$format : string

Format to normalise into.

Return values
void

toArray()

Convert data to an array.

public toArray() : array<string|int, mixed>
Tags
throws
ApiException

Exception.

Return values
array<string|int, mixed>

toStdClass()

Convert constructs and text to stdClass.

public toStdClass() : stdClass
Tags
throws
ApiException

Exception.

Return values
stdClass

calcFormat()

Calculate the format type of a string.

private calcFormat() : string
Return values
string

domNodeToArray()

Convert an XML node into an array attribute.

private domNodeToArray(object $node) : array<string|int, mixed>
Parameters
$node : object

Dom Node.

Return values
array<string|int, mixed>

getFormat()

We can pass in the full header array or header[CURLINFO_CONTENT_TYPE].

private getFormat() : string|array<string|int, string>|null
Tags
throws
ApiException

Exception.

Return values
string|array<string|int, string>|null

jsonToArray()

Convert JSON to array.

private jsonToArray() : array<string|int, mixed>
Return values
array<string|int, mixed>

jsonToStdClass()

Convert JSON to stdClass.

private jsonToStdClass() : stdClass
Return values
stdClass

parseContentType()

Validate content types.

private parseContentType(string $str) : string|array<string|int, string>|null
Parameters
$str : string

Header string.

Tags
throws
ApiException

Invalid header value.

Return values
string|array<string|int, string>|null

xmlToStdClass()

Convert XML to stdClass.

private xmlToStdClass() : stdClass
Return values
stdClass

Search results