PHP 클래스 Nathanmac\Utilities\Parser\Parser

저자: Nathan Macnamara ([email protected])
파일 보기 프로젝트 열기: nathanmac/parser 1 사용 예제들

공개 메소드들

메소드 설명
all ( ) : array Alias to the payload function.
bson ( $payload ) : array BSON parser, helper function.
except ( string | array $keys ) : array Get all of the input except for a specified array of items.
get ( string $key = null, string $default = null ) : mixed | null Retrieve an payload item from the payload data, return default item if item not found.
getFormatClass ( $format = '' ) : string Autodetect the payload data type using content-type value.
has ( string | array $keys ) : boolean Determine if the payload contains a non-empty value for a given key.
json ( $payload ) : array JSON parser, helper function.
mask ( array $mask ) : array Mask input data with a given mapping.
msgpack ( $payload ) : array MSGPack parser, helper function.
only ( string | array $keys ) : array Get a subset of the items from the payload data.
parse ( string $payload, Nathanmac\Utilities\Parser\Formats\FormatInterface $format ) : array Parse payload string using given formatter.
payload ( string $format = '' ) : array Parse the HTTP payload data, autodetect format and return all data in array.
querystr ( $payload ) : array Query String parser, helper function.
registerFormat ( $format, $class ) : self Register Format Class.
serialize ( $payload ) : array Serialized Data parser, helper function.
xml ( $payload ) : array XML parser, helper function.
yaml ( $payload ) : array YAML parser, helper function.

보호된 메소드들

메소드 설명
getPayload ( ) : string Return the payload data from the HTTP post request.

비공개 메소드들

메소드 설명
buildArray ( $route, null $data = null ) : array | null Build the array structure for value.
getValueAtKey ( $key, $data ) : mixed Return a value from the array identified from the key.
hasValueAtKey ( $key, $data ) : boolean Array contains a value identified from the key, returns bool
processContentType ( string $contentType ) : boolean | string Process the content-type values
processMask ( array $mask ) : string Recursive processor for processing user masks.
removeValue ( &$array, $key ) Remove a value identified from the key

메소드 상세

all() 공개 메소드

Alias to the payload function.
public all ( ) : array
리턴 array

bson() 공개 메소드

BSON parser, helper function.
public bson ( $payload ) : array
$payload
리턴 array

except() 공개 메소드

Get all of the input except for a specified array of items.
public except ( string | array $keys ) : array
$keys string | array
리턴 array

get() 공개 메소드

Retrieve an payload item from the payload data, return default item if item not found.
public get ( string $key = null, string $default = null ) : mixed | null
$key string
$default string
리턴 mixed | null

getFormatClass() 공개 메소드

Autodetect the payload data type using content-type value.
public getFormatClass ( $format = '' ) : string
리턴 string Return the name of the formatter class.

getPayload() 보호된 메소드

Return the payload data from the HTTP post request.
protected getPayload ( ) : string
리턴 string

has() 공개 메소드

Determine if the payload contains a non-empty value for a given key.
public has ( string | array $keys ) : boolean
$keys string | array
리턴 boolean

json() 공개 메소드

JSON parser, helper function.
public json ( $payload ) : array
$payload
리턴 array

mask() 공개 메소드

Mask input data with a given mapping.
public mask ( array $mask ) : array
$mask array
리턴 array

msgpack() 공개 메소드

MSGPack parser, helper function.
public msgpack ( $payload ) : array
$payload
리턴 array

only() 공개 메소드

Get a subset of the items from the payload data.
public only ( string | array $keys ) : array
$keys string | array
리턴 array

parse() 공개 메소드

Parse payload string using given formatter.
public parse ( string $payload, Nathanmac\Utilities\Parser\Formats\FormatInterface $format ) : array
$payload string
$format Nathanmac\Utilities\Parser\Formats\FormatInterface
리턴 array

payload() 공개 메소드

Override the format by providing a content type.
public payload ( string $format = '' ) : array
$format string
리턴 array

querystr() 공개 메소드

Query String parser, helper function.
public querystr ( $payload ) : array
$payload
리턴 array

registerFormat() 공개 메소드

Register Format Class.
public registerFormat ( $format, $class ) : self
$format
$class
리턴 self

serialize() 공개 메소드

Serialized Data parser, helper function.
public serialize ( $payload ) : array
$payload
리턴 array

xml() 공개 메소드

XML parser, helper function.
public xml ( $payload ) : array
$payload
리턴 array

yaml() 공개 메소드

YAML parser, helper function.
public yaml ( $payload ) : array
$payload
리턴 array