PHP 클래스 XeroPHP\Helpers

Class Helpers
파일 보기 프로젝트 열기: calcinai/xero-php 1 사용 예제들

공개 메소드들

메소드 설명
XMLToArray ( SimpleXMLElement $sxml )
arrayToXML ( array $array, null $key_override = null ) : string Convert a multi-d assoc array into an xml representation.
escape ( $string ) : string OAuth compliant escaping functions.
flattenAssocArray ( array $array, string $format, string | null $glue = null, boolean $escape = false ) : string | array Generic function to flatten an associative array into an arbitrarily delimited string.
isAssoc ( array $array )
pluralize ( $string )
singularize ( $string ) : mixed This function is based on Wave\Inflector::singularize().

메소드 상세

XMLToArray() 공개 정적인 메소드

public static XMLToArray ( SimpleXMLElement $sxml )
$sxml SimpleXMLElement

arrayToXML() 공개 정적인 메소드

Straightforward val unless there are numeric keys, in which case, the parent key is singularised and used.
public static arrayToXML ( array $array, null $key_override = null ) : string
$array array
$key_override null
리턴 string

escape() 공개 정적인 메소드

In php, as simple as rawurlencode(). There were a lot more seemingly redundant transformations in the SimpleOAuth class.
public static escape ( $string ) : string
$string
리턴 string

flattenAssocArray() 공개 정적인 메소드

Generic function to flatten an associative array into an arbitrarily delimited string.
public static flattenAssocArray ( array $array, string $format, string | null $glue = null, boolean $escape = false ) : string | array
$array array
$format string
$glue string | null
$escape boolean
리턴 string | array If no glue provided, it won't be imploded.

isAssoc() 공개 정적인 메소드

public static isAssoc ( array $array )
$array array

pluralize() 공개 정적인 메소드

public static pluralize ( $string )

singularize() 공개 정적인 메소드

It only contains a fraction of the rules from its predecessor, so only good for a quick basic singularisation.
public static singularize ( $string ) : mixed
$string
리턴 mixed