<commit_before>Webmozart JSON
==============

[![Build Status](https://travis-ci.org/webmozart/json.svg?branch=master)](https://travis-ci.org/webmozart/json)
[![Build status](https://ci.appveyor.com/api/projects/status/icccqc0aq1molo96/branch/master?svg=true)](https://ci.appveyor.com/project/webmozart/json/branch/master)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/webmozart/json/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/webmozart/json/?branch=master)
[![Latest Stable Version](https://poser.pugx.org/webmozart/json/v/stable.svg)](https://packagist.org/packages/webmozart/json)
[![Total Downloads](https://poser.pugx.org/webmozart/json/downloads.svg)](https://packagist.org/packages/webmozart/json)
[![Dependency Status](https://www.versioneye.com/php/webmozart:json/1.1.1/badge.svg)](https://www.versioneye.com/php/webmozart:json/1.1.1)

Latest release: [1.1.1](https://packagist.org/packages/webmozart/json#1.1.1)

A robust wrapper for `json_encode()`/`json_decode()` that normalizes their
behavior across PHP versions, throws meaningful exceptions and supports schema
validation by default.

Installation
------------

Use [Composer] to install the package:

```
$ composer require webmozart/json
```

Encoding
--------

Use the [`JsonEncoder`] to encode data as JSON:

```php
use Webmozart\Json\JsonEncoder;
<commit_msg>Updated latest version to "1.2.0"<commit_after>Webmozart JSON
==============

[![Build Status](https://travis-ci.org/webmozart/json.svg?branch=master)](https://travis-ci.org/webmozart/json)
[![Build status](https://ci.appveyor.com/api/projects/status/icccqc0aq1molo96/branch/master?svg=true)](https://ci.appveyor.com/project/webmozart/json/branch/master)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/webmozart/json/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/webmozart/json/?branch=master)
[![Latest Stable Version](https://poser.pugx.org/webmozart/json/v/stable.svg)](https://packagist.org/packages/webmozart/json)
[![Total Downloads](https://poser.pugx.org/webmozart/json/downloads.svg)](https://packagist.org/packages/webmozart/json)
[![Dependency Status](https://www.versioneye.com/php/webmozart:json/1.2.0/badge.svg)](https://www.versioneye.com/php/webmozart:json/1.2.0)

Latest release: [1.2.0](https://packagist.org/packages/webmozart/json#1.2.0)

A robust wrapper for `json_encode()`/`json_decode()` that normalizes their
behavior across PHP versions, throws meaningful exceptions and supports schema
validation by default.

Installation
------------

Use [Composer] to install the package:

```
$ composer require webmozart/json
```

Encoding
--------

Use the [`JsonEncoder`] to encode data as JSON:

```php
use Webmozart\Json\JsonEncoder;

{'fraction_non_alphanumeric': 0.19286754002911208, 'fraction_numerical': 0.012736535662299854, 'mean_word_length': 5.378190255220417, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 26, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '436107', 'n_tokens_mistral': 997, 'n_tokens_neox': 988, 'n_words': 128}