<commit_before># Shop API SDK

## Installation

The recommended way to install the ShopAPI is through [Composer](http://getcomposer.org).

```bash
# Install Composer
curl -sS https://getcomposer.org/installer | php
```

# Add the ShopAPI as a dependency

    ``` json
    {
        "repositories": [
            {
                "type": "git",
                "url": "<EMAIL>:antevorte/frontend-api-sdks/shop-sdk.git"
            }
        ],
        "require": {
            "collins/shop-sdk": "dev-feature/DEVCENTER-53"
        }
    }
    ```
After installing, you need to require Composer's autoloader:

```php
require 'vendor/autoload.php';
```

## Usage

Example how to use the shop-api-sdk with the mono logger, the log detail depends on yii debug configuration.

```php
use Collins\ShopApi;
use Monolog\Logger;
use Monolog\Handler\StreamHandler;

    $logger = new Logger('name');
    $logger->pushHandler(new StreamHandler(Yii::app()->getRuntimePath(). '/mono.log', Logger::DEBUG));

    $shopApi = new ShopApi($appId, $appPassword, $shopApiHost, null, $logger);
    if (YII_DEBUG) {
        $shopApi->setLogTemplate(\Guzzle\Log\MessageFormatter::DEBUG_FORMAT);
    } else {
        $shopApi->setLogTemplate(\Guzzle\Log\MessageFormatter::SHORT_FORMAT);
    }
```


## Testing
```bash
php vendor/phpunit/phpunit/phpunit.php
```<commit_msg>DEVCENTER-53 - fix typo<commit_after># Shop API SDK

## Installation

The recommended way to install the ShopAPI is through [Composer](http://getcomposer.org).

```bash
# Install Composer
curl -sS https://getcomposer.org/installer | php
```

# Add the ShopAPI as a dependency

    ```json
    {
        "repositories": [
            {
                "type": "git",
                "url": "<EMAIL>:antevorte/frontend-api-sdks/shop-sdk.git"
            }
        ],
        "require": {
            "collins/shop-sdk": "dev-feature/DEVCENTER-53"
        }
    }
    ```
After installing, you need to require Composer's autoloader:

```php
require 'vendor/autoload.php';
```

## Usage

Example how to use the shop-api-sdk with the mono logger, the log detail depends on yii debug configuration.

```php
use Collins\ShopApi;
use Monolog\Logger;
use Monolog\Handler\StreamHandler;

    $logger = new Logger('name');
    $logger->pushHandler(new StreamHandler(Yii::app()->getRuntimePath(). '/mono.log', Logger::DEBUG));

    $shopApi = new ShopApi($appId, $appPassword, $shopApiHost, null, $logger);
    if (YII_DEBUG) {
        $shopApi->setLogTemplate(\Guzzle\Log\MessageFormatter::DEBUG_FORMAT);
    } else {
        $shopApi->setLogTemplate(\Guzzle\Log\MessageFormatter::SHORT_FORMAT);
    }
```


## Testing
```bash
php vendor/phpunit/phpunit/phpunit.php
```
{'fraction_non_alphanumeric': 0.14702622829700776, 'fraction_numerical': 0.002216475803472479, 'mean_word_length': 2.988217967599411, 'pattern_counts': {'":': 10, '<': 5, '<?xml version=': 0, '>': 13, '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': '2287778', 'n_tokens_mistral': 908, 'n_tokens_neox': 848, 'n_words': 196}