<commit_before>The Puli Discovery Component
============================

[![Build Status](https://travis-ci.org/puli/discovery.svg?branch=master)](https://travis-ci.org/puli/discovery)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/puli/discovery/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/puli/discovery/?branch=master)
[![SensioLabsInsight](https://insight.sensiolabs.com/projects/1d34f3b8-aafe-49c9-8eb8-df97ac8a1ba3/mini.png)](https://insight.sensiolabs.com/projects/1d34f3b8-aafe-49c9-8eb8-df97ac8a1ba3)
[![Latest Stable Version](https://poser.pugx.org/puli/discovery/v/stable.svg)](https://packagist.org/packages/puli/discovery)
[![Total Downloads](https://poser.pugx.org/puli/discovery/downloads.svg)](https://packagist.org/packages/puli/discovery)
[![Dependency Status](https://www.versioneye.com/php/puli:discovery/1.0.0/badge.svg)](https://www.versioneye.com/php/puli:discovery/1.0.0)

Latest release: none

PHP >= 5.3.9

The [Puli] Discovery Component supports binding of Puli resources to *binding
types*. Binding types can be defined with the `define()` method of the 
[`EditableDiscovery`] interface:

```php
use Puli\Discovery\InMemoryDiscovery;

// $repo is a Puli repository
$discovery = new InMemoryDiscovery($repo);

$discovery->define('doctrine/xml-mapping');
```

Resources in the repository can then be bound to the defined type with `bind()`:

```php
$discovery->bind('/app/config/doctrine/*.xml', 'doctrine/xml-mapping');
```

With `find()`, you can later retrieve all the bindings for the type:

```php
foreach ($discovery->find('doctrine/xml-mapping') as $binding) {
    foreach ($binding->getResources() as $resource) {
        // do something...
    }
}
```<commit_msg>Updated latest version to "1.0.0-beta"<commit_after>The Puli Discovery Component
============================

[![Build Status](https://travis-ci.org/puli/discovery.svg?branch=master)](https://travis-ci.org/puli/discovery)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/puli/discovery/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/puli/discovery/?branch=master)
[![SensioLabsInsight](https://insight.sensiolabs.com/projects/1d34f3b8-aafe-49c9-8eb8-df97ac8a1ba3/mini.png)](https://insight.sensiolabs.com/projects/1d34f3b8-aafe-49c9-8eb8-df97ac8a1ba3)
[![Latest Stable Version](https://poser.pugx.org/puli/discovery/v/stable.svg)](https://packagist.org/packages/puli/discovery)
[![Total Downloads](https://poser.pugx.org/puli/discovery/downloads.svg)](https://packagist.org/packages/puli/discovery)
[![Dependency Status](https://www.versioneye.com/php/puli:discovery/1.0.0/badge.svg)](https://www.versioneye.com/php/puli:discovery/1.0.0)

Latest release: [1.0.0-beta](https://packagist.org/packages/puli/discovery#1.0.0-beta)

PHP >= 5.3.9

The [Puli] Discovery Component supports binding of Puli resources to *binding
types*. Binding types can be defined with the `define()` method of the 
[`EditableDiscovery`] interface:

```php
use Puli\Discovery\InMemoryDiscovery;

// $repo is a Puli repository
$discovery = new InMemoryDiscovery($repo);

$discovery->define('doctrine/xml-mapping');
```

Resources in the repository can then be bound to the defined type with `bind()`:

```php
$discovery->bind('/app/config/doctrine/*.xml', 'doctrine/xml-mapping');
```

With `find()`, you can later retrieve all the bindings for the type:

```php
foreach ($discovery->find('doctrine/xml-mapping') as $binding) {
    foreach ($binding->getResources() as $resource) {
        // do something...
    }
}
```
{'fraction_non_alphanumeric': 0.18998029833943147, 'fraction_numerical': 0.024486349563748944, 'mean_word_length': 5.392086330935252, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 25, 'lorem ipsum': 0, 'www.': 4, 'xml': 8}, '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': '1933006', 'n_tokens_mistral': 1327, 'n_tokens_neox': 1233, 'n_words': 202}