Documentation

InternalUtil
in package

Table of Contents

convertToEasyPostObject()  : mixed
Convert input to an EasyPost object.
getLowestObjectRate()  : object
Get the lowest rate of an EasyPost object (eg: Shipment, Order, Pickup).
isList()  : bool
Check if input is a list (eg: sequential array).
wrapParams()  : mixed
Wraps the params in a key.

Methods

convertToEasyPostObject()

Convert input to an EasyPost object.

public static convertToEasyPostObject(EasyPostClient|null $client, mixed $response) : mixed
Parameters
$client : EasyPostClient|null
$response : mixed
Return values
mixed

getLowestObjectRate()

Get the lowest rate of an EasyPost object (eg: Shipment, Order, Pickup).

public static getLowestObjectRate(EasyPostObject|null $easypostObject[, array<string|int, string> $carriers = [] ][, array<string|int, string> $services = [] ][, string|null $ratesKey = 'rates' ]) : object

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 : EasyPostObject|null
$carriers : array<string|int, string> = []
$services : array<string|int, string> = []
$ratesKey : string|null = 'rates'
Tags
throws
EasyPostException
Return values
object

isList()

Check if input is a list (eg: sequential array).

public static isList(mixed $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.

Parameters
$array : mixed
Return values
bool

wrapParams()

Wraps the params in a key.

public static wrapParams(mixed $params, string $keyName) : mixed
Parameters
$params : mixed
$keyName : string
Return values
mixed

Search results