InternalUtil
in package
Table of Contents
- convertToEasyPostObject() : mixed
- Convert input to an EasyPost object.
- getLowestObjectRate() : Rate
- Get the lowest rate of an EasyPost object (eg: Shipment, Order, Pickup).
- isList() : bool
- Check if input is a list (eg: sequential array).
Methods
convertToEasyPostObject()
Convert input to an EasyPost object.
public
static convertToEasyPostObject(EasyPostClient $client, mixed $response[, string $parent = null ][, string $name = null ]) : mixed
Parameters
- $client : EasyPostClient
- $response : mixed
- $parent : string = null
- $name : string = null
Return values
mixed —getLowestObjectRate()
Get the lowest rate of an EasyPost object (eg: Shipment, Order, Pickup).
public
static getLowestObjectRate(mixed $easypostObject[, array<string|int, mixed> $carriers = [] ][, array<string|int, mixed> $services = [] ][, string $ratesKey = 'rates' ]) : Rate
To exclude a carrier or service, prepend the string with !.
This internal utility is intended to be used by other EasyPost lowest_rate functions.
Parameters
- $easypostObject : mixed
- $carriers : array<string|int, mixed> = []
- $services : array<string|int, mixed> = []
- $ratesKey : string = 'rates'
Tags
Return values
Rate —isList()
Check if input is a list (eg: sequential array).
public
static isList( $array) : bool
PHP treats JSON objects (associative arrays) and lists (sequential arrays) as the same thing (array), so one can use this function to determine what kind of array something is.