<commit_before>PHP Shipping API
================

A shipping rate wrapper for USPS, UPS, and Fedex.

## Installation

Add the following lines to your ``composer.json`` file.

```JSON
{
	"repositories": [
		{
			"type": "vcs",
			"url": "https://github.com/pdt256/shipping.git"
		}
	],
	"require": {
		"pdt256/shipping": "dev-master"
	}
}
```

## Example

Create a shipment object:

```php
$shipment = [
	'weight' => 3, // lbs
	'dimensions' => [
		'width' => 9, // inches
		'length' => 9,
		'height' => 9,
	],
	'from' => [
		'postal_code' => '90401',
		'country_code' => 'US',
	],
	'to' => [
		'postal_code' => '78703',
		'country_code' => 'US',
		'is_residential' => TRUE,
	],
];
```

## UPS (Stub) Example

Below is an example request to get shipping rates from the UPS API. 

Notice: The below line uses a stub class to fake a response from the UPS API.
You can immediately use this method in your code until you get an account with UPS.
```
'request_adapter' => new RateRequest\StubUPS(),
```

```php
use pdt256\Shipping\UPS;
use pdt256\Shipping\RateRequest;

$ups = new UPS\Rate([
	'prod'            => FALSE,
	'access_key'      => 'XXXX',<commit_msg>Adding readme php syntax.<commit_after>PHP Shipping API
================

A shipping rate wrapper for USPS, UPS, and Fedex.

## Installation

Add the following lines to your ``composer.json`` file.

```JSON
{
	"repositories": [
		{
			"type": "vcs",
			"url": "https://github.com/pdt256/shipping.git"
		}
	],
	"require": {
		"pdt256/shipping": "dev-master"
	}
}
```

## Example

Create a shipment object:

```php
$shipment = [
	'weight' => 3, // lbs
	'dimensions' => [
		'width' => 9, // inches
		'length' => 9,
		'height' => 9,
	],
	'from' => [
		'postal_code' => '90401',
		'country_code' => 'US',
	],
	'to' => [
		'postal_code' => '78703',
		'country_code' => 'US',
		'is_residential' => TRUE,
	],
];
```

## UPS (Stub) Example

Below is an example request to get shipping rates from the UPS API. 

Notice: The below line uses a stub class to fake a response from the UPS API.
You can immediately use this method in your code until you get an account with UPS.

```php
'request_adapter' => new RateRequest\StubUPS(),
```

```php
use pdt256\Shipping\UPS;
use pdt256\Shipping\RateRequest;

$ups = new UPS\Rate([
	'prod'            => FALSE,
	'access_key'      => 'XXXX',
{'fraction_non_alphanumeric': 0.18615649183147034, 'fraction_numerical': 0.02235597592433362, 'mean_word_length': 3.4408396946564888, 'pattern_counts': {'":': 10, '<': 3, '<?xml version=': 0, '>': 33, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1581762', 'n_tokens_mistral': 957, 'n_tokens_neox': 854, 'n_words': 249}