Documentation

InternalUtil
in package

Table of Contents

convertToEasyPostObject()  : mixed
Convert input to an EasyPost object.
getLowestObjectRate()  : Rate|PickupRate
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|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' ]) : Rate|PickupRate

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
Rate|PickupRate

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

Search results